Merge branch 'main' of https://github.com/zaiisao/diffusers into main · huggingface/diffusers@ab159d6 · GitHub
Skip to content

Commit ab159d6

Browse files
committed
Merge branch 'main' of https://github.com/zaiisao/diffusers into main
2 parents ac1d5b7 + 9135e54 commit ab159d6

251 files changed

Lines changed: 15419 additions & 2572 deletions

File tree

Some content is hidden

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

‎.github/workflows/build_docker_images.yml‎

Lines changed: 1 addition & 0 deletions

‎.github/workflows/build_documentation.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
install_libgl1: true
1717
package: diffusers
1818
notebook_folder: diffusers_doc
19-
languages: en ko zh
19+
languages: en ko zh ja pt
2020

2121
secrets:
2222
token: ${{ secrets.HUGGINGFACE_PUSH }}

‎.github/workflows/build_pr_documentation.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
pr_number: ${{ github.event.number }}
1616
install_libgl1: true
1717
package: diffusers
18-
languages: en ko zh
18+
languages: en ko zh ja pt

‎.github/workflows/push_tests.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,46 @@ jobs:
290290
name: torch_compile_test_reports
291291
path: reports
292292

293+
run_xformers_tests:
294+
name: PyTorch xformers CUDA tests
295+
296+
runs-on: docker-gpu
297+
298+
container:
299+
image: diffusers/diffusers-pytorch-xformers-cuda
300+
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
301+
302+
steps:
303+
- name: Checkout diffusers
304+
uses: actions/checkout@v3
305+
with:
306+
fetch-depth: 2
307+
308+
- name: NVIDIA-SMI
309+
run: |
310+
nvidia-smi
311+
- name: Install dependencies
312+
run: |
313+
python -m pip install -e .[quality,test,training]
314+
- name: Environment
315+
run: |
316+
python utils/print_env.py
317+
- name: Run example tests on GPU
318+
env:
319+
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
320+
run: |
321+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v -k "xformers" --make-reports=tests_torch_xformers_cuda tests/
322+
- name: Failure short reports
323+
if: ${{ failure() }}
324+
run: cat reports/tests_torch_xformers_cuda_failures_short.txt
325+
326+
- name: Test suite reports artifacts
327+
if: ${{ always() }}
328+
uses: actions/upload-artifact@v2
329+
with:
330+
name: torch_xformers_test_reports
331+
path: reports
332+
293333
run_examples_tests:
294334
name: Examples PyTorch CUDA tests on Ubuntu
295335

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In the following, we give an overview of different ways to contribute, ranked by
4040
As said before, **all contributions are valuable to the community**.
4141
In the following, we will explain each contribution a bit more in detail.
4242

43-
For all contributions 4.-9. you will need to open a PR. It is explained in detail how to do so in [Opening a pull requst](#how-to-open-a-pr)
43+
For all contributions 4.-9. you will need to open a PR. It is explained in detail how to do so in [Opening a pull request](#how-to-open-a-pr)
4444

4545
### 1. Asking and answering questions on the Diffusers discussion forum or on the Diffusers Discord
4646

@@ -63,7 +63,7 @@ In the same spirit, you are of immense help to the community by answering such q
6363

6464
**Please** keep in mind that the more effort you put into asking or answering a question, the higher
6565
the quality of the publicly documented knowledge. In the same way, well-posed and well-answered questions create a high-quality knowledge database accessible to everybody, while badly posed questions or answers reduce the overall quality of the public knowledge database.
66-
In short, a high quality question or answer is *precise*, *concise*, *relevant*, *easy-to-understand*, *accesible*, and *well-formated/well-posed*. For more information, please have a look through the [How to write a good issue](#how-to-write-a-good-issue) section.
66+
In short, a high quality question or answer is *precise*, *concise*, *relevant*, *easy-to-understand*, *accessible*, and *well-formated/well-posed*. For more information, please have a look through the [How to write a good issue](#how-to-write-a-good-issue) section.
6767

6868
**NOTE about channels**:
6969
[*The forum*](https://discuss.huggingface.co/c/discussion-related-to-httpsgithubcomhuggingfacediffusers/63) is much better indexed by search engines, such as Google. Posts are ranked by popularity rather than chronologically. Hence, it's easier to look up questions and answers that we posted some time ago.
@@ -168,7 +168,7 @@ more precise, provide the link to a duplicated issue or redirect them to [the fo
168168
If you have verified that the issued bug report is correct and requires a correction in the source code,
169169
please have a look at the next sections.
170170

171-
For all of the following contributions, you will need to open a PR. It is explained in detail how to do so in the [Opening a pull requst](#how-to-open-a-pr) section.
171+
For all of the following contributions, you will need to open a PR. It is explained in detail how to do so in the [Opening a pull request](#how-to-open-a-pr) section.
172172

173173
### 4. Fixing a "Good first issue"
174174

‎PHILOSOPHY.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The following design principles are followed:
7070
- Pipelines should be used **only** for inference.
7171
- Pipelines should be very readable, self-explanatory, and easy to tweak.
7272
- Pipelines should be designed to build on top of each other and be easy to integrate into higher-level APIs.
73-
- Pipelines are **not** intended to be feature-complete user interfaces. For future complete user interfaces one should rather have a look at [InvokeAI](https://github.com/invoke-ai/InvokeAI), [Diffuzers](https://github.com/abhishekkrthakur/diffuzers), and [lama-cleaner](https://github.com/Sanster/lama-cleaner)
73+
- Pipelines are **not** intended to be feature-complete user interfaces. For future complete user interfaces one should rather have a look at [InvokeAI](https://github.com/invoke-ai/InvokeAI), [Diffuzers](https://github.com/abhishekkrthakur/diffuzers), and [lama-cleaner](https://github.com/Sanster/lama-cleaner).
7474
- Every pipeline should have one and only one way to run it via a `__call__` method. The naming of the `__call__` arguments should be shared across all pipelines.
7575
- Pipelines should be named after the task they are intended to solve.
7676
- In almost all cases, novel diffusion pipelines shall be implemented in a new pipeline folder/file.
@@ -104,7 +104,7 @@ The following design principles are followed:
104104
- Schedulers all inherit from `SchedulerMixin` and `ConfigMixin`.
105105
- Schedulers can be easily swapped out with the [`ConfigMixin.from_config`](https://huggingface.co/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config) method as explained in detail [here](./using-diffusers/schedulers.md).
106106
- Every scheduler has to have a `set_num_inference_steps`, and a `step` function. `set_num_inference_steps(...)` has to be called before every denoising process, *i.e.* before `step(...)` is called.
107-
- Every scheduler exposes the timesteps to be "looped over" via a `timesteps` attribute, which is an array of timesteps the model will be called upon
107+
- Every scheduler exposes the timesteps to be "looped over" via a `timesteps` attribute, which is an array of timesteps the model will be called upon.
108108
- The `step(...)` function takes a predicted model output and the "current" sample (x_t) and returns the "previous", slightly more denoised sample (x_t-1).
109109
- Given the complexity of diffusion schedulers, the `step` function does not expose all the complexity and can be a bit of a "black box".
110110
- In almost all cases, novel schedulers shall be implemented in a new scheduling file.
Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04
1+
FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
22
LABEL maintainer="Hugging Face"
33
LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt update && \
88
apt install -y bash \
9-
build-essential \
10-
git \
11-
git-lfs \
12-
curl \
13-
ca-certificates \
14-
libsndfile1-dev \
15-
libgl1 \
16-
python3.9 \
17-
python3.9-dev \
18-
python3-pip \
19-
python3.9-venv && \
9+
build-essential \
10+
git \
11+
git-lfs \
12+
curl \
13+
ca-certificates \
14+
libsndfile1-dev \
15+
libgl1 \
16+
python3.9 \
17+
python3.9-dev \
18+
python3-pip \
19+
python3.9-venv && \
2020
rm -rf /var/lib/apt/lists
2121

2222
# make sure to use venv
@@ -26,23 +26,21 @@ ENV PATH="/opt/venv/bin:$PATH"
2626
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2727
RUN python3.9 -m pip install --no-cache-dir --upgrade pip && \
2828
python3.9 -m pip install --no-cache-dir \
29-
torch \
30-
torchvision \
31-
torchaudio \
32-
invisible_watermark && \
29+
torch \
30+
torchvision \
31+
torchaudio \
32+
invisible_watermark && \
3333
python3.9 -m pip install --no-cache-dir \
34-
accelerate \
35-
datasets \
36-
hf-doc-builder \
37-
huggingface-hub \
38-
Jinja2 \
39-
librosa \
40-
numpy \
41-
scipy \
42-
tensorboard \
43-
transformers \
44-
omegaconf \
45-
pytorch-lightning \
46-
xformers
34+
accelerate \
35+
datasets \
36+
hf-doc-builder \
37+
huggingface-hub \
38+
Jinja2 \
39+
librosa \
40+
numpy \
41+
scipy \
42+
tensorboard \
43+
transformers \
44+
omegaconf
4745

4846
CMD ["/bin/bash"]
Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04
1+
FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
22
LABEL maintainer="Hugging Face"
33
LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt update && \
88
apt install -y bash \
9-
build-essential \
10-
git \
11-
git-lfs \
12-
curl \
13-
ca-certificates \
14-
libsndfile1-dev \
15-
libgl1 \
16-
python3.8 \
17-
python3-pip \
18-
python3.8-venv && \
9+
build-essential \
10+
git \
11+
git-lfs \
12+
curl \
13+
ca-certificates \
14+
libsndfile1-dev \
15+
libgl1 \
16+
python3.8 \
17+
python3-pip \
18+
python3.8-venv && \
1919
rm -rf /var/lib/apt/lists
2020

2121
# make sure to use venv
@@ -25,23 +25,22 @@ ENV PATH="/opt/venv/bin:$PATH"
2525
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
2626
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
2727
python3 -m pip install --no-cache-dir \
28-
torch==2.0.1 \
29-
torchvision==0.15.2 \
30-
torchaudio \
31-
invisible_watermark && \
28+
torch \
29+
torchvision \
30+
torchaudio \
31+
invisible_watermark && \
3232
python3 -m pip install --no-cache-dir \
33-
accelerate \
34-
datasets \
35-
hf-doc-builder \
36-
huggingface-hub \
37-
Jinja2 \
38-
librosa \
39-
numpy \
40-
scipy \
41-
tensorboard \
42-
transformers \
43-
omegaconf \
44-
pytorch-lightning \
45-
xformers
33+
accelerate \
34+
datasets \
35+
hf-doc-builder \
36+
huggingface-hub \
37+
Jinja2 \
38+
librosa \
39+
numpy \
40+
scipy \
41+
tensorboard \
42+
transformers \
43+
omegaconf \
44+
pytorch-lightning
4645

4746
CMD ["/bin/bash"]
Lines changed: 46 additions & 0 deletions

0 commit comments

Comments
 (0)