Skip to content

Commit ff30295

Browse files
authored
Merge branch 'main' into fix/chroma-attention-mask
2 parents 7c16aa8 + 041501a commit ff30295

File tree

224 files changed

+16153
-4664
lines changed

Some content is hidden

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

224 files changed

+16153
-4664
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ jobs:
340340
- backend: "optimum_quanto"
341341
test_location: "quanto"
342342
additional_deps: []
343+
- backend: "nvidia_modelopt"
344+
test_location: "modelopt"
345+
additional_deps: []
343346
runs-on:
344347
group: aws-g6e-xlarge-plus
345348
container:

.github/workflows/pr_modular_tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ jobs:
110110
run: |
111111
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
112112
python -m uv pip install -e [quality,test]
113-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
114-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
113+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
114+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
115+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
115116
116117
- name: Environment
117118
run: |

.github/workflows/pr_tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ jobs:
116116
run: |
117117
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
118118
python -m uv pip install -e [quality,test]
119-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
120-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
119+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
120+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
121+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
121122
122123
- name: Environment
123124
run: |
@@ -253,9 +254,10 @@ jobs:
253254
python -m uv pip install -e [quality,test]
254255
# TODO (sayakpaul, DN6): revisit `--no-deps`
255256
python -m pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
256-
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
257-
python -m uv pip install -U tokenizers
258-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
257+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
258+
# python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
259+
# python -m uv pip install -U tokenizers
260+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
259261
260262
- name: Environment
261263
run: |

.github/workflows/pr_tests_gpu.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ jobs:
132132
run: |
133133
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
134134
python -m uv pip install -e [quality,test]
135-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
136-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
135+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
136+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
137+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
137138
138139
- name: Environment
139140
run: |
@@ -203,8 +204,9 @@ jobs:
203204
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
204205
python -m uv pip install -e [quality,test]
205206
python -m uv pip install peft@git+https://github.com/huggingface/peft.git
206-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
207-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
207+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
208+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
209+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
208210
209211
- name: Environment
210212
run: |
@@ -266,7 +268,8 @@ jobs:
266268
- name: Install dependencies
267269
run: |
268270
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
269-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
271+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
272+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
270273
python -m uv pip install -e [quality,test,training]
271274
272275
- name: Environment

docs/source/en/_toctree.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@
2323
- local: using-diffusers/reusing_seeds
2424
title: Reproducibility
2525
- local: using-diffusers/schedulers
26-
title: Load schedulers and models
27-
- local: using-diffusers/scheduler_features
28-
title: Scheduler features
26+
title: Schedulers
2927
- local: using-diffusers/other-formats
3028
title: Model files and layouts
3129
- local: using-diffusers/push_to_hub
32-
title: Push files to the Hub
30+
title: Sharing pipelines and models
3331

3432
- title: Adapters
3533
isExpanded: false
@@ -58,12 +56,6 @@
5856
title: Batch inference
5957
- local: training/distributed_inference
6058
title: Distributed inference
61-
- local: using-diffusers/scheduler_features
62-
title: Scheduler features
63-
- local: using-diffusers/callback
64-
title: Pipeline callbacks
65-
- local: using-diffusers/image_quality
66-
title: Controlling image quality
6759

6860
- title: Inference optimization
6961
isExpanded: false
@@ -72,10 +64,14 @@
7264
title: Accelerate inference
7365
- local: optimization/cache
7466
title: Caching
67+
- local: optimization/attention_backends
68+
title: Attention backends
7569
- local: optimization/memory
7670
title: Reduce memory usage
7771
- local: optimization/speed-memory-optims
7872
title: Compiling and offloading quantized models
73+
- local: api/parallel
74+
title: Parallel inference
7975
- title: Community optimizations
8076
sections:
8177
- local: optimization/pruna
@@ -86,12 +82,16 @@
8682
title: Token merging
8783
- local: optimization/deepcache
8884
title: DeepCache
85+
- local: optimization/cache_dit
86+
title: CacheDiT
8987
- local: optimization/tgate
9088
title: TGATE
9189
- local: optimization/xdit
9290
title: xDiT
9391
- local: optimization/para_attn
9492
title: ParaAttention
93+
- local: using-diffusers/image_quality
94+
title: FreeU
9595

9696
- title: Hybrid Inference
9797
isExpanded: false
@@ -188,6 +188,8 @@
188188
title: torchao
189189
- local: quantization/quanto
190190
title: quanto
191+
- local: quantization/modelopt
192+
title: NVIDIA ModelOpt
191193

192194
- title: Model accelerators and hardware
193195
isExpanded: false

docs/source/en/api/image_processor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ All pipelines with [`VaeImageProcessor`] accept PIL Image, PyTorch tensor, or Nu
2020

2121
[[autodoc]] image_processor.VaeImageProcessor
2222

23+
## InpaintProcessor
24+
25+
The [`InpaintProcessor`] accepts `mask` and `image` inputs and process them together. Optionally, it can accept padding_mask_crop and apply mask overlay.
26+
27+
[[autodoc]] image_processor.InpaintProcessor
28+
2329
## VaeImageProcessorLDM3D
2430

2531
The [`VaeImageProcessorLDM3D`] accepts RGB and depth inputs and returns RGB and depth outputs.

docs/source/en/api/parallel.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Copyright 2025 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License. -->
11+
12+
# Parallelism
13+
14+
Parallelism strategies help speed up diffusion transformers by distributing computations across multiple devices, allowing for faster inference/training times.
15+
16+
## ParallelConfig
17+
18+
[[autodoc]] ParallelConfig
19+
20+
## ContextParallelConfig
21+
22+
[[autodoc]] ContextParallelConfig
23+
24+
[[autodoc]] hooks.apply_context_parallel

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ from diffusers.utils import export_to_video
5050
pipeline_quant_config = PipelineQuantizationConfig(
5151
quant_backend="torchao",
5252
quant_kwargs={"quant_type": "int8wo"},
53-
components_to_quantize=["transformer"]
53+
components_to_quantize="transformer"
5454
)
5555

5656
# fp8 layerwise weight-casting

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pipeline_quant_config = PipelineQuantizationConfig(
5454
"bnb_4bit_quant_type": "nf4",
5555
"bnb_4bit_compute_dtype": torch.bfloat16
5656
},
57-
components_to_quantize=["transformer"]
57+
components_to_quantize="transformer"
5858
)
5959

6060
pipeline = HunyuanVideoPipeline.from_pretrained(
@@ -91,7 +91,7 @@ pipeline_quant_config = PipelineQuantizationConfig(
9191
"bnb_4bit_quant_type": "nf4",
9292
"bnb_4bit_compute_dtype": torch.bfloat16
9393
},
94-
components_to_quantize=["transformer"]
94+
components_to_quantize="transformer"
9595
)
9696

9797
pipeline = HunyuanVideoPipeline.from_pretrained(
@@ -139,7 +139,7 @@ export_to_video(video, "output.mp4", fps=15)
139139
"bnb_4bit_quant_type": "nf4",
140140
"bnb_4bit_compute_dtype": torch.bfloat16
141141
},
142-
components_to_quantize=["transformer"]
142+
components_to_quantize="transformer"
143143
)
144144

145145
pipeline = HunyuanVideoPipeline.from_pretrained(

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Qwen-Image comes in the following variants:
2626
|:----------:|:--------:|
2727
| Qwen-Image | [`Qwen/Qwen-Image`](https://huggingface.co/Qwen/Qwen-Image) |
2828
| Qwen-Image-Edit | [`Qwen/Qwen-Image-Edit`](https://huggingface.co/Qwen/Qwen-Image-Edit) |
29+
| Qwen-Image-Edit Plus | [Qwen/Qwen-Image-Edit-2509](https://huggingface.co/Qwen/Qwen-Image-Edit-2509) |
2930

3031
<Tip>
3132

@@ -96,6 +97,29 @@ The `guidance_scale` parameter in the pipeline is there to support future guidan
9697

9798
</Tip>
9899

100+
## Multi-image reference with QwenImageEditPlusPipeline
101+
102+
With [`QwenImageEditPlusPipeline`], one can provide multiple images as input reference.
103+
104+
```
105+
import torch
106+
from PIL import Image
107+
from diffusers import QwenImageEditPlusPipeline
108+
from diffusers.utils import load_image
109+
110+
pipe = QwenImageEditPlusPipeline.from_pretrained(
111+
"Qwen/Qwen-Image-Edit-2509", torch_dtype=torch.bfloat16
112+
).to("cuda")
113+
114+
image_1 = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/grumpy.jpg")
115+
image_2 = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/peng.png")
116+
image = pipe(
117+
image=[image_1, image_2],
118+
prompt="put the penguin and the cat at a game show called "Qwen Edit Plus Games"",
119+
num_inference_steps=50
120+
).images[0]
121+
```
122+
99123
## QwenImagePipeline
100124

101125
[[autodoc]] QwenImagePipeline
@@ -120,7 +144,21 @@ The `guidance_scale` parameter in the pipeline is there to support future guidan
120144
- all
121145
- __call__
122146

123-
## QwenImaggeControlNetPipeline
147+
## QwenImageEditInpaintPipeline
148+
149+
[[autodoc]] QwenImageEditInpaintPipeline
150+
- all
151+
- __call__
152+
153+
## QwenImageControlNetPipeline
154+
155+
[[autodoc]] QwenImageControlNetPipeline
156+
- all
157+
- __call__
158+
159+
## QwenImageEditPlusPipeline
160+
161+
[[autodoc]] QwenImageEditPlusPipeline
124162
- all
125163
- __call__
126164

0 commit comments

Comments
 (0)