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

Add inpainting to the stable diffusion example #2735

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

mneilly
Copy link
Contributor

@mneilly mneilly commented Jan 23, 2025

This change updates the stable diffusion example with inpainting for 1.5, 2 and XL. It adds a --mask-path command line argument to set the path to the mask image and it uses the existing img2img argument to set the input image.

The following is an example of the output of 10 samples from SDXL using:

cargo run --example stable-diffusion --features cuda,cudnn,flash-attn -- --prompt "a cute baby lion sitting on a park bench" --sd-version xl-inpaint --use-f16 --use-flash-attn --img2img overture-creations-5sI6fQgYIuo_big.png --mask-path overture-creations-5sI6fQgYIuo_mask_big.png --guidance-scale 7 --num-samples 10

montage

@LaurentMazare
Copy link
Collaborator

Nice addition, thanks!

@LaurentMazare LaurentMazare merged commit 3164a19 into huggingface:main Jan 23, 2025
10 checks passed
super-fun-surf pushed a commit to aifx-art/candle that referenced this pull request Jan 28, 2025
* Update the stable diffusion example with inpainting support for 1.5, 2 and XL.

* Apply cargo fmt.

* Clippy fixes.

---------

Co-authored-by: laurent <[email protected]>
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.

2 participants