Skip to content

Commit d137d11

Browse files
authored
Merge pull request huggingface#1 from ayushtues/consistency_unet
[WIP] Add Unet for consistency models
2 parents f2e53da + 4e93f09 commit d137d11

File tree

63 files changed

+8596
-2000
lines changed

Some content is hidden

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

63 files changed

+8596
-2000
lines changed

.github/actions/setup-miniconda/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ runs:
2727
- name: Get date
2828
id: get-date
2929
shell: bash
30-
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')d"
30+
run: echo "today=$(/bin/date -u '+%Y%m%d')d" >> $GITHUB_OUTPUT
3131
- name: Setup miniconda cache
3232
id: miniconda-cache
3333
uses: actions/cache@v2
@@ -143,4 +143,4 @@ runs:
143143
echo "There is ${AVAIL}KB free space left in $MOUNT, continue"
144144
fi
145145
fi
146-
done
146+
done

.github/workflows/pr_tests.yml

-66
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ jobs:
3636
runner: docker-cpu
3737
image: diffusers/diffusers-flax-cpu
3838
report: flax_cpu
39-
- name: Fast ONNXRuntime CPU tests
40-
framework: onnxruntime
41-
runner: docker-cpu
42-
image: diffusers/diffusers-onnxruntime-cpu
43-
report: onnx_cpu
4439
- name: PyTorch Example CPU tests
4540
framework: pytorch_examples
4641
runner: docker-cpu
@@ -98,14 +93,6 @@ jobs:
9893
--make-reports=tests_${{ matrix.config.report }} \
9994
tests
10095
101-
- name: Run fast ONNXRuntime CPU tests
102-
if: ${{ matrix.config.framework == 'onnxruntime' }}
103-
run: |
104-
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
105-
-s -v -k "Onnx" \
106-
--make-reports=tests_${{ matrix.config.report }} \
107-
tests/
108-
10996
- name: Run example PyTorch CPU tests
11097
if: ${{ matrix.config.framework == 'pytorch_examples' }}
11198
run: |
@@ -123,56 +110,3 @@ jobs:
123110
with:
124111
name: pr_${{ matrix.config.report }}_test_reports
125112
path: reports
126-
127-
run_fast_tests_apple_m1:
128-
name: Fast PyTorch MPS tests on MacOS
129-
runs-on: [ self-hosted, apple-m1 ]
130-
131-
steps:
132-
- name: Checkout diffusers
133-
uses: actions/checkout@v3
134-
with:
135-
fetch-depth: 2
136-
137-
- name: Clean checkout
138-
shell: arch -arch arm64 bash {0}
139-
run: |
140-
git clean -fxd
141-
142-
- name: Setup miniconda
143-
uses: ./.github/actions/setup-miniconda
144-
with:
145-
python-version: 3.9
146-
147-
- name: Install dependencies
148-
shell: arch -arch arm64 bash {0}
149-
run: |
150-
${CONDA_RUN} python -m pip install --upgrade pip
151-
${CONDA_RUN} python -m pip install -e .[quality,test]
152-
${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
153-
${CONDA_RUN} python -m pip install accelerate --upgrade
154-
${CONDA_RUN} python -m pip install transformers --upgrade
155-
156-
- name: Environment
157-
shell: arch -arch arm64 bash {0}
158-
run: |
159-
${CONDA_RUN} python utils/print_env.py
160-
161-
- name: Run fast PyTorch tests on M1 (MPS)
162-
shell: arch -arch arm64 bash {0}
163-
env:
164-
HF_HOME: /System/Volumes/Data/mnt/cache
165-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
166-
run: |
167-
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
168-
169-
- name: Failure short reports
170-
if: ${{ failure() }}
171-
run: cat reports/tests_torch_mps_failures_short.txt
172-
173-
- name: Test suite reports artifacts
174-
if: ${{ always() }}
175-
uses: actions/upload-artifact@v2
176-
with:
177-
name: pr_torch_mps_test_reports
178-
path: reports

.github/workflows/push_tests_fast.yml

+1-54
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Slow tests on main
1+
name: Fast tests on main
22

33
on:
44
push:
@@ -108,56 +108,3 @@ jobs:
108108
with:
109109
name: pr_${{ matrix.config.report }}_test_reports
110110
path: reports
111-
112-
run_fast_tests_apple_m1:
113-
name: Fast PyTorch MPS tests on MacOS
114-
runs-on: [ self-hosted, apple-m1 ]
115-
116-
steps:
117-
- name: Checkout diffusers
118-
uses: actions/checkout@v3
119-
with:
120-
fetch-depth: 2
121-
122-
- name: Clean checkout
123-
shell: arch -arch arm64 bash {0}
124-
run: |
125-
git clean -fxd
126-
127-
- name: Setup miniconda
128-
uses: ./.github/actions/setup-miniconda
129-
with:
130-
python-version: 3.9
131-
132-
- name: Install dependencies
133-
shell: arch -arch arm64 bash {0}
134-
run: |
135-
${CONDA_RUN} python -m pip install --upgrade pip
136-
${CONDA_RUN} python -m pip install -e .[quality,test]
137-
${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
138-
${CONDA_RUN} python -m pip install accelerate --upgrade
139-
${CONDA_RUN} python -m pip install transformers --upgrade
140-
141-
- name: Environment
142-
shell: arch -arch arm64 bash {0}
143-
run: |
144-
${CONDA_RUN} python utils/print_env.py
145-
146-
- name: Run fast PyTorch tests on M1 (MPS)
147-
shell: arch -arch arm64 bash {0}
148-
env:
149-
HF_HOME: /System/Volumes/Data/mnt/cache
150-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
151-
run: |
152-
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
153-
154-
- name: Failure short reports
155-
if: ${{ failure() }}
156-
run: cat reports/tests_torch_mps_failures_short.txt
157-
158-
- name: Test suite reports artifacts
159-
if: ${{ always() }}
160-
uses: actions/upload-artifact@v2
161-
with:
162-
name: pr_torch_mps_test_reports
163-
path: reports

.github/workflows/push_tests_mps.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Fast mps tests on main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
DIFFUSERS_IS_CI: yes
10+
HF_HOME: /mnt/cache
11+
OMP_NUM_THREADS: 8
12+
MKL_NUM_THREADS: 8
13+
PYTEST_TIMEOUT: 600
14+
RUN_SLOW: no
15+
16+
jobs:
17+
run_fast_tests_apple_m1:
18+
name: Fast PyTorch MPS tests on MacOS
19+
runs-on: [ self-hosted, apple-m1 ]
20+
21+
steps:
22+
- name: Checkout diffusers
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 2
26+
27+
- name: Clean checkout
28+
shell: arch -arch arm64 bash {0}
29+
run: |
30+
git clean -fxd
31+
32+
- name: Setup miniconda
33+
uses: ./.github/actions/setup-miniconda
34+
with:
35+
python-version: 3.9
36+
37+
- name: Install dependencies
38+
shell: arch -arch arm64 bash {0}
39+
run: |
40+
${CONDA_RUN} python -m pip install --upgrade pip
41+
${CONDA_RUN} python -m pip install -e .[quality,test]
42+
${CONDA_RUN} python -m pip install torch torchvision torchaudio
43+
${CONDA_RUN} python -m pip install accelerate --upgrade
44+
${CONDA_RUN} python -m pip install transformers --upgrade
45+
46+
- name: Environment
47+
shell: arch -arch arm64 bash {0}
48+
run: |
49+
${CONDA_RUN} python utils/print_env.py
50+
51+
- name: Run fast PyTorch tests on M1 (MPS)
52+
shell: arch -arch arm64 bash {0}
53+
env:
54+
HF_HOME: /System/Volumes/Data/mnt/cache
55+
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
56+
run: |
57+
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
58+
59+
- name: Failure short reports
60+
if: ${{ failure() }}
61+
run: cat reports/tests_torch_mps_failures_short.txt
62+
63+
- name: Test suite reports artifacts
64+
if: ${{ always() }}
65+
uses: actions/upload-artifact@v2
66+
with:
67+
name: pr_torch_mps_test_reports
68+
path: reports

docs/source/en/_toctree.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
title: Text-guided image-inpainting
4545
- local: using-diffusers/depth2img
4646
title: Text-guided depth-to-image
47+
- local: using-diffusers/textual_inversion_inference
48+
title: Textual inversion
49+
- local: training/distributed_inference
50+
title: Distributed inference with multiple GPUs
4751
- local: using-diffusers/reusing_seeds
4852
title: Improve image quality with deterministic generation
4953
- local: using-diffusers/reproducibility
@@ -148,6 +152,8 @@
148152
title: Audio Diffusion
149153
- local: api/pipelines/audioldm
150154
title: AudioLDM
155+
- local: api/pipelines/controlnet
156+
title: ControlNet
151157
- local: api/pipelines/cycle_diffusion
152158
title: Cycle Diffusion
153159
- local: api/pipelines/dance_diffusion
@@ -203,8 +209,6 @@
203209
title: Self-Attention Guidance
204210
- local: api/pipelines/stable_diffusion/panorama
205211
title: MultiDiffusion Panorama
206-
- local: api/pipelines/stable_diffusion/controlnet
207-
title: Text-to-Image Generation with ControlNet Conditioning
208212
- local: api/pipelines/stable_diffusion/model_editing
209213
title: Text-to-Image Model Editing
210214
- local: api/pipelines/stable_diffusion/diffedit
@@ -252,6 +256,8 @@
252256
title: Euler scheduler
253257
- local: api/schedulers/heun
254258
title: Heun Scheduler
259+
- local: api/schedulers/multistep_dpm_solver_inverse
260+
title: Inverse Multistep DPM-Solver
255261
- local: api/schedulers/ipndm
256262
title: IPNDM
257263
- local: api/schedulers/lms_discrete

0 commit comments

Comments
 (0)