Skip to content

Commit 828fe84

Browse files
authored
Merge branch 'main' into add-ip-adapterr
2 parents d0f1073 + 6bf1ca2 commit 828fe84

File tree

250 files changed

+26424
-3987
lines changed

Some content is hidden

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

250 files changed

+26424
-3987
lines changed

.github/workflows/pr_test_fetcher.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
name: Fast tests for PRs
1+
name: Fast tests for PRs - Test Fetcher
22

3-
on:
4-
pull_request:
5-
branches:
6-
- main
7-
push:
8-
branches:
9-
- ci-*
3+
on: workflow_dispatch
104

115
env:
126
DIFFUSERS_IS_CI: yes
137
OMP_NUM_THREADS: 4
148
MKL_NUM_THREADS: 4
159
PYTEST_TIMEOUT: 60
1610

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
1715
jobs:
1816
setup_pr_tests:
1917
name: Setup PR Tests
@@ -31,14 +29,15 @@ jobs:
3129
- name: Checkout diffusers
3230
uses: actions/checkout@v3
3331
with:
34-
fetch-depth: 2
32+
fetch-depth: 0
3533
- name: Install dependencies
3634
run: |
3735
apt-get update && apt-get install libsndfile1-dev libgl1 -y
38-
python -m pip install -e .
36+
python -m pip install -e .[quality,test]
3937
- name: Environment
4038
run: |
4139
python utils/print_env.py
40+
echo $(git --version)
4241
- name: Fetch Tests
4342
run: |
4443
python utils/tests_fetcher.py | tee test_preparation.txt
@@ -106,7 +105,7 @@ jobs:
106105
continue-on-error: true
107106
run: |
108107
cat reports/${{ matrix.modules }}_tests_cpu_stats.txt
109-
cat reports/${{ matrix.modules }}_tests_cpu/failures_short.txt
108+
cat reports/${{ matrix.modules }}_tests_cpu_failures_short.txt
110109
111110
- name: Test suite reports artifacts
112111
if: ${{ always() }}

.github/workflows/pr_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ jobs:
113113
- name: Run example PyTorch CPU tests
114114
if: ${{ matrix.config.framework == 'pytorch_examples' }}
115115
run: |
116+
python -m pip install peft
116117
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
117118
--make-reports=tests_${{ matrix.config.report }} \
118-
examples/test_examples.py
119+
examples
119120
120121
- name: Failure short reports
121122
if: ${{ failure() }}

.github/workflows/push_tests_fast.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
812
env:
913
DIFFUSERS_IS_CI: yes
1014
HF_HOME: /mnt/cache
@@ -96,7 +100,7 @@ jobs:
96100
run: |
97101
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
98102
--make-reports=tests_${{ matrix.config.report }} \
99-
examples/test_examples.py
103+
examples
100104
101105
- name: Failure short reports
102106
if: ${{ failure() }}

.github/workflows/push_tests_mps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ env:
1313
PYTEST_TIMEOUT: 600
1414
RUN_SLOW: no
1515

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
1620
jobs:
1721
run_fast_tests_apple_m1:
1822
name: Fast PyTorch MPS tests on MacOS

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ You will need basic `git` proficiency to be able to contribute to
355355
manual. Type `git --help` in a shell and enjoy. If you prefer books, [Pro
356356
Git](https://git-scm.com/book/en/v2) is a very good reference.
357357

358-
Follow these steps to start contributing ([supported Python versions](https://github.com/huggingface/diffusers/blob/main/setup.py#L244)):
358+
Follow these steps to start contributing ([supported Python versions](https://github.com/huggingface/diffusers/blob/main/setup.py#L265)):
359359

360360
1. Fork the [repository](https://github.com/huggingface/diffusers) by
361361
clicking on the 'Fork' button on the repository's page. This creates a copy of the code

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repo-consistency:
4141

4242
quality:
4343
ruff check $(check_dirs) setup.py
44-
ruff format --check $(check_dirs) setup.py
44+
ruff format --check $(check_dirs) setup.py
4545
python utils/check_doc_toc.py
4646

4747
# Format source code automatically and check is there are any problems left that need manual fixing

PHILOSOPHY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Models are designed as configurable toolboxes that are natural extensions of [Py
8282
The following design principles are followed:
8383
- Models correspond to **a type of model architecture**. *E.g.* the [`UNet2DConditionModel`] class is used for all UNet variations that expect 2D image inputs and are conditioned on some context.
8484
- All models can be found in [`src/diffusers/models`](https://github.com/huggingface/diffusers/tree/main/src/diffusers/models) and every model architecture shall be defined in its file, e.g. [`unet_2d_condition.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_condition.py), [`transformer_2d.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformer_2d.py), etc...
85-
- Models **do not** follow the single-file policy and should make use of smaller model building blocks, such as [`attention.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py), [`resnet.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py), [`embeddings.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/embeddings.py), etc... **Note**: This is in stark contrast to Transformers' modelling files and shows that models do not really follow the single-file policy.
85+
- Models **do not** follow the single-file policy and should make use of smaller model building blocks, such as [`attention.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py), [`resnet.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py), [`embeddings.py`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/embeddings.py), etc... **Note**: This is in stark contrast to Transformers' modeling files and shows that models do not really follow the single-file policy.
8686
- Models intend to expose complexity, just like PyTorch's `Module` class, and give clear error messages.
8787
- Models all inherit from `ModelMixin` and `ConfigMixin`.
8888
- Models can be optimized for performance when it doesn’t demand major code changes, keep backward compatibility, and give significant memory or compute gain.

docs/source/en/_toctree.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
title: Overview
7373
- local: using-diffusers/sdxl
7474
title: Stable Diffusion XL
75+
- local: using-diffusers/sdxl_turbo
76+
title: SDXL Turbo
7577
- local: using-diffusers/kandinsky
7678
title: Kandinsky
7779
- local: using-diffusers/controlnet
@@ -94,6 +96,8 @@
9496
title: Latent Consistency Model-LoRA
9597
- local: using-diffusers/inference_with_lcm
9698
title: Latent Consistency Model
99+
- local: using-diffusers/svd
100+
title: Stable Video Diffusion
97101
title: Specific pipeline examples
98102
- sections:
99103
- local: training/overview
@@ -129,6 +133,8 @@
129133
title: LoRA
130134
- local: training/custom_diffusion
131135
title: Custom Diffusion
136+
- local: training/lcm_distill
137+
title: Latent Consistency Distillation
132138
- local: training/ddpo
133139
title: Reinforcement learning training with DDPO
134140
title: Methods
@@ -258,6 +264,10 @@
258264
title: ControlNet
259265
- local: api/pipelines/controlnet_sdxl
260266
title: ControlNet with Stable Diffusion XL
267+
- local: api/pipelines/controlnetxs
268+
title: ControlNet-XS
269+
- local: api/pipelines/controlnetxs_sdxl
270+
title: ControlNet-XS with Stable Diffusion XL
261271
- local: api/pipelines/cycle_diffusion
262272
title: Cycle Diffusion
263273
- local: api/pipelines/dance_diffusion
@@ -278,6 +288,8 @@
278288
title: Kandinsky 2.1
279289
- local: api/pipelines/kandinsky_v22
280290
title: Kandinsky 2.2
291+
- local: api/pipelines/kandinsky3
292+
title: Kandinsky 3
281293
- local: api/pipelines/latent_consistency_models
282294
title: Latent Consistency Models
283295
- local: api/pipelines/latent_diffusion
@@ -327,12 +339,14 @@
327339
title: Stable Diffusion 2
328340
- local: api/pipelines/stable_diffusion/stable_diffusion_xl
329341
title: Stable Diffusion XL
342+
- local: api/pipelines/stable_diffusion/sdxl_turbo
343+
title: SDXL Turbo
330344
- local: api/pipelines/stable_diffusion/latent_upscale
331345
title: Latent upscaler
332346
- local: api/pipelines/stable_diffusion/upscale
333347
title: Super-resolution
334348
- local: api/pipelines/stable_diffusion/ldm3d_diffusion
335-
title: LDM3D Text-to-(RGB, Depth)
349+
title: LDM3D Text-to-(RGB, Depth), Text-to-(RGB-pano, Depth-pano), LDM3D Upscaler
336350
- local: api/pipelines/stable_diffusion/adapter
337351
title: Stable Diffusion T2I-Adapter
338352
- local: api/pipelines/stable_diffusion/gligen

docs/source/en/api/attnprocessor.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ An attention processor is a class for applying different types of attention mech
2020
## AttnProcessor2_0
2121
[[autodoc]] models.attention_processor.AttnProcessor2_0
2222

23+
## FusedAttnProcessor2_0
24+
[[autodoc]] models.attention_processor.FusedAttnProcessor2_0
25+
2326
## LoRAAttnProcessor
2427
[[autodoc]] models.attention_processor.LoRAAttnProcessor
2528

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--Copyright 2023 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+
# ControlNet-XS
14+
15+
ControlNet-XS was introduced in [ControlNet-XS](https://vislearn.github.io/ControlNet-XS/) by Denis Zavadski and Carsten Rother. It is based on the observation that the control model in the [original ControlNet](https://huggingface.co/papers/2302.05543) can be made much smaller and still produce good results.
16+
17+
Like the original ControlNet model, you can provide an additional control image to condition and control Stable Diffusion generation. For example, if you provide a depth map, the ControlNet model generates an image that'll preserve the spatial information from the depth map. It is a more flexible and accurate way to control the image generation process.
18+
19+
ControlNet-XS generates images with comparable quality to a regular ControlNet, but it is 20-25% faster ([see benchmark](https://github.com/UmerHA/controlnet-xs-benchmark/blob/main/Speed%20Benchmark.ipynb) with StableDiffusion-XL) and uses ~45% less memory.
20+
21+
Here's the overview from the [project page](https://vislearn.github.io/ControlNet-XS/):
22+
23+
*With increasing computing capabilities, current model architectures appear to follow the trend of simply upscaling all components without validating the necessity for doing so. In this project we investigate the size and architectural design of ControlNet [Zhang et al., 2023] for controlling the image generation process with stable diffusion-based models. We show that a new architecture with as little as 1% of the parameters of the base model achieves state-of-the art results, considerably better than ControlNet in terms of FID score. Hence we call it ControlNet-XS. We provide the code for controlling StableDiffusion-XL [Podell et al., 2023] (Model B, 48M Parameters) and StableDiffusion 2.1 [Rombach et al. 2022] (Model B, 14M Parameters), all under openrail license.*
24+
25+
This model was contributed by [UmerHA](https://twitter.com/UmerHAdil). ❤️
26+
27+
<Tip>
28+
29+
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading#reuse-components-across-pipelines) section to learn how to efficiently load the same components into multiple pipelines.
30+
31+
</Tip>
32+
33+
## StableDiffusionControlNetXSPipeline
34+
[[autodoc]] StableDiffusionControlNetXSPipeline
35+
- all
36+
- __call__
37+
38+
## StableDiffusionPipelineOutput
39+
[[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput

0 commit comments

Comments
 (0)