-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add the Stable diffusion inpaint support #869
base: main
Are you sure you want to change the base?
Conversation
@regisss Please help to review. Thanks. |
Performance benchmark:
|
@libinta Please help to review. |
optimum/habana/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
Outdated
Show resolved
Hide resolved
Add an inpainting example. Will add the other inpainting pipeline later. Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
The pipeline_stable_diffusion_xl_inpaint is copied from https://github.com/huggingface/diffusers/blob/v0.26.3/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
1. Add the source of the file 2. refine the example code 3. remove the useless code Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
CI Test report: pytest test_stable_diffusion_inpaint.py pytest test_stable_diffusion_xl_inpaint.py |
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Done: stable_diffusion_xl_inpaint batch performance |
Signed-off-by: yuanwu <[email protected]>
…paint Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Hi all, I am using this PR for one of our opensource research code. Would like to know when will this PR get merged so I can use it without pointing to the PR? |
optimum/habana/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,251 @@ | |||
#!/usr/bin/env python |
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 should be incorporated into text_to_image_generation.py
sample as all SD samples are
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 patch has a dependency on MC patch , it also modified the text_to_image_generation.py. Once the mc patch is merged. I will update this patch
optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
Outdated
Show resolved
Hide resolved
optimum/habana/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
Outdated
Show resolved
Hide resolved
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
Signed-off-by: yuanwu <[email protected]>
@dsocek Please help to review. |
@yuanwu2017 can we rebase this to main? @dsocek can you review this? |
Yes. It has been the latest. |
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 now. Please rebase and merge text_to_image_inpainting.py
into text_to_image_generation.py
when MC patch merges.
Ok. No problem. |
What does this PR do?
The PR tried to reproduce the stable diffusion inpaint on Gaudi2 according to Huggingface inpaint doc.
TODO:
Add the batch_size support.
Fixes # (issue)
Before submitting