graemeniedermayer / clothseg Goto Github PK
View Code? Open in Web Editor NEWThis is a wrapper of rem_bg for auto1111's stable diffusion gui. It can do clothing segmentation, background removal, and background masking.
This is a wrapper of rem_bg for auto1111's stable diffusion gui. It can do clothing segmentation, background removal, and background masking.
thx for all the efforts there.
so far, my sd will shows following error on start after installation
Python 3.10.0 (default, Aug 27 2023, 13:35:08) [GCC 12.3.0]
Version: v1.6.0
This extension has been automatically deactivated
Please remove this extension
==========================================================================
*** Error loading script: remove_bg.py
Traceback (most recent call last):
File "/home/xxx/servers/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/home/xxx/servers/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/xxx/servers/stable-diffusion-webui/extensions/clothseg/scripts/remove_bg.py", line 19, in <module>
from rembg import remove, new_session
ModuleNotFoundError: No module named 'rembg'
---
even I've executed
pip install rem_bg
successfully, it still cannot load, any ideas why?
thx in advance!
I installed via URL, not sure what to do next :)
Thanks for this script. Everything works as described for individual images.
I was trying to do batch clothing segmentation using the extras tab. It works but it always spits out the 3 masks all in one image (Top+bottom+combined). Is there a way to only spit out one? I'm not sure if I'm missing a step here.
2 addition questions:
Thanks again for the great work!
Error completing request
Arguments: ('task(nc1hvqo5kce170y)', 0, '', '', [], <PIL.Image.Image image mode=RGBA size=1440x1800 at 0x7F60747EB7F0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 0, -1.0, -1.0, 0, 0, 0, False, 512, 512, 1, 0, 32, 0, '', '', '', [], 9, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 'u2net_cloth_seg', True, True, True, True) {}
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 56, in f
res = list(func(*args, **kwargs))
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/img2img.py", line 166, in img2img
processed = modules.scripts.scripts_img2img.run(p, *args)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 376, in run
processed = script.run(p, *script_args)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/clothseg/scripts/remove_bg.py", line 83, in run
remove_img = remove(processed.images[count], session=session)
File "/usr/local/lib/python3.8/dist-packages/rembg/bg.py", line 135, in remove
masks = session.predict(img)
File "/usr/local/lib/python3.8/dist-packages/rembg/session_cloth.py", line 64, in predict
pred = np.argmax(pred, axis=1, keepdims=True)
File "<__array_function__ internals>", line 4, in argmax
TypeError: _argmax_dispatcher() got an unexpected keyword argument 'keepdims'
This problem is only with u2net_cloth_seg. Other models work fine.
Maybe I'm just doing something wrong?
I go into img2img and select the image, then in Script I select remove_bg v0.0.2 and run.
Denoising strength to 0 (I don't want the image to change).
I tried this recently and it works very nicely. any way we could have rembg install automatically?
the package requests Pillow 9.3, and webui uses 9.4
i can see why the install of rembg
can cause issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.