Skip to content

Commit 2894a92

Browse files
committed
Merge branch 'main' of https://github.com/huggingface/diffusers into dreambooth-example
2 parents c66cf4d + 57b70c5 commit 2894a92

File tree

67 files changed

+3680
-392
lines changed

Some content is hidden

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

67 files changed

+3680
-392
lines changed

.github/workflows/pr_tests.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,15 @@ jobs:
4141
4242
- name: Run all non-slow selected tests on CPU
4343
run: |
44-
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile -s tests/
44+
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=tests_torch_cpu tests/
45+
46+
- name: Failure short reports
47+
if: ${{ failure() }}
48+
run: cat reports/tests_torch_cpu_failures_short.txt
49+
50+
- name: Test suite reports artifacts
51+
if: ${{ always() }}
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: pr_torch_test_reports
55+
path: reports

.github/workflows/push_tests.yml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,66 @@ jobs:
4949
env:
5050
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
5151
run: |
52-
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s tests/
52+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=tests_torch_gpu tests/
53+
54+
- name: Failure short reports
55+
if: ${{ failure() }}
56+
run: cat reports/tests_torch_gpu_failures_short.txt
57+
58+
- name: Test suite reports artifacts
59+
if: ${{ always() }}
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: torch_test_reports
63+
path: reports
64+
65+
66+
67+
run_examples_single_gpu:
68+
name: Examples tests
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
machine_type: [ single-gpu ]
73+
runs-on: [ self-hosted, docker-gpu, '${{ matrix.machine_type }}' ]
74+
container:
75+
image: nvcr.io/nvidia/pytorch:22.07-py3
76+
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
77+
78+
steps:
79+
- name: Checkout diffusers
80+
uses: actions/checkout@v3
81+
with:
82+
fetch-depth: 2
83+
84+
- name: NVIDIA-SMI
85+
run: |
86+
nvidia-smi
87+
88+
- name: Install dependencies
89+
run: |
90+
python -m pip install --upgrade pip
91+
python -m pip uninstall -y torch torchvision torchtext
92+
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
93+
python -m pip install -e .[quality,test,training]
94+
95+
- name: Environment
96+
run: |
97+
python utils/print_env.py
98+
99+
- name: Run example tests on GPU
100+
env:
101+
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
102+
run: |
103+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=examples_torch_gpu examples/
104+
105+
- name: Failure short reports
106+
if: ${{ failure() }}
107+
run: cat reports/examples_torch_gpu_failures_short.txt
108+
109+
- name: Test suite reports artifacts
110+
if: ${{ always() }}
111+
uses: actions/upload-artifact@v2
112+
with:
113+
name: examples_test_reports
114+
path: reports

_typos.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
[default.extend-identifiers]
55

66
[default.extend-words]
7-
NIN_="NIN" # NIN is used in scripts/convert_ncsnpp_original_checkpoint_to_diffusers.py
7+
NIN="NIN" # NIN is used in scripts/convert_ncsnpp_original_checkpoint_to_diffusers.py
88
nd="np" # nd may be np (numpy)
9+
parms="parms" # parms is used in scripts/convert_original_stable_diffusion_to_diffusers.py
910

1011

1112
[files]

docs/source/api/models.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,21 @@ The models are built on the base class ['ModelMixin'] that is a `torch.nn.module
4545

4646
## AutoencoderKL
4747
[[autodoc]] AutoencoderKL
48+
49+
## FlaxModelMixin
50+
[[autodoc]] FlaxModelMixin
51+
52+
## FlaxUNet2DConditionOutput
53+
[[autodoc]] models.unet_2d_condition_flax.FlaxUNet2DConditionOutput
54+
55+
## FlaxUNet2DConditionModel
56+
[[autodoc]] FlaxUNet2DConditionModel
57+
58+
## FlaxDecoderOutput
59+
[[autodoc]] models.vae_flax.FlaxDecoderOutput
60+
61+
## FlaxAutoencoderKLOutput
62+
[[autodoc]] models.vae_flax.FlaxAutoencoderKLOutput
63+
64+
## FlaxAutoencoderKL
65+
[[autodoc]] FlaxAutoencoderKL

docs/source/api/pipelines/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ available a colab notebook to directly try them out.
5353
| [stable_diffusion](./stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Text-to-Image Generation | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb)
5454
| [stable_diffusion](./stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Image-to-Image Text-Guided Generation | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb)
5555
| [stable_diffusion](./stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Text-Guided Image Inpainting | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb)
56-
| [stochatic_karras_ve](./stochatic_karras_ve) | [**Elucidating the Design Space of Diffusion-Based Generative Models**](https://arxiv.org/abs/2206.00364) | Unconditional Image Generation |
56+
| [stochastic_karras_ve](./stochastic_karras_ve) | [**Elucidating the Design Space of Diffusion-Based Generative Models**](https://arxiv.org/abs/2206.00364) | Unconditional Image Generation |
5757

5858
**Note**: Pipelines are simple examples of how to play around with the diffusion systems as described in the corresponding papers.
5959

@@ -85,7 +85,7 @@ not be used for training. If you want to store the gradients during the forward
8585
We are more than happy about any contribution to the officially supported pipelines 🤗. We aspire
8686
all of our pipelines to be **self-contained**, **easy-to-tweak**, **beginner-friendly** and for **one-purpose-only**.
8787

88-
- **Self-contained**: A pipeline shall be as self-contained as possible. More specifically, this means that all functionality should be either directly defined in the pipeline file iteslf, should be inherited from (and only from) the [`DiffusionPipeline` class](.../diffusion_pipeline) or be directly attached to the model and scheduler components of the pipeline.
88+
- **Self-contained**: A pipeline shall be as self-contained as possible. More specifically, this means that all functionality should be either directly defined in the pipeline file itself, should be inherited from (and only from) the [`DiffusionPipeline` class](.../diffusion_pipeline) or be directly attached to the model and scheduler components of the pipeline.
8989
- **Easy-to-use**: Pipelines should be extremely easy to use - one should be able to load the pipeline and
9090
use it for its designated task, *e.g.* text-to-image generation, in just a couple of lines of code. Most
9191
logic including pre-processing, an unrolled diffusion loop, and post-processing should all happen inside the `__call__` method.

docs/source/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ available a colab notebook to directly try them out.
4444
| [stable_diffusion](./api/pipelines/stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Text-to-Image Generation | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb)
4545
| [stable_diffusion](./api/pipelines/stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Image-to-Image Text-Guided Generation | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb)
4646
| [stable_diffusion](./api/pipelines/stable_diffusion) | [**Stable Diffusion**](https://stability.ai/blog/stable-diffusion-public-release) | Text-Guided Image Inpainting | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb)
47-
| [stochatic_karras_ve](./api/pipelines/stochatic_karras_ve) | [**Elucidating the Design Space of Diffusion-Based Generative Models**](https://arxiv.org/abs/2206.00364) | Unconditional Image Generation |
47+
| [stochastic_karras_ve](./api/pipelines/stochastic_karras_ve) | [**Elucidating the Design Space of Diffusion-Based Generative Models**](https://arxiv.org/abs/2206.00364) | Unconditional Image Generation |
4848

4949
**Note**: Pipelines are simple examples of how to play around with the diffusion systems as described in the corresponding papers.

docs/source/using-diffusers/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ pip install diffusers
2727

2828
### Schedulers
2929

30-
### Pipeliens
30+
### Pipelines
3131

3232

docs/source/using-diffusers/unconditional_image_generation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License.
1212

1313

1414

15-
# Unonditional Image Generation
15+
# Unconditional Image Generation
1616

1717
The [`DiffusionPipeline`] is the easiest way to use a pre-trained diffusion system for inference
1818

examples/community/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
**Community** examples consist of both inference and training examples that have been added by the community.
44

5-
| Example | Description | Author | |
6-
|:----------|:-------------|:-------------|------:|
5+
| Example | Description | Author | Colab |
6+
|:----------|:----------------------|:-----------------|----------:|
7+
| CLIP Guided Stable Diffusion | Doing CLIP guidance for text to image generation with Stable Diffusion| [Suraj Patil](https://github.com/patil-suraj/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/CLIP_Guided_Stable_diffusion_with_diffusers.ipynb) |

0 commit comments

Comments
 (0)