An open API service indexing awesome lists of open source software.

https://github.com/haoming02/sd-webui-aaa

An Extension for Automatic1111 Webui that generates a mask for Inpainting from the edge of the subject
https://github.com/haoming02/sd-webui-aaa

stable-diffusion-webui stable-diffusion-webui-plugin

Last synced: 6 months ago
JSON representation

An Extension for Automatic1111 Webui that generates a mask for Inpainting from the edge of the subject

Awesome Lists containing this project

README

          

# SD Webui Add Anything Anywhere
This is an Extension for the [Automatic1111 Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui),
which automatically generates a mask for Inpainting, from the edges of the specified image.

## But Why?
When you remove the background of a subject and place it on another image,
the edge of the subject may still contain some blending artifacts or inconsistency.
This can easily be sovlved by doing an Inpaint pass.
However, manually drawing a mask around the edge can be a chore.
Therefore, use this Extension to automatically generate one for you!

> See also [layerdiffusion](https://github.com/layerdiffusion/sd-forge-layerdiffusion) for cleaner images with no background

## Settings
**Images**
- **Background:** Background to place the subject on
- **Foreground:** The subject to place
- Requires alpha channel *(transparency)*
- **Mask Thickness:** The thickness of the generated mask
- Adjust this based on the image resolution
- **Low/High Threshold:** Parameters for the Canny edge detection
- Default values should be fine for the most cases

**Movements**
- **X Offset:** Move the subject horizontally
- **Y Offset:** Move the subject vertically
- **Rotation:** Rotate the subject
- **Scale:** Scale the subject

> Spamming this would generate a lot of images in the temporary Gradio directory.
I recommend you to pre-place the subject instead of using these ~~wacky~~ sliders...

## Example 1




1. A photo of a man




2. Remove background using rembg




3. A photo of a background




4. Place subject onto the background

Notice the grey outline around the subject




5. Generate a mask automatically

(Thickness = 10)




6. Inpaint!

## Example 2




Place objects anywhere!