Segment Anything for Stable Diffusion WebUI. Automatically generate high-quality segmentations/masks for images by clicking or text prompting. Aim for connecting WebUI and ControlNet with Segment Anything and GroundingDINO to enhance Stable Diffusion/ControlNet inpainting (both single image and batch process), enhance ControlNet semantic segmentation, automate image matting and create LoRA/LyCORIS training set.
 
 
Go to file
Chengsong Zhang 081b81cf87 add issue template 2023-04-10 22:20:15 +08:00
.github/ISSUE_TEMPLATE add issue template 2023-04-10 22:20:15 +08:00
javascript first commit 2023-04-10 21:50:48 +08:00
models/segment-everything add dummy model file 2023-04-10 22:04:46 +08:00
scripts implement automatic import segment-anything 2023-04-10 22:14:37 +08:00
.gitignore add dummy model file 2023-04-10 22:04:46 +08:00
README.md implement automatic import segment-anything 2023-04-10 22:14:37 +08:00

README.md

Segment Everything for Stable Diffusion Webui

This extension aim for helping stable diffusion webui users to use segment everything to do stable diffusion inpainting.

How to use

Step 1:

Download this extension to ${sd-webui}/extensions use whatever way you like (git clone or install from UI)

Step 2:

Download segment-everything model from here to ${sd-webui-segment-everything}/models/segment-everything

Step 3:

  • Launch webui and switch to img2img mode.
  • Upload your image, left click for positive prompt (black dot), right click for negative prompt (red dot), left click any dot again to cancel the prompt.
  • Click Preview Segmentation button
  • Choose your favorite segmentation and check Copy to Inpaint Upload
  • Switch to Inpaint upload. There is no need to upload another image or mask, just leave them blank. Write your prompt, configurate and click Generate.

Demo

https://user-images.githubusercontent.com/63914308/230916163-af661008-5a50-496e-8b79-8be7f193f9e9.mp4

Future Plan

I plan to support text->object detection->segmentation from Grounded Segment Anything in the near future. Stay tuned!

Contribute

Disclaimer: I have not thoroughly tested this extension, so there might be bugs. Bear with me while I'm fixing them :)

If you encounter a bug, please submit a issue.

I welcome any contribution. Please submit a pull request if you want to contribute