Skip to content

Commit 8088bf2

Browse files
authored
Merge branch 'main' into fix-unloading-expanded-flux
2 parents 1106c88 + 01780c3 commit 8088bf2

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

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

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

2121
<Tip>
2222

23-
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers.md) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading.md#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines.
23+
Make sure to check out the Schedulers [guide](https://huggingface.co/docs/diffusers/main/en/using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines.
2424

2525
</Tip>
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ HunyuanDiT has the following components:
3030

3131
<Tip>
3232

33-
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers.md) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading.md#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines.
33+
Make sure to check out the Schedulers [guide](https://huggingface.co/docs/diffusers/main/en/using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines.
3434

3535
</Tip>
3636

src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,21 @@ def __init__(
226226
transformer=transformer,
227227
scheduler=scheduler,
228228
)
229-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
229+
self.vae_scale_factor = (
230+
2 ** (len(self.vae.config.block_out_channels) - 1) if hasattr(self, "vae") and self.vae is not None else 8
231+
)
232+
latent_channels = self.vae.config.latent_channels if hasattr(self, "vae") and self.vae is not None else 16
230233
self.image_processor = VaeImageProcessor(
231-
vae_scale_factor=self.vae_scale_factor, vae_latent_channels=self.vae.config.latent_channels
234+
vae_scale_factor=self.vae_scale_factor, vae_latent_channels=latent_channels
235+
)
236+
self.tokenizer_max_length = (
237+
self.tokenizer.model_max_length if hasattr(self, "tokenizer") and self.tokenizer is not None else 77
238+
)
239+
self.default_sample_size = (
240+
self.transformer.config.sample_size
241+
if hasattr(self, "transformer") and self.transformer is not None
242+
else 128
232243
)
233-
self.tokenizer_max_length = self.tokenizer.model_max_length
234-
self.default_sample_size = self.transformer.config.sample_size
235244
self.patch_size = (
236245
self.transformer.config.patch_size if hasattr(self, "transformer") and self.transformer is not None else 2
237246
)

src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,28 @@ def __init__(
225225
transformer=transformer,
226226
scheduler=scheduler,
227227
)
228-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
228+
self.vae_scale_factor = (
229+
2 ** (len(self.vae.config.block_out_channels) - 1) if hasattr(self, "vae") and self.vae is not None else 8
230+
)
231+
latent_channels = self.vae.config.latent_channels if hasattr(self, "vae") and self.vae is not None else 16
229232
self.image_processor = VaeImageProcessor(
230-
vae_scale_factor=self.vae_scale_factor, vae_latent_channels=self.vae.config.latent_channels
233+
vae_scale_factor=self.vae_scale_factor, vae_latent_channels=latent_channels
231234
)
232235
self.mask_processor = VaeImageProcessor(
233236
vae_scale_factor=self.vae_scale_factor,
234-
vae_latent_channels=self.vae.config.latent_channels,
237+
vae_latent_channels=latent_channels,
235238
do_normalize=False,
236239
do_binarize=True,
237240
do_convert_grayscale=True,
238241
)
239-
self.tokenizer_max_length = self.tokenizer.model_max_length
240-
self.default_sample_size = self.transformer.config.sample_size
242+
self.tokenizer_max_length = (
243+
self.tokenizer.model_max_length if hasattr(self, "tokenizer") and self.tokenizer is not None else 77
244+
)
245+
self.default_sample_size = (
246+
self.transformer.config.sample_size
247+
if hasattr(self, "transformer") and self.transformer is not None
248+
else 128
249+
)
241250
self.patch_size = (
242251
self.transformer.config.patch_size if hasattr(self, "transformer") and self.transformer is not None else 2
243252
)

0 commit comments

Comments
 (0)