Skip to content

Commit 4f59d56

Browse files
committed
Merge branch 'main' into allegro-impl
2 parents f702af0 + e45c25d commit 4f59d56

File tree

60 files changed

+284
-128
lines changed

Some content is hidden

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

60 files changed

+284
-128
lines changed

docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_3.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,26 @@ image = pipe("a picture of a cat holding a sign that says hello world").images[0
313313
image.save('sd3-single-file-t5-fp8.png')
314314
```
315315

316+
### Loading the single file checkpoint for the Stable Diffusion 3.5 Transformer Model
317+
318+
```python
319+
import torch
320+
from diffusers import SD3Transformer2DModel, StableDiffusion3Pipeline
321+
322+
transformer = SD3Transformer2DModel.from_single_file(
323+
"https://huggingface.co/stabilityai/stable-diffusion-3.5-large-turbo/blob/main/sd3.5_large.safetensors",
324+
torch_dtype=torch.bfloat16,
325+
)
326+
pipe = StableDiffusion3Pipeline.from_pretrained(
327+
"stabilityai/stable-diffusion-3.5-large",
328+
transformer=transformer,
329+
torch_dtype=torch.bfloat16,
330+
)
331+
pipe.enable_model_cpu_offload()
332+
image = pipe("a cat holding a sign that says hello world").images[0]
333+
image.save("sd35.png")
334+
```
335+
316336
## StableDiffusion3Pipeline
317337

318338
[[autodoc]] StableDiffusion3Pipeline

docs/source/en/quantization/bitsandbytes.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,7 @@ model_8bit = FluxTransformer2DModel.from_pretrained(
5959
model_8bit.transformer_blocks.layers[-1].norm2.weight.dtype
6060
```
6161

62-
Once a model is quantized, you can push the model to the Hub with the [`~ModelMixin.push_to_hub`] method. The quantization `config.json` file is pushed first, followed by the quantized model weights.
63-
64-
```py
65-
from diffusers import FluxTransformer2DModel, BitsAndBytesConfig
66-
67-
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
68-
69-
model_8bit = FluxTransformer2DModel.from_pretrained(
70-
"black-forest-labs/FLUX.1-dev",
71-
subfolder="transformer",
72-
quantization_config=quantization_config
73-
)
74-
```
62+
Once a model is quantized, you can push the model to the Hub with the [`~ModelMixin.push_to_hub`] method. The quantization `config.json` file is pushed first, followed by the quantized model weights. You can also save the serialized 4-bit models locally with [`~ModelMixin.save_pretrained`].
7563

7664
</hfoption>
7765
<hfoption id="4-bit">
@@ -131,7 +119,7 @@ from diffusers import FluxTransformer2DModel, BitsAndBytesConfig
131119
quantization_config = BitsAndBytesConfig(load_in_4bit=True)
132120

133121
model_4bit = FluxTransformer2DModel.from_pretrained(
134-
"sayakpaul/flux.1-dev-nf4-pkg", subfolder="transformer"
122+
"hf-internal-testing/flux.1-dev-nf4-pkg", subfolder="transformer"
135123
)
136124
```
137125

@@ -264,4 +252,9 @@ double_quant_model = SD3Transformer2DModel.from_pretrained(
264252
quantization_config=double_quant_config,
265253
)
266254
model.dequantize()
267-
```
255+
```
256+
257+
## Resources
258+
259+
* [End-to-end notebook showing Flux.1 Dev inference in a free-tier Colab](https://gist.github.com/sayakpaul/c76bd845b48759e11687ac550b99d8b4)
260+
* [Training](https://gist.github.com/sayakpaul/05afd428bc089b47af7c016e42004527)

examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
import wandb
7575

7676
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
77-
check_min_version("0.31.0.dev0")
77+
check_min_version("0.32.0.dev0")
7878

7979
logger = get_logger(__name__)
8080

examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272

7373
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
74-
check_min_version("0.31.0.dev0")
74+
check_min_version("0.32.0.dev0")
7575

7676
logger = get_logger(__name__)
7777

examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
import wandb
8080

8181
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
82-
check_min_version("0.31.0.dev0")
82+
check_min_version("0.32.0.dev0")
8383

8484
logger = get_logger(__name__)
8585

examples/cogvideo/train_cogvideox_image_to_video_lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
import wandb
6262

6363
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
64-
check_min_version("0.31.0.dev0")
64+
check_min_version("0.32.0.dev0")
6565

6666
logger = get_logger(__name__)
6767

examples/cogvideo/train_cogvideox_lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import wandb
5353

5454
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
55-
check_min_version("0.31.0.dev0")
55+
check_min_version("0.32.0.dev0")
5656

5757
logger = get_logger(__name__)
5858

examples/community/marigold_depth_estimation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
46-
check_min_version("0.31.0.dev0")
46+
check_min_version("0.32.0.dev0")
4747

4848

4949
class MarigoldDepthOutput(BaseOutput):

examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
import wandb
7474

7575
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
76-
check_min_version("0.31.0.dev0")
76+
check_min_version("0.32.0.dev0")
7777

7878
logger = get_logger(__name__)
7979

examples/consistency_distillation/train_lcm_distill_lora_sdxl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import wandb
6767

6868
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
69-
check_min_version("0.31.0.dev0")
69+
check_min_version("0.32.0.dev0")
7070

7171
logger = get_logger(__name__)
7272

0 commit comments

Comments
 (0)