Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Local image masking tool for stable-diffusion-webui

NotificationsYou must be signed in to change notification settings

dfaker/stable-diffusion-webui-cv2-external-masking-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

Installation

Download the zipped script Hereand copy the file external_masking.py into your scripts folder.

requires cv2 to be installed

py -m pip install opencv-python

Due to conflicting cv2 versions this extension cannot be used at the same time as thed8ahazard/sd_dreambooth_extension extension.

Guide

The UI inside stable-diffusion-webui is pretty simpleScreenshot 2022-09-16 091930

Masking preview size controls the size of the popup CV2 window

Draw new mask on every run will popup a new window for a new mask each time generate is clicked, usually it'll only appear on the first run, or when the input image is changed.

The masking window itself is pretty minimalimage

Showing the polygon currently being drawn in pink, left clicking starts a new polygon, right clicking closes the current polycon being drawn.

C to the clear current mask.

Q to quit and pass the current mask back to stable-diffusion-webui

Scroll the mouse wheel to zoom in

Middle click and drag to pan around the image

The mask drawn with the script will not be shown on the input image, but will be used for all outputs:

Screenshot 2022-09-16 091911

Incompatible opencv versions

Some users are reporting errors with the gui window functions likehighgui\src\window.cpp:1250: error: (-2:Unspecified error) The function is not implemented. which seems to be down to havingopencv-python-headless installed which doesn't include the gui code used to display the image windows, uninstall the current version and reinstall if you get a similar message:

#For global python:py -m pip uninstall opencv-python-headlesspy -m pip uninstall opencv-pythonpy -m pip install --upgrade opencv-python#Or inside the stable-diffusion-webui venv:venv\Scripts\python -m pip uninstall opencv-python-headlessvenv\Scripts\python -m pip uninstall opencv-pythonvenv\Scripts\python -m pip install --upgrade opencv-python

About

Local image masking tool for stable-diffusion-webui

Topics

Resources

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp