Skip to content

Commit ab958c3

Browse files
authored
Merge branch 'main' into readme
2 parents 420a151 + 7116fd2 commit ab958c3

File tree

261 files changed

+2452
-1225
lines changed

Some content is hidden

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

261 files changed

+2452
-1225
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ jobs:
272272
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
273273
-s -v -k "not Flax and not Onnx" \
274274
--make-reports=tests_torch_minimum_version_cuda \
275-
tests/models/test_modelling_common.py \
275+
tests/models/test_modeling_common.py \
276276
tests/pipelines/test_pipelines_common.py \
277277
tests/pipelines/test_pipeline_utils.py \
278278
tests/pipelines/test_pipelines.py \

.github/workflows/pr_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ jobs:
266266
# TODO (sayakpaul, DN6): revisit `--no-deps`
267267
python -m pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
268268
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
269+
python -m uv pip install -U tokenizers
269270
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
270271
271272
- name: Environment

.github/workflows/release_tests_fast.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
194194
-s -v -k "not Flax and not Onnx" \
195195
--make-reports=tests_torch_minimum_cuda \
196-
tests/models/test_modelling_common.py \
196+
tests/models/test_modeling_common.py \
197197
tests/pipelines/test_pipelines_common.py \
198198
tests/pipelines/test_pipeline_utils.py \
199199
tests/pipelines/test_pipelines.py \

docs/source/en/api/pipelines/aura_flow.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,33 @@ image = pipeline(prompt).images[0]
6262
image.save("auraflow.png")
6363
```
6464

65+
Loading [GGUF checkpoints](https://huggingface.co/docs/diffusers/quantization/gguf) are also supported:
66+
67+
```py
68+
import torch
69+
from diffusers import (
70+
AuraFlowPipeline,
71+
GGUFQuantizationConfig,
72+
AuraFlowTransformer2DModel,
73+
)
74+
75+
transformer = AuraFlowTransformer2DModel.from_single_file(
76+
"https://huggingface.co/city96/AuraFlow-v0.3-gguf/blob/main/aura_flow_0.3-Q2_K.gguf",
77+
quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
78+
torch_dtype=torch.bfloat16,
79+
)
80+
81+
pipeline = AuraFlowPipeline.from_pretrained(
82+
"fal/AuraFlow-v0.3",
83+
transformer=transformer,
84+
torch_dtype=torch.bfloat16,
85+
)
86+
87+
prompt = "a cute pony in a field of flowers"
88+
image = pipeline(prompt).images[0]
89+
image.save("auraflow.png")
90+
```
91+
6592
## AuraFlowPipeline
6693

6794
[[autodoc]] AuraFlowPipeline

docs/source/en/api/pipelines/sana.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Refer to the [Quantization](../../quantization/overview) overview to learn more
5959
```py
6060
import torch
6161
from diffusers import BitsAndBytesConfig as DiffusersBitsAndBytesConfig, SanaTransformer2DModel, SanaPipeline
62-
from transformers import BitsAndBytesConfig as BitsAndBytesConfig, AutoModelForCausalLM
62+
from transformers import BitsAndBytesConfig as BitsAndBytesConfig, AutoModel
6363

6464
quant_config = BitsAndBytesConfig(load_in_8bit=True)
65-
text_encoder_8bit = AutoModelForCausalLM.from_pretrained(
65+
text_encoder_8bit = AutoModel.from_pretrained(
6666
"Efficient-Large-Model/Sana_1600M_1024px_diffusers",
6767
subfolder="text_encoder",
6868
quantization_config=quant_config,

examples/community/README.md

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

examples/community/adaptive_mask_inpainting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def __init__(
450450
safety_checker=safety_checker,
451451
feature_extractor=feature_extractor,
452452
)
453-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
453+
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1) if getattr(self, "vae", None) else 8
454454
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
455455
self.register_to_config(requires_safety_checker=requires_safety_checker)
456456

examples/community/composable_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __init__(
162162
safety_checker=safety_checker,
163163
feature_extractor=feature_extractor,
164164
)
165-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
165+
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1) if getattr(self, "vae", None) else 8
166166
self.register_to_config(requires_safety_checker=requires_safety_checker)
167167

168168
def _encode_prompt(self, prompt, device, num_images_per_prompt, do_classifier_free_guidance, negative_prompt):

examples/community/edict_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
scheduler=scheduler,
3636
)
3737

38-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
38+
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1) if getattr(self, "vae", None) else 8
3939
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
4040

4141
def _encode_prompt(

examples/community/fresco_v2v.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ def __init__(
13421342
feature_extractor=feature_extractor,
13431343
image_encoder=image_encoder,
13441344
)
1345-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
1345+
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1) if getattr(self, "vae", None) else 8
13461346
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor, do_convert_rgb=True)
13471347
self.control_image_processor = VaeImageProcessor(
13481348
vae_scale_factor=self.vae_scale_factor, do_convert_rgb=True, do_normalize=False

0 commit comments

Comments
 (0)