Skip to content

Commit 9de5739

Browse files
authored
Merge branch 'main' into disable-mmap-pipeline
2 parents 287331d + f12d161 commit 9de5739

File tree

225 files changed

+25395
-3549
lines changed

Some content is hidden

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

225 files changed

+25395
-3549
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ jobs:
7373
run: |
7474
uv pip install -e ".[quality]"
7575
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
76+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
77+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
7678
uv pip install pytest-reportlog
7779
- name: Environment
7880
run: |
@@ -84,7 +86,7 @@ jobs:
8486
CUBLAS_WORKSPACE_CONFIG: :16:8
8587
run: |
8688
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
87-
-k "not Flax and not Onnx" \
89+
-k "not Flax and not Onnx" \
8890
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
8991
--report-log=tests_pipeline_${{ matrix.module }}_cuda.log \
9092
tests/pipelines/${{ matrix.module }}
@@ -126,6 +128,8 @@ jobs:
126128
uv pip install -e ".[quality]"
127129
uv pip install peft@git+https://github.com/huggingface/peft.git
128130
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
131+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
132+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
129133
uv pip install pytest-reportlog
130134
- name: Environment
131135
run: python utils/print_env.py
@@ -190,6 +194,8 @@ jobs:
190194
- name: Install dependencies
191195
run: |
192196
uv pip install -e ".[quality,training]"
197+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
198+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
193199
- name: Environment
194200
run: |
195201
python utils/print_env.py
@@ -232,6 +238,8 @@ jobs:
232238
uv pip install -e ".[quality]"
233239
uv pip install peft@git+https://github.com/huggingface/peft.git
234240
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
241+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
242+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
235243
uv pip install pytest-reportlog
236244
- name: Environment
237245
run: |
@@ -281,6 +289,8 @@ jobs:
281289
uv pip install -e ".[quality]"
282290
uv pip install peft@git+https://github.com/huggingface/peft.git
283291
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
292+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
293+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
284294
285295
- name: Environment
286296
run: |
@@ -358,6 +368,8 @@ jobs:
358368
uv pip install ${{ join(matrix.config.additional_deps, ' ') }}
359369
fi
360370
uv pip install pytest-reportlog
371+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
372+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
361373
- name: Environment
362374
run: |
363375
python utils/print_env.py
@@ -405,6 +417,8 @@ jobs:
405417
run: |
406418
uv pip install -e ".[quality]"
407419
uv pip install -U bitsandbytes optimum_quanto
420+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
421+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
408422
uv pip install pytest-reportlog
409423
- name: Environment
410424
run: |
@@ -531,7 +545,7 @@ jobs:
531545
# HF_HOME: /System/Volumes/Data/mnt/cache
532546
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
533547
# run: |
534-
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
548+
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
535549
# --report-log=tests_torch_mps.log \
536550
# tests/
537551
# - name: Failure short reports
@@ -587,7 +601,7 @@ jobs:
587601
# HF_HOME: /System/Volumes/Data/mnt/cache
588602
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
589603
# run: |
590-
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
604+
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
591605
# --report-log=tests_torch_mps.log \
592606
# tests/
593607
# - name: Failure short reports

.github/workflows/pr_modular_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ jobs:
109109
- name: Install dependencies
110110
run: |
111111
uv pip install -e ".[quality]"
112-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
112+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
113+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
113114
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
114115
115116
- name: Environment

.github/workflows/pr_tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ jobs:
115115
- name: Install dependencies
116116
run: |
117117
uv pip install -e ".[quality]"
118-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
118+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
119+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
119120
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
120121
121122
- name: Environment
@@ -246,7 +247,8 @@ jobs:
246247
uv pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
247248
uv pip install -U tokenizers
248249
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
249-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
250+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
251+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
250252
251253
- name: Environment
252254
run: |

.github/workflows/pr_tests_gpu.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Fast GPU Tests on PR
1+
name: Fast GPU Tests on PR
22

33
on:
44
pull_request:
@@ -71,7 +71,7 @@ jobs:
7171
if: ${{ failure() }}
7272
run: |
7373
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
74-
74+
7575
setup_torch_cuda_pipeline_matrix:
7676
needs: [check_code_quality, check_repository_consistency]
7777
name: Setup Torch Pipelines CUDA Slow Tests Matrix
@@ -131,7 +131,8 @@ jobs:
131131
run: |
132132
uv pip install -e ".[quality]"
133133
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
134-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
134+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
135+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
135136
136137
- name: Environment
137138
run: |
@@ -149,18 +150,18 @@ jobs:
149150
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
150151
CUBLAS_WORKSPACE_CONFIG: :16:8
151152
run: |
152-
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
153+
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
153154
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
154155
-k "not Flax and not Onnx" \
155156
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
156157
tests/pipelines/${{ matrix.module }}
157-
else
158+
else
158159
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
159160
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
160161
-k "not Flax and not Onnx and $pattern" \
161162
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
162163
tests/pipelines/${{ matrix.module }}
163-
fi
164+
fi
164165
165166
- name: Failure short reports
166167
if: ${{ failure() }}
@@ -201,7 +202,8 @@ jobs:
201202
uv pip install -e ".[quality]"
202203
uv pip install peft@git+https://github.com/huggingface/peft.git
203204
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
204-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
205+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
206+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
205207
206208
- name: Environment
207209
run: |
@@ -223,10 +225,10 @@ jobs:
223225
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
224226
if [ -z "$pattern" ]; then
225227
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx" tests/${{ matrix.module }} \
226-
--make-reports=tests_torch_cuda_${{ matrix.module }}
228+
--make-reports=tests_torch_cuda_${{ matrix.module }}
227229
else
228230
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx and $pattern" tests/${{ matrix.module }} \
229-
--make-reports=tests_torch_cuda_${{ matrix.module }}
231+
--make-reports=tests_torch_cuda_${{ matrix.module }}
230232
fi
231233
232234
- name: Failure short reports
@@ -262,7 +264,8 @@ jobs:
262264
nvidia-smi
263265
- name: Install dependencies
264266
run: |
265-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
267+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
268+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
266269
uv pip install -e ".[quality,training]"
267270
268271
- name: Environment

.github/workflows/push_tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ jobs:
7676
run: |
7777
uv pip install -e ".[quality]"
7878
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
79-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
79+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
80+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
8081
- name: Environment
8182
run: |
8283
python utils/print_env.py
@@ -128,7 +129,8 @@ jobs:
128129
uv pip install -e ".[quality]"
129130
uv pip install peft@git+https://github.com/huggingface/peft.git
130131
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
131-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
132+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
133+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
132134
133135
- name: Environment
134136
run: |
@@ -180,7 +182,8 @@ jobs:
180182
- name: Install dependencies
181183
run: |
182184
uv pip install -e ".[quality,training]"
183-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
185+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
186+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
184187
- name: Environment
185188
run: |
186189
python utils/print_env.py

docs/source/en/_toctree.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@
349349
title: DiTTransformer2DModel
350350
- local: api/models/easyanimate_transformer3d
351351
title: EasyAnimateTransformer3DModel
352+
- local: api/models/flux2_transformer
353+
title: Flux2Transformer2DModel
352354
- local: api/models/flux_transformer
353355
title: FluxTransformer2DModel
354356
- local: api/models/hidream_image_transformer
@@ -357,6 +359,8 @@
357359
title: HunyuanDiT2DModel
358360
- local: api/models/hunyuanimage_transformer_2d
359361
title: HunyuanImageTransformer2DModel
362+
- local: api/models/hunyuan_video15_transformer_3d
363+
title: HunyuanVideo15Transformer3DModel
360364
- local: api/models/hunyuan_video_transformer_3d
361365
title: HunyuanVideoTransformer3DModel
362366
- local: api/models/latte_transformer3d
@@ -371,6 +375,8 @@
371375
title: MochiTransformer3DModel
372376
- local: api/models/omnigen_transformer
373377
title: OmniGenTransformer2DModel
378+
- local: api/models/ovisimage_transformer2d
379+
title: OvisImageTransformer2DModel
374380
- local: api/models/pixart_transformer2d
375381
title: PixArtTransformer2DModel
376382
- local: api/models/prior_transformer
@@ -431,6 +437,8 @@
431437
title: AutoencoderKLHunyuanImageRefiner
432438
- local: api/models/autoencoder_kl_hunyuan_video
433439
title: AutoencoderKLHunyuanVideo
440+
- local: api/models/autoencoder_kl_hunyuan_video15
441+
title: AutoencoderKLHunyuanVideo15
434442
- local: api/models/autoencoderkl_ltx_video
435443
title: AutoencoderKLLTXVideo
436444
- local: api/models/autoencoderkl_magvit
@@ -525,6 +533,8 @@
525533
title: EasyAnimate
526534
- local: api/pipelines/flux
527535
title: Flux
536+
- local: api/pipelines/flux2
537+
title: Flux2
528538
- local: api/pipelines/control_flux_inpaint
529539
title: FluxControlInpaint
530540
- local: api/pipelines/hidream
@@ -559,6 +569,8 @@
559569
title: MultiDiffusion
560570
- local: api/pipelines/omnigen
561571
title: OmniGen
572+
- local: api/pipelines/ovis_image
573+
title: Ovis-Image
562574
- local: api/pipelines/pag
563575
title: PAG
564576
- local: api/pipelines/paint_by_example
@@ -648,8 +660,12 @@
648660
title: Framepack
649661
- local: api/pipelines/hunyuan_video
650662
title: HunyuanVideo
663+
- local: api/pipelines/hunyuan_video15
664+
title: HunyuanVideo1.5
651665
- local: api/pipelines/i2vgenxl
652666
title: I2VGen-XL
667+
- local: api/pipelines/kandinsky5_image
668+
title: Kandinsky 5.0 Image
653669
- local: api/pipelines/kandinsky5_video
654670
title: Kandinsky 5.0 Video
655671
- local: api/pipelines/latte

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi
3030
- [`CogView4LoraLoaderMixin`] provides similar functions for [CogView4](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogview4).
3131
- [`AmusedLoraLoaderMixin`] is for the [`AmusedPipeline`].
3232
- [`HiDreamImageLoraLoaderMixin`] provides similar functions for [HiDream Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/hidream)
33-
- [`QwenImageLoraLoaderMixin`] provides similar functions for [Qwen Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/qwen)
33+
- [`QwenImageLoraLoaderMixin`] provides similar functions for [Qwen Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/qwen).
34+
- [`ZImageLoraLoaderMixin`] provides similar functions for [Z-Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/zimage).
35+
- [`Flux2LoraLoaderMixin`] provides similar functions for [Flux2](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux2).
3436
- [`LoraBaseMixin`] provides a base class with several utility methods to fuse, unfuse, unload, LoRAs and more.
3537

3638
> [!TIP]
@@ -56,6 +58,10 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi
5658

5759
[[autodoc]] loaders.lora_pipeline.FluxLoraLoaderMixin
5860

61+
## Flux2LoraLoaderMixin
62+
63+
[[autodoc]] loaders.lora_pipeline.Flux2LoraLoaderMixin
64+
5965
## CogVideoXLoraLoaderMixin
6066

6167
[[autodoc]] loaders.lora_pipeline.CogVideoXLoraLoaderMixin
@@ -107,6 +113,10 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi
107113

108114
[[autodoc]] loaders.lora_pipeline.QwenImageLoraLoaderMixin
109115

116+
## ZImageLoraLoaderMixin
117+
118+
[[autodoc]] loaders.lora_pipeline.ZImageLoraLoaderMixin
119+
110120
## KandinskyLoraLoaderMixin
111121
[[autodoc]] loaders.lora_pipeline.KandinskyLoraLoaderMixin
112122

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
# AutoencoderKLHunyuanVideo15
13+
14+
The 3D variational autoencoder (VAE) model with KL loss used in [HunyuanVideo1.5](https://github.com/Tencent/HunyuanVideo1-1.5) by Tencent.
15+
16+
The model can be loaded with the following code snippet.
17+
18+
```python
19+
from diffusers import AutoencoderKLHunyuanVideo15
20+
21+
vae = AutoencoderKLHunyuanVideo15.from_pretrained("hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2v", subfolder="vae", torch_dtype=torch.float32)
22+
23+
# make sure to enable tiling to avoid OOM
24+
vae.enable_tiling()
25+
```
26+
27+
## AutoencoderKLHunyuanVideo15
28+
29+
[[autodoc]] AutoencoderKLHunyuanVideo15
30+
- decode
31+
- encode
32+
- all
33+
34+
## DecoderOutput
35+
36+
[[autodoc]] models.autoencoders.vae.DecoderOutput
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
13+
# Flux2Transformer2DModel
14+
15+
A Transformer model for image-like data from [Flux2](https://hf.co/black-forest-labs/FLUX.2-dev).
16+
17+
## Flux2Transformer2DModel
18+
19+
[[autodoc]] Flux2Transformer2DModel

0 commit comments

Comments
 (0)