-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Allow directly passing text embeddings to Stable Diffusion Pipeline for prompt weighting #2071
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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.
I reviewed the first pipeline in depth, the comments would apply to others. I believe there's a typo in the InstructPix2PixPipeline?
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
Outdated
Show resolved
Hide resolved
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.
Looks good. I just left some nits. And as Pedro said, for InstrcutPix2Pix
, we need uncond embedding concat is different from other pipelines.
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
Outdated
Show resolved
Hide resolved
…or prompt weighting (huggingface#2071) * add text embeds to sd * add text embeds to sd * finish tests * finish * finish * make style * fix tests * make style * make style * up * better docs * fix * fix * new try * up * up * finish
…or prompt weighting (huggingface#2071) * add text embeds to sd * add text embeds to sd * finish tests * finish * finish * make style * fix tests * make style * make style * up * better docs * fix * fix * new try * up * up * finish
This PR allows to pass text_embeddings directly to the SD pipelines which should greatly help with writing pipelines such as Weight Prompting, Prompt-2-Prompt, etc...
For more details see discussion here: #1506 (comment)
As it's always the same function (
self._encode_prompt
), two tests for stable diffusion should be enough here IMO.