Replacer is an extension for AUTOMATIC1111/stable-diffusion-webui. The goal of this extension is to automate objects masking by detection prompt, using sd-webui-segment-anything, and img2img inpainting in one easy to use tab. It also useful for batch inpaint, and inpaint in video with AnimateDiff
You also can draw your mask instead of or in addition to detection, and take advantage of convenient HiresFix option, and ControlNet inpainting with preserving original image resolution and aspect ratio
If you find this project useful, please star it on GitHub!
Extension
-> Available
-> click Load from
and search "sd-webui-segment-anything"extensions/sd-webui-segment-anything/models/sam
lcm-lora-sdv1-5.safetensors
, put into models/Lora
. Or if you have already lcm lora, then change hires suffix in the extension optionsExtension
-> Available
-> click Load from
and search "Replacer". Be sure your sd-webui version is >= 1.5.0. For AMD and Intel GPUs, and maybe something else, you need to enable CPU for detection in Replacer's settings. Go to Settings
-> Replacer
and enable itIf you don't want to use Video feature, that's all for you. Further steps are for Video:
Extension
-> Available
tab and find them thereextensions/sd-webui-animatediff/model
directorymodels/ControlNet
directorymodels/ControlNet
directory. Then you can select SparseCtrl module in ControlNet extension. The rgb one requires "none" preprocessorSAM-HQ are the best for me. Choose it depending on your vram. Sum this model size with dino model size (694MB-938MB)
FastSAM and Matting-Anything aren't currently supported
First, grounding dino models detect objects you provided in the detection prompt. Then segment anything model generates contours of them. And then extension chooses randomly 1 of 3 generated masks, and inpaints it with regular inpainting method in a1111 webui
When you press the "Apply hires fix" button, the extension regenerates the image with exactly the same settings, excluding upscaler_for_img2img. Then it applies inpainting with "Original" masked content mode and lower denoising but higher resolution.
ar-plusplus (maybe works with "Aspect Ratio and Resolution Buttons" forks)
Other extension scripts which doesn't have control arguments, e.g. Hardware Info in metadata, NudeNet NSFW Censor, built-in Hypertile
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。