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 pipeline img2img inpainting #1114

Merged
merged 4 commits into from Nov 7, 2022
Merged

Community pipeline img2img inpainting #1114

merged 4 commits into from Nov 7, 2022

Conversation

vvvm23
Copy link
Contributor

@vvvm23 vvvm23 commented Nov 3, 2022

Resolves #905

However, it would see the base implementation doesn't actually support Tensor input (only PIL image).

the base implementation claims to support `torch.Tensor` but seems it
would also fail in this case.
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 3, 2022

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten
Copy link
Contributor

Hey @vvvm23 ,

Could you also add a section to the Examples README and a entry to the table: https://github.com/huggingface/diffusers/blob/main/examples/community/README.md#example-usages ?

This would be very nice :-)

@vvvm23
Copy link
Contributor Author

vvvm23 commented Nov 4, 2022

Sure, I can do that tomorrow for you ~ I'll also try and fix the bug with tensor inputs, but that may come later.

@vvvm23
Copy link
Contributor Author

vvvm23 commented Nov 5, 2022

Done, I can't fix the other issues today though, doing this PR from the airport 😅

@patrickvonplaten
Copy link
Contributor

Super cool!

@patrickvonplaten patrickvonplaten merged commit bcdb3d5 into huggingface:main Nov 7, 2022
@socathie
Copy link

socathie commented Nov 22, 2022

Hi @vvvm23 , thanks for the custom pipeline! It was very useful for my application - just wondering if the example usage script is accurate though? In particular, this line:

pipe = StableDiffusionInpaintPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    revision="fp16",
    torch_dtype=torch.float16,
)

seems like this just calls the regular inpaint pipeline and disregard the inner image argument?

I tried using the example but it seems that the entire mask gets inpainted and the inner image isn't pasted.

I would imagine it should be something more like (haven't tested yet):

pipe = DiffusionPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    custom_pipeline="img2img_inpainting",
)

@vvvm23
Copy link
Contributor Author

vvvm23 commented Nov 22, 2022

Good catch, just goes to show you shouldn't write PRs in an airport 😅 I'll change that tomorrow + adds some example results. Likely in a separate PR that I will link to this one.

@vvvm23
Copy link
Contributor Author

vvvm23 commented Nov 23, 2022

@socathie how does #1370 look to you?

@socathie
Copy link

socathie commented Nov 23, 2022

@socathie how does #1370 look to you?

Looking good. Works on my end as well.

PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
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.

[Community Pipeline] image2image inpainting?
4 participants