-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Use pipelines without vae #10441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pipelines without vae #10441
Conversation
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 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |
) | |
self.vae_scale_factor = ( | |
2 ** (len(self.vae.config.block_out_channels) - 1) if getattr(self, "vae", None) is not None else 8 | |
) |
leaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've applied this everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single command. Thanks for this!
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! very nice initiative
What does this PR do?
As in #10439 and #10440 this PR guards some checks involving
vae
in a pipeline's__init__
that prevent it from being used withoutvae
i.e. for text encoder only.This is mainly
vae_scale_factor
, the default is set to8
as this is the most common value.vae_scale_factor
effects several parts of the pipeline, default height/width calculation,prepare_latents
,check_inputs
etc. Pipelines are generally designed to allow use without loadingvae
withoutput_type="latents"
for example, so it will be important to identify the pipelines wherevae_scale_factor
is not8
.In some Flux pipelines we add a guard for
self.vae.config.latent_channels
used inmask_processor
with default16
, this value is taken from Flux configs.Checking issues with pipeline's
__call__
andoutput_type="latents"
will be covered in another PR. Example inFluxFillPipeline
and the fix already present inFluxPipeline
:diffusers/src/diffusers/pipelines/flux/pipeline_flux_fill.py
Line 843 in c28db0a
diffusers/src/diffusers/pipelines/flux/pipeline_flux.py
Line 810 in c28db0a
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.
@sayakpaul @yiyixuxu