Skip to content

Commit fae8b6c

Browse files
authored
Merge branch 'main' into test-better-torch-compile
2 parents a8184ef + bbd0c16 commit fae8b6c

File tree

72 files changed

+870
-857
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+870
-857
lines changed

docker/diffusers-onnxruntime-cpu/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ ENV PATH="/opt/venv/bin:$PATH"
2828
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2929
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
3030
python3 -m uv pip install --no-cache-dir \
31-
torch==2.1.2 \
32-
torchvision==0.16.2 \
33-
torchaudio==2.1.2 \
31+
torch \
32+
torchvision \
33+
torchaudio\
3434
onnxruntime \
3535
--extra-index-url https://download.pytorch.org/whl/cpu && \
3636
python3 -m uv pip install --no-cache-dir \

docs/source/en/_toctree.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@
290290
title: AuraFlowTransformer2DModel
291291
- local: api/models/cogvideox_transformer3d
292292
title: CogVideoXTransformer3DModel
293-
- local: api/models/consisid_transformer3d
294-
title: ConsisIDTransformer3DModel
295293
- local: api/models/cogview3plus_transformer2d
296294
title: CogView3PlusTransformer2DModel
297295
- local: api/models/cogview4_transformer2d
298296
title: CogView4Transformer2DModel
297+
- local: api/models/consisid_transformer3d
298+
title: ConsisIDTransformer3DModel
299299
- local: api/models/dit_transformer2d
300300
title: DiTTransformer2DModel
301301
- local: api/models/easyanimate_transformer3d
@@ -310,12 +310,12 @@
310310
title: HunyuanVideoTransformer3DModel
311311
- local: api/models/latte_transformer3d
312312
title: LatteTransformer3DModel
313-
- local: api/models/lumina_nextdit2d
314-
title: LuminaNextDiT2DModel
315-
- local: api/models/lumina2_transformer2d
316-
title: Lumina2Transformer2DModel
317313
- local: api/models/ltx_video_transformer3d
318314
title: LTXVideoTransformer3DModel
315+
- local: api/models/lumina2_transformer2d
316+
title: Lumina2Transformer2DModel
317+
- local: api/models/lumina_nextdit2d
318+
title: LuminaNextDiT2DModel
319319
- local: api/models/mochi_transformer3d
320320
title: MochiTransformer3DModel
321321
- local: api/models/omnigen_transformer
@@ -324,10 +324,10 @@
324324
title: PixArtTransformer2DModel
325325
- local: api/models/prior_transformer
326326
title: PriorTransformer
327-
- local: api/models/sd3_transformer2d
328-
title: SD3Transformer2DModel
329327
- local: api/models/sana_transformer2d
330328
title: SanaTransformer2DModel
329+
- local: api/models/sd3_transformer2d
330+
title: SD3Transformer2DModel
331331
- local: api/models/stable_audio_transformer
332332
title: StableAudioDiTModel
333333
- local: api/models/transformer2d
@@ -342,10 +342,10 @@
342342
title: StableCascadeUNet
343343
- local: api/models/unet
344344
title: UNet1DModel
345-
- local: api/models/unet2d
346-
title: UNet2DModel
347345
- local: api/models/unet2d-cond
348346
title: UNet2DConditionModel
347+
- local: api/models/unet2d
348+
title: UNet2DModel
349349
- local: api/models/unet3d-cond
350350
title: UNet3DConditionModel
351351
- local: api/models/unet-motion
@@ -354,6 +354,10 @@
354354
title: UViT2DModel
355355
title: UNets
356356
- sections:
357+
- local: api/models/asymmetricautoencoderkl
358+
title: AsymmetricAutoencoderKL
359+
- local: api/models/autoencoder_dc
360+
title: AutoencoderDC
357361
- local: api/models/autoencoderkl
358362
title: AutoencoderKL
359363
- local: api/models/autoencoderkl_allegro
@@ -370,10 +374,6 @@
370374
title: AutoencoderKLMochi
371375
- local: api/models/autoencoder_kl_wan
372376
title: AutoencoderKLWan
373-
- local: api/models/asymmetricautoencoderkl
374-
title: AsymmetricAutoencoderKL
375-
- local: api/models/autoencoder_dc
376-
title: AutoencoderDC
377377
- local: api/models/consistency_decoder_vae
378378
title: ConsistencyDecoderVAE
379379
- local: api/models/autoencoder_oobleck
@@ -521,40 +521,40 @@
521521
- sections:
522522
- local: api/pipelines/stable_diffusion/overview
523523
title: Overview
524-
- local: api/pipelines/stable_diffusion/text2img
525-
title: Text-to-image
524+
- local: api/pipelines/stable_diffusion/depth2img
525+
title: Depth-to-image
526+
- local: api/pipelines/stable_diffusion/gligen
527+
title: GLIGEN (Grounded Language-to-Image Generation)
528+
- local: api/pipelines/stable_diffusion/image_variation
529+
title: Image variation
526530
- local: api/pipelines/stable_diffusion/img2img
527531
title: Image-to-image
528532
- local: api/pipelines/stable_diffusion/svd
529533
title: Image-to-video
530534
- local: api/pipelines/stable_diffusion/inpaint
531535
title: Inpainting
532-
- local: api/pipelines/stable_diffusion/depth2img
533-
title: Depth-to-image
534-
- local: api/pipelines/stable_diffusion/image_variation
535-
title: Image variation
536+
- local: api/pipelines/stable_diffusion/k_diffusion
537+
title: K-Diffusion
538+
- local: api/pipelines/stable_diffusion/latent_upscale
539+
title: Latent upscaler
540+
- local: api/pipelines/stable_diffusion/ldm3d_diffusion
541+
title: LDM3D Text-to-(RGB, Depth), Text-to-(RGB-pano, Depth-pano), LDM3D Upscaler
536542
- local: api/pipelines/stable_diffusion/stable_diffusion_safe
537543
title: Safe Stable Diffusion
544+
- local: api/pipelines/stable_diffusion/sdxl_turbo
545+
title: SDXL Turbo
538546
- local: api/pipelines/stable_diffusion/stable_diffusion_2
539547
title: Stable Diffusion 2
540548
- local: api/pipelines/stable_diffusion/stable_diffusion_3
541549
title: Stable Diffusion 3
542550
- local: api/pipelines/stable_diffusion/stable_diffusion_xl
543551
title: Stable Diffusion XL
544-
- local: api/pipelines/stable_diffusion/sdxl_turbo
545-
title: SDXL Turbo
546-
- local: api/pipelines/stable_diffusion/latent_upscale
547-
title: Latent upscaler
548552
- local: api/pipelines/stable_diffusion/upscale
549553
title: Super-resolution
550-
- local: api/pipelines/stable_diffusion/k_diffusion
551-
title: K-Diffusion
552-
- local: api/pipelines/stable_diffusion/ldm3d_diffusion
553-
title: LDM3D Text-to-(RGB, Depth), Text-to-(RGB-pano, Depth-pano), LDM3D Upscaler
554554
- local: api/pipelines/stable_diffusion/adapter
555555
title: T2I-Adapter
556-
- local: api/pipelines/stable_diffusion/gligen
557-
title: GLIGEN (Grounded Language-to-Image Generation)
556+
- local: api/pipelines/stable_diffusion/text2img
557+
title: Text-to-image
558558
title: Stable Diffusion
559559
- local: api/pipelines/stable_unclip
560560
title: Stable unCLIP

docs/source/en/api/loaders/lora.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi
2525
- [`SanaLoraLoaderMixin`] provides similar functions for [Sana](https://huggingface.co/docs/diffusers/main/en/api/pipelines/sana).
2626
- [`HunyuanVideoLoraLoaderMixin`] provides similar functions for [HunyuanVideo](https://huggingface.co/docs/diffusers/main/en/api/pipelines/hunyuan_video).
2727
- [`Lumina2LoraLoaderMixin`] provides similar functions for [Lumina2](https://huggingface.co/docs/diffusers/main/en/api/pipelines/lumina2).
28+
- [`WanLoraLoaderMixin`] provides similar functions for [Wan](https://huggingface.co/docs/diffusers/main/en/api/pipelines/wan).
29+
- [`CogView4LoraLoaderMixin`] provides similar functions for [CogView4](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogview4).
2830
- [`AmusedLoraLoaderMixin`] is for the [`AmusedPipeline`].
2931
- [`LoraBaseMixin`] provides a base class with several utility methods to fuse, unfuse, unload, LoRAs and more.
3032

@@ -77,6 +79,14 @@ To learn more about how to load LoRA weights, see the [LoRA](../../using-diffuse
7779

7880
[[autodoc]] loaders.lora_pipeline.Lumina2LoraLoaderMixin
7981

82+
## CogView4LoraLoaderMixin
83+
84+
[[autodoc]] loaders.lora_pipeline.CogView4LoraLoaderMixin
85+
86+
## WanLoraLoaderMixin
87+
88+
[[autodoc]] loaders.lora_pipeline.WanLoraLoaderMixin
89+
8090
## AmusedLoraLoaderMixin
8191

8292
[[autodoc]] loaders.lora_pipeline.AmusedLoraLoaderMixin

docs/source/en/api/pipelines/aura_flow.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ image = pipeline(prompt).images[0]
8989
image.save("auraflow.png")
9090
```
9191

92+
## Support for `torch.compile()`
93+
94+
AuraFlow can be compiled with `torch.compile()` to speed up inference latency even for different resolutions. First, install PyTorch nightly following the instructions from [here](https://pytorch.org/). The snippet below shows the changes needed to enable this:
95+
96+
```diff
97+
+ torch.fx.experimental._config.use_duck_shape = False
98+
+ pipeline.transformer = torch.compile(
99+
pipeline.transformer, fullgraph=True, dynamic=True
100+
)
101+
```
102+
103+
Specifying `use_duck_shape` to be `False` instructs the compiler if it should use the same symbolic variable to represent input sizes that are the same. For more details, check out [this comment](https://github.com/huggingface/diffusers/pull/11327#discussion_r2047659790).
104+
105+
This enables from 100% (on low resolutions) to a 30% (on 1536x1536 resolution) speed improvements.
106+
107+
Thanks to [AstraliteHeart](https://github.com/huggingface/diffusers/pull/11297/) who helped us rewrite the [`AuraFlowTransformer2DModel`] class so that the above works for different resolutions ([PR](https://github.com/huggingface/diffusers/pull/11297/)).
108+
92109
## AuraFlowPipeline
93110

94111
[[autodoc]] AuraFlowPipeline

examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
import wandb
7575

7676
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
77-
check_min_version("0.33.0.dev0")
77+
check_min_version("0.34.0.dev0")
7878

7979
logger = get_logger(__name__)
8080

examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474

7575
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
76-
check_min_version("0.33.0.dev0")
76+
check_min_version("0.34.0.dev0")
7777

7878
logger = get_logger(__name__)
7979

examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
import wandb
8181

8282
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
83-
check_min_version("0.33.0.dev0")
83+
check_min_version("0.34.0.dev0")
8484

8585
logger = get_logger(__name__)
8686

examples/cogvideo/train_cogvideox_image_to_video_lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
import wandb
6262

6363
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
64-
check_min_version("0.33.0.dev0")
64+
check_min_version("0.34.0.dev0")
6565

6666
logger = get_logger(__name__)
6767

examples/cogvideo/train_cogvideox_lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import wandb
5353

5454
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
55-
check_min_version("0.33.0.dev0")
55+
check_min_version("0.34.0.dev0")
5656

5757
logger = get_logger(__name__)
5858

examples/cogview4-control/train_control_cogview4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import wandb
6060

6161
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
62-
check_min_version("0.33.0.dev0")
62+
check_min_version("0.34.0.dev0")
6363

6464
logger = get_logger(__name__)
6565

0 commit comments

Comments
 (0)