Skip to content

Conversation

@hlky
Copy link
Contributor

@hlky hlky commented Dec 27, 2024

What does this PR do?

Values like vae_scale_factor in pipelines are derived from configurations of component modules e.g. self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1), some pipelines are missing default values when the module is not loaded

self.vae_scale_factor = (
    2 ** (len(self.vae.config.block_out_channels) - 1) if hasattr(self, "vae") and self.vae is not None else 8
)

This PR adds default values in SD3 pipelines.

Reproduction

from diffusers import StableDiffusion3Img2ImgPipeline
import torch

pipe = StableDiffusion3Img2ImgPipeline.from_pretrained(
    "stabilityai/stable-diffusion-3.5-large",
    vae=None, # or `tokenizer` or `transformer`
    torch_dtype=torch.bfloat16,
)

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@yiyixuxu yiyixuxu merged commit 55ac1db into huggingface:main Dec 27, 2024
12 checks passed
@hlky hlky mentioned this pull request Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants