Skip to content

Commit b075ece

Browse files
committed
first draft
refactor rotary embedding + move dit block to dit model file
1 parent 12565f3 commit b075ece

File tree

152 files changed

+8658
-2339
lines changed

Some content is hidden

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

152 files changed

+8658
-2339
lines changed

.github/workflows/build_docker_images.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
steps:
2626
- name: Set up Docker Buildx
2727
uses: docker/setup-buildx-action@v1
28-
28+
2929
- name: Check out code
3030
uses: actions/checkout@v3
31-
31+
3232
- name: Find Changed Dockerfiles
3333
id: file_changes
3434
uses: jitterbit/get-changed-files@v1
3535
with:
3636
format: 'space-delimited'
3737
token: ${{ secrets.GITHUB_TOKEN }}
38-
38+
3939
- name: Build Changed Docker Images
4040
run: |
4141
CHANGED_FILES="${{ steps.file_changes.outputs.all }}"
@@ -52,7 +52,7 @@ jobs:
5252
build-and-push-docker-images:
5353
runs-on: [ self-hosted, intel-cpu, 8-cpu, ci ]
5454
if: github.event_name != 'pull_request'
55-
55+
5656
permissions:
5757
contents: read
5858
packages: write
@@ -69,6 +69,7 @@ jobs:
6969
- diffusers-flax-tpu
7070
- diffusers-onnxruntime-cpu
7171
- diffusers-onnxruntime-cuda
72+
- diffusers-doc-builder
7273

7374
steps:
7475
- name: Checkout repository

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
package: diffusers
2222
notebook_folder: diffusers_doc
2323
languages: en ko zh ja pt
24-
24+
custom_container: diffusers/diffusers-doc-builder
2525
secrets:
2626
token: ${{ secrets.HUGGINGFACE_PUSH }}
2727
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}

.github/workflows/build_pr_documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
install_libgl1: true
2121
package: diffusers
2222
languages: en ko zh ja pt
23+
custom_container: diffusers/diffusers-doc-builder
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Check running SLOW tests from a PR (only GPU)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
docker_image:
7+
default: 'diffusers/diffusers-pytorch-cuda'
8+
description: 'Name of the Docker image'
9+
required: true
10+
branch:
11+
description: 'PR Branch to test on'
12+
required: true
13+
test:
14+
description: 'Tests to run (e.g.: `tests/models`).'
15+
required: true
16+
17+
env:
18+
DIFFUSERS_IS_CI: yes
19+
IS_GITHUB_CI: "1"
20+
HF_HOME: /mnt/cache
21+
OMP_NUM_THREADS: 8
22+
MKL_NUM_THREADS: 8
23+
PYTEST_TIMEOUT: 600
24+
RUN_SLOW: yes
25+
26+
jobs:
27+
run_tests:
28+
name: "Run a test on our runner from a PR"
29+
runs-on: [single-gpu, nvidia-gpu, t4, ci]
30+
container:
31+
image: ${{ github.event.inputs.docker_image }}
32+
options: --gpus 0 --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
33+
34+
steps:
35+
- name: Validate test files input
36+
id: validate_test_files
37+
env:
38+
PY_TEST: ${{ github.event.inputs.test }}
39+
run: |
40+
if [[ ! "$PY_TEST" =~ ^tests/ ]]; then
41+
echo "Error: The input string must start with 'tests/'."
42+
exit 1
43+
fi
44+
45+
if [[ ! "$PY_TEST" =~ ^tests/(models|pipelines) ]]; then
46+
echo "Error: The input string must contain either 'models' or 'pipelines' after 'tests/'."
47+
exit 1
48+
fi
49+
50+
if [[ "$PY_TEST" == *";"* ]]; then
51+
echo "Error: The input string must not contain ';'."
52+
exit 1
53+
fi
54+
echo "$PY_TEST"
55+
56+
- name: Checkout PR branch
57+
uses: actions/checkout@v4
58+
with:
59+
ref: ${{ github.event.inputs.branch }}
60+
repository: ${{ github.event.pull_request.head.repo.full_name }}
61+
62+
63+
- name: Install pytest
64+
run: |
65+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
66+
python -m uv pip install -e [quality,test]
67+
python -m uv pip install peft
68+
69+
- name: Run tests
70+
env:
71+
PY_TEST: ${{ github.event.inputs.test }}
72+
run: |
73+
pytest "$PY_TEST"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Please refer to the [How to use Stable Diffusion in Apple Silicon](https://huggi
7777

7878
## Quickstart
7979

80-
Generating outputs is super easy with 🤗 Diffusers. To generate an image from text, use the `from_pretrained` method to load any pretrained diffusion model (browse the [Hub](https://huggingface.co/models?library=diffusers&sort=downloads) for 22000+ checkpoints):
80+
Generating outputs is super easy with 🤗 Diffusers. To generate an image from text, use the `from_pretrained` method to load any pretrained diffusion model (browse the [Hub](https://huggingface.co/models?library=diffusers&sort=downloads) for 25.000+ checkpoints):
8181

8282
```python
8383
from diffusers import DiffusionPipeline
@@ -219,7 +219,7 @@ Also, say 👋 in our public Discord channel <a href="https://discord.gg/G7tWnz9
219219
- https://github.com/deep-floyd/IF
220220
- https://github.com/bentoml/BentoML
221221
- https://github.com/bmaltais/kohya_ss
222-
- +9000 other amazing GitHub repositories 💪
222+
- +11.000 other amazing GitHub repositories 💪
223223

224224
Thank you for using us ❤️.
225225

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM ubuntu:20.04
2+
LABEL maintainer="Hugging Face"
3+
LABEL repository="diffusers"
4+
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
12+
build-essential \
13+
git \
14+
git-lfs \
15+
curl \
16+
ca-certificates \
17+
libsndfile1-dev \
18+
python3.10 \
19+
python3-pip \
20+
libgl1 \
21+
zip \
22+
wget \
23+
python3.10-venv && \
24+
rm -rf /var/lib/apt/lists
25+
26+
# make sure to use venv
27+
RUN python3.10 -m venv /opt/venv
28+
ENV PATH="/opt/venv/bin:$PATH"
29+
30+
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
31+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
32+
python3.10 -m uv pip install --no-cache-dir \
33+
torch \
34+
torchvision \
35+
torchaudio \
36+
invisible_watermark \
37+
--extra-index-url https://download.pytorch.org/whl/cpu && \
38+
python3.10 -m uv pip install --no-cache-dir \
39+
accelerate \
40+
datasets \
41+
hf-doc-builder \
42+
huggingface-hub \
43+
Jinja2 \
44+
librosa \
45+
numpy \
46+
scipy \
47+
tensorboard \
48+
transformers \
49+
matplotlib \
50+
setuptools==69.5.1
51+
52+
CMD ["/bin/bash"]

docs/source/en/_toctree.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
title: Distributed inference with multiple GPUs
6060
- local: using-diffusers/merge_loras
6161
title: Merge LoRAs
62+
- local: using-diffusers/scheduler_features
63+
title: Scheduler features
6264
- local: using-diffusers/callback
6365
title: Pipeline callbacks
6466
- local: using-diffusers/reusing_seeds
@@ -68,6 +70,10 @@
6870
- local: using-diffusers/weighted_prompts
6971
title: Prompt techniques
7072
title: Inference techniques
73+
- sections:
74+
- local: advanced_inference/outpaint
75+
title: Outpainting
76+
title: Advanced inference
7177
- sections:
7278
- local: using-diffusers/sdxl
7379
title: Stable Diffusion XL
@@ -93,6 +99,8 @@
9399
title: Trajectory Consistency Distillation-LoRA
94100
- local: using-diffusers/svd
95101
title: Stable Video Diffusion
102+
- local: using-diffusers/marigold_usage
103+
title: Marigold Computer Vision
96104
title: Specific pipeline examples
97105
- sections:
98106
- local: training/overview
@@ -295,6 +303,8 @@
295303
title: Latent Diffusion
296304
- local: api/pipelines/ledits_pp
297305
title: LEDITS++
306+
- local: api/pipelines/marigold
307+
title: Marigold
298308
- local: api/pipelines/panorama
299309
title: MultiDiffusion
300310
- local: api/pipelines/musicldm
@@ -445,4 +455,4 @@
445455
title: Video Processor
446456
title: Internal classes
447457
isExpanded: false
448-
title: API
458+
title: API

0 commit comments

Comments
 (0)