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
- Host: GitHub
- URL: https://github.com/haoming02/sd-webui-aaa
- Owner: Haoming02
- License: mit
- Created: 2024-01-11T06:17:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T08:08:28.000Z (almost 2 years ago)
- Last Synced: 2024-03-03T09:23:42.027Z (almost 2 years ago)
- Topics: stable-diffusion-webui, stable-diffusion-webui-plugin
- Language: Python
- Homepage:
- Size: 574 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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!