-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[BUG] fixes in kadinsky pipeline #11080
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
Conversation
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. |
thanks @ishan-modi ! |
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 think there are some kandinsky test failure that's potentially related https://github.com/huggingface/diffusers/actions/runs/14330695758/job/40203664079?pr=11080#step:6:33932 |
978ad6b
to
e6fa809
Compare
Thanks for the review, fixed the tests ! |
resample="bicubic", | ||
reducing_gap=1, | ||
) | ||
kwargs = {} |
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.
ohh we can just give them a default value like this
movq_scale_factor = 2 ** (len(self.movq.config.block_out_channels) - 1) if getattr(self, "movq", None) else ..
movq_latent_channels = self.movq.config.latent_channels if getattr(self, "movq", None) else ..
to be consistent with how it is handled in other pipelines, for example https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py#L218
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.
Same comment for all pipelines.
else: | ||
image = latents | ||
image = self.image_processor.postprocess(image, output_type) |
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.
This breaks output_type == "latent"
. image_processor.postprocess
should not be applied to latent output.
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.
hmm, postprocess
function doesn't do anything if the output_type is "latent", see here.
Let me know if I am missing anything
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.
Even so, the code style does not match other pipelines, please make the requested changes to keep consistency with code styling.
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.
Alright, made the change let me know if it looks good
if output_type not in ["pt", "np", "pil", "latent"]: | ||
raise ValueError( | ||
f"Only the output types `pt`, `pil`, `np` and `latent` are supported not output_type={output_type}" | ||
) |
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.
This can be removed. Refer to other pipelines for an example.
diffusers/src/diffusers/pipelines/flux/pipeline_flux.py
Lines 974 to 981 in 31c4f24
if output_type == "latent": | |
image = latents | |
else: | |
latents = self._unpack_latents(latents, height, width, self.vae_scale_factor) | |
latents = (latents / self.vae.config.scaling_factor) + self.vae.config.shift_factor | |
image = self.vae.decode(latents, return_dict=False)[0] | |
image = self.image_processor.postprocess(image, output_type=output_type) |
@hlky gentle ping |
thanks a lot @ishan-modi |
What does this PR do?
Fixes #11060
Who can review?
@DN6