Skip to content

Commit 1d9e0c0

Browse files
authored
Merge branch 'main' into main
2 parents 9c55c02 + 5551506 commit 1d9e0c0

File tree

267 files changed

+29303
-2438
lines changed

Some content is hidden

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

267 files changed

+29303
-2438
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ jobs:
418418
test_location: "gguf"
419419
- backend: "torchao"
420420
test_location: "torchao"
421+
- backend: "optimum_quanto"
422+
test_location: "quanto"
421423
runs-on:
422424
group: aws-g6e-xlarge-plus
423425
container:

.github/workflows/pr_style_bot.yml

Lines changed: 40 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -9,119 +9,43 @@ permissions:
99
pull-requests: write
1010

1111
jobs:
12-
run-style-bot:
13-
if: >
14-
contains(github.event.comment.body, '@bot /style') &&
15-
github.event.issue.pull_request != null
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- name: Extract PR details
20-
id: pr_info
21-
uses: actions/github-script@v6
22-
with:
23-
script: |
24-
const prNumber = context.payload.issue.number;
25-
const { data: pr } = await github.rest.pulls.get({
26-
owner: context.repo.owner,
27-
repo: context.repo.repo,
28-
pull_number: prNumber
29-
});
30-
31-
// We capture both the branch ref and the "full_name" of the head repo
32-
// so that we can check out the correct repository & branch (including forks).
33-
core.setOutput("prNumber", prNumber);
34-
core.setOutput("headRef", pr.head.ref);
35-
core.setOutput("headRepoFullName", pr.head.repo.full_name);
36-
37-
- name: Check out PR branch
38-
uses: actions/checkout@v3
39-
env:
40-
HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
41-
HEADREF: ${{ steps.pr_info.outputs.headRef }}
42-
with:
43-
# Instead of checking out the base repo, use the contributor's repo name
44-
repository: ${{ env.HEADREPOFULLNAME }}
45-
ref: ${{ env.HEADREF }}
46-
# You may need fetch-depth: 0 for being able to push
47-
fetch-depth: 0
48-
token: ${{ secrets.GITHUB_TOKEN }}
49-
50-
- name: Debug
51-
env:
52-
HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
53-
HEADREF: ${{ steps.pr_info.outputs.headRef }}
54-
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
55-
run: |
56-
echo "PR number: $PRNUMBER"
57-
echo "Head Ref: $HEADREF"
58-
echo "Head Repo Full Name: $HEADREPOFULLNAME"
59-
60-
- name: Set up Python
61-
uses: actions/setup-python@v4
62-
63-
- name: Install dependencies
64-
run: |
65-
pip install .[quality]
66-
67-
- name: Download Makefile from main branch
68-
run: |
69-
curl -o main_Makefile https://raw.githubusercontent.com/huggingface/diffusers/main/Makefile
70-
71-
- name: Compare Makefiles
72-
run: |
73-
if ! diff -q main_Makefile Makefile; then
74-
echo "Error: The Makefile has changed. Please ensure it matches the main branch."
75-
exit 1
76-
fi
77-
echo "No changes in Makefile. Proceeding..."
78-
rm -rf main_Makefile
79-
80-
- name: Run make style and make quality
81-
run: |
82-
make style && make quality
83-
84-
- name: Commit and push changes
85-
id: commit_and_push
86-
env:
87-
HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
88-
HEADREF: ${{ steps.pr_info.outputs.headRef }}
89-
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
90-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
run: |
92-
echo "HEADREPOFULLNAME: $HEADREPOFULLNAME, HEADREF: $HEADREF"
93-
# Configure git with the Actions bot user
94-
git config user.name "github-actions[bot]"
95-
git config user.email "github-actions[bot]@users.noreply.github.com"
96-
97-
# Make sure your 'origin' remote is set to the contributor's fork
98-
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/$HEADREPOFULLNAME.git"
99-
100-
# If there are changes after running style/quality, commit them
101-
if [ -n "$(git status --porcelain)" ]; then
102-
git add .
103-
git commit -m "Apply style fixes"
104-
# Push to the original contributor's forked branch
105-
git push origin HEAD:$HEADREF
106-
echo "changes_pushed=true" >> $GITHUB_OUTPUT
107-
else
108-
echo "No changes to commit."
109-
echo "changes_pushed=false" >> $GITHUB_OUTPUT
110-
fi
111-
112-
- name: Comment on PR with workflow run link
113-
if: steps.commit_and_push.outputs.changes_pushed == 'true'
114-
uses: actions/github-script@v6
115-
with:
116-
script: |
117-
const prNumber = parseInt(process.env.prNumber, 10);
118-
const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
119-
120-
await github.rest.issues.createComment({
121-
owner: context.repo.owner,
122-
repo: context.repo.repo,
123-
issue_number: prNumber,
124-
body: `Style fixes have been applied. [View the workflow run here](${runUrl}).`
125-
});
126-
env:
127-
prNumber: ${{ steps.pr_info.outputs.prNumber }}
12+
style:
13+
uses: huggingface/huggingface_hub/.github/workflows/style-bot-action.yml@main
14+
with:
15+
python_quality_dependencies: "[quality]"
16+
pre_commit_script_name: "Download and Compare files from the main branch"
17+
pre_commit_script: |
18+
echo "Downloading the files from the main branch"
19+
20+
curl -o main_Makefile https://raw.githubusercontent.com/huggingface/diffusers/main/Makefile
21+
curl -o main_setup.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/setup.py
22+
curl -o main_check_doc_toc.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/utils/check_doc_toc.py
23+
24+
echo "Compare the files and raise error if needed"
25+
26+
diff_failed=0
27+
if ! diff -q main_Makefile Makefile; then
28+
echo "Error: The Makefile has changed. Please ensure it matches the main branch."
29+
diff_failed=1
30+
fi
31+
32+
if ! diff -q main_setup.py setup.py; then
33+
echo "Error: The setup.py has changed. Please ensure it matches the main branch."
34+
diff_failed=1
35+
fi
36+
37+
if ! diff -q main_check_doc_toc.py utils/check_doc_toc.py; then
38+
echo "Error: The utils/check_doc_toc.py has changed. Please ensure it matches the main branch."
39+
diff_failed=1
40+
fi
41+
42+
if [ $diff_failed -eq 1 ]; then
43+
echo "❌ Error happened as we detected changes in the files that should not be changed ❌"
44+
exit 1
45+
fi
46+
47+
echo "No changes in the files. Proceeding..."
48+
rm -rf main_Makefile main_setup.py main_check_doc_toc.py
49+
style_command: "make style && make quality"
50+
secrets:
51+
bot_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Fast tests for PRs
33
on:
44
pull_request:
55
branches: [main]
6-
types: [synchronize]
76
paths:
87
- "src/diffusers/**.py"
98
- "benchmarks/**.py"

.github/workflows/pr_tests_gpu.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
- "src/diffusers/loaders/lora_base.py"
1212
- "src/diffusers/loaders/lora_pipeline.py"
1313
- "src/diffusers/loaders/peft.py"
14+
- "tests/pipelines/test_pipelines_common.py"
15+
- "tests/models/test_modeling_common.py"
1416
workflow_dispatch:
1517

1618
concurrency:
@@ -104,11 +106,18 @@ jobs:
104106
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
105107
CUBLAS_WORKSPACE_CONFIG: :16:8
106108
run: |
107-
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
108-
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
109-
-s -v -k "not Flax and not Onnx and $pattern" \
110-
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
111-
tests/pipelines/${{ matrix.module }}
109+
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
110+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
111+
-s -v -k "not Flax and not Onnx" \
112+
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
113+
tests/pipelines/${{ matrix.module }}
114+
else
115+
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
116+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
117+
-s -v -k "not Flax and not Onnx and $pattern" \
118+
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
119+
tests/pipelines/${{ matrix.module }}
120+
fi
112121
113122
- name: Failure short reports
114123
if: ${{ failure() }}

docs/source/en/_toctree.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@
7676
- local: advanced_inference/outpaint
7777
title: Outpainting
7878
title: Advanced inference
79+
- sections:
80+
- local: hybrid_inference/overview
81+
title: Overview
82+
- local: hybrid_inference/vae_decode
83+
title: VAE Decode
84+
- local: hybrid_inference/vae_encode
85+
title: VAE Encode
86+
- local: hybrid_inference/api_reference
87+
title: API Reference
88+
title: Hybrid Inference
7989
- sections:
8090
- local: using-diffusers/cogvideox
8191
title: CogVideoX
@@ -165,6 +175,8 @@
165175
title: gguf
166176
- local: quantization/torchao
167177
title: torchao
178+
- local: quantization/quanto
179+
title: quanto
168180
title: Quantization Methods
169181
- sections:
170182
- local: optimization/fp16
@@ -282,6 +294,8 @@
282294
title: CogView4Transformer2DModel
283295
- local: api/models/dit_transformer2d
284296
title: DiTTransformer2DModel
297+
- local: api/models/easyanimate_transformer3d
298+
title: EasyAnimateTransformer3DModel
285299
- local: api/models/flux_transformer
286300
title: FluxTransformer2DModel
287301
- local: api/models/hunyuan_transformer2d
@@ -314,6 +328,8 @@
314328
title: Transformer2DModel
315329
- local: api/models/transformer_temporal
316330
title: TransformerTemporalModel
331+
- local: api/models/wan_transformer_3d
332+
title: WanTransformer3DModel
317333
title: Transformers
318334
- sections:
319335
- local: api/models/stable_cascade_unet
@@ -342,8 +358,12 @@
342358
title: AutoencoderKLHunyuanVideo
343359
- local: api/models/autoencoderkl_ltx_video
344360
title: AutoencoderKLLTXVideo
361+
- local: api/models/autoencoderkl_magvit
362+
title: AutoencoderKLMagvit
345363
- local: api/models/autoencoderkl_mochi
346364
title: AutoencoderKLMochi
365+
- local: api/models/autoencoder_kl_wan
366+
title: AutoencoderKLWan
347367
- local: api/models/asymmetricautoencoderkl
348368
title: AsymmetricAutoencoderKL
349369
- local: api/models/autoencoder_dc
@@ -418,6 +438,8 @@
418438
title: DiffEdit
419439
- local: api/pipelines/dit
420440
title: DiT
441+
- local: api/pipelines/easyanimate
442+
title: EasyAnimate
421443
- local: api/pipelines/flux
422444
title: Flux
423445
- local: api/pipelines/control_flux_inpaint
@@ -534,6 +556,8 @@
534556
title: UniDiffuser
535557
- local: api/pipelines/value_guided_sampling
536558
title: Value-guided sampling
559+
- local: api/pipelines/wan
560+
title: Wan
537561
- local: api/pipelines/wuerstchen
538562
title: Wuerstchen
539563
title: Pipelines
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!-- Copyright 2024 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+
# AutoencoderKLWan
13+
14+
The 3D variational autoencoder (VAE) model with KL loss used in [Wan 2.1](https://github.com/Wan-Video/Wan2.1) by the Alibaba Wan Team.
15+
16+
The model can be loaded with the following code snippet.
17+
18+
```python
19+
from diffusers import AutoencoderKLWan
20+
21+
vae = AutoencoderKLWan.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B-Diffusers", subfolder="vae", torch_dtype=torch.float32)
22+
```
23+
24+
## AutoencoderKLWan
25+
26+
[[autodoc]] AutoencoderKLWan
27+
- decode
28+
- all
29+
30+
## DecoderOutput
31+
32+
[[autodoc]] models.autoencoders.vae.DecoderOutput
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
# AutoencoderKLMagvit
13+
14+
The 3D variational autoencoder (VAE) model with KL loss used in [EasyAnimate](https://github.com/aigc-apps/EasyAnimate) was introduced by Alibaba PAI.
15+
16+
The model can be loaded with the following code snippet.
17+
18+
```python
19+
from diffusers import AutoencoderKLMagvit
20+
21+
vae = AutoencoderKLMagvit.from_pretrained("alibaba-pai/EasyAnimateV5.1-12b-zh", subfolder="vae", torch_dtype=torch.float16).to("cuda")
22+
```
23+
24+
## AutoencoderKLMagvit
25+
26+
[[autodoc]] AutoencoderKLMagvit
27+
- decode
28+
- encode
29+
- all
30+
31+
## AutoencoderKLOutput
32+
33+
[[autodoc]] models.autoencoders.autoencoder_kl.AutoencoderKLOutput
34+
35+
## DecoderOutput
36+
37+
[[autodoc]] models.autoencoders.vae.DecoderOutput
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# EasyAnimateTransformer3DModel
13+
14+
A Diffusion Transformer model for 3D data from [EasyAnimate](https://github.com/aigc-apps/EasyAnimate) was introduced by Alibaba PAI.
15+
16+
The model can be loaded with the following code snippet.
17+
18+
```python
19+
from diffusers import EasyAnimateTransformer3DModel
20+
21+
transformer = EasyAnimateTransformer3DModel.from_pretrained("alibaba-pai/EasyAnimateV5.1-12b-zh", subfolder="transformer", torch_dtype=torch.float16).to("cuda")
22+
```
23+
24+
## EasyAnimateTransformer3DModel
25+
26+
[[autodoc]] EasyAnimateTransformer3DModel
27+
28+
## Transformer2DModelOutput
29+
30+
[[autodoc]] models.modeling_outputs.Transformer2DModelOutput

0 commit comments

Comments
 (0)