Skip to content
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

[Community] PromptDiffusion Pipeline #6752

Merged
merged 30 commits into from
Mar 5, 2024

Conversation

iczaw
Copy link
Contributor

@iczaw iczaw commented Jan 29, 2024

What does this PR do?

Adds the SD implementation of Prompt Diffusion

Project page: https://zhendong-wang.github.io/prompt-diffusion.github.io/
Paper: https://arxiv.org/abs/2305.01115
Code: https://github.com/Zhendong-Wang/Prompt-Diffusion
Models: https://huggingface.co/zhendongw/prompt-diffusion

Fixes #6214

Before submitting

Who can review?

@sayakpaul @patrickvonplaten

@@ -80,6 +80,7 @@
"AutoencoderTiny",
"ConsistencyDecoderVAE",
"ControlNetModel",
"PromptDiffusionControlNetModel",
Copy link
Member

Choose a reason for hiding this comment

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

Can we maybe move this pipeline to the research_projects as it has a new model component too?

@@ -0,0 +1,401 @@
# Copyright 2023 The HuggingFace Team. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably go into the community folder

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

If we want to add a community pipeline let's make sure that we don't add any code to src/diffusers

@iczaw iczaw requested a review from sayakpaul February 4, 2024 23:15

# load prompt diffusion control net and prompt diffusion

controlnet = PromptDiffusionControlNetModel.from_pretrained("path-to-promptdiffusion-controlnet", torch_dtype=torch.float16)
Copy link
Member

Choose a reason for hiding this comment

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

I think it makes sense to first talk about how this checkpoint was obtained i.e., an example command of running the conversion.

Copy link
Member

Choose a reason for hiding this comment

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

Could you provide the checkpoint path from the Hub directly? I.e., it could make sense to directly load it from the Hub? A few options:

  • Host it under your HF profile while clearly providing the citations to the original model.
  • Reach out to the author to see if they'd be willing to have the converted checkpoint under their HF profile.

Let me know what you think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Zhendong-Wang/Prompt-Diffusion#12 No official release date, so mine has to suffice.


controlnet = PromptDiffusionControlNetModel.from_pretrained("path-to-promptdiffusion-controlnet", torch_dtype=torch.float16)
model_id = "path-to-model"
pipe = DiffusionPipeline.from_pretrained(model_id, controlnet=controlnet, torch_dtype=torch.float16, variant="fp16", custom_pipeline="path-to-pipeline_prompt_diffusion")
Copy link
Member

@sayakpaul sayakpaul Feb 5, 2024

Choose a reason for hiding this comment

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

Shouldn't this be PromptDiffusionPipeline?

@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.

@iczaw iczaw requested a review from sayakpaul February 8, 2024 13:59
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

This PR looks solid to me.

I just left one comment: https://github.com/huggingface/diffusers/pull/6752/files#r1483236580.

@yiyixuxu
Copy link
Collaborator

nice work! @iczaw
can you take a look at sayak's comments here? #6752 (comment)

we can merge this once this is addressed :)

@sayakpaul
Copy link
Member

Thanks for your contributions.

@sayakpaul sayakpaul merged commit 6246c70 into huggingface:main Mar 5, 2024
8 checks passed
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.

[Prompt Diffusion] In-Context Learning Unlocked for Diffusion Models
5 participants