KutsuyaYuki / ABG_extension

228 stars 23 forks source link

ValueError: could not broadcast input array from shape (1024,1024,4) into shape (1024,1024,3) #8

Closed gembleman closed 1 year ago

gembleman commented 1 year ago

Arguments: ('task(mxoj4dl0g6k95x3)', 0, '', '', ['01'], <PIL.Image.Image image mode=RGBA size=1280x1020 at 0x1E58BCE1120>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, 0, 32, 0, '', '', '', [], 9, '

\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', False, False, '', '

Will upscale the image by the selected scale factor; use width and height sliders to set tile size

', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, False) {} Traceback (most recent call last): File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(*args, *kwargs)) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(args, *kwargs) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\modules\img2img.py", line 166, in img2img processed = modules.scripts.scripts_img2img.run(p, args) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\modules\scripts.py", line 376, in run processed = script.run(p, *script_args) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\extensions\ABG_extension\scripts\app.py", line 100, in run nmask, nimg = rmbg_fn(np.array(proc.images[i])) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\extensions\ABG_extension\scripts\app.py", line 61, in rmbg_fn mask = get_mask(img) File "C:\Users\jjj\Desktop\GrimAI_test\stable-diffusion-webui\extensions\ABG_extension\scripts\app.py", line 41, in get_mask img_input[ph // 2:ph // 2 + h, pw // ValueError: could not broadcast input array from shape (1024,1024,4) into shape (1024,1024,3)

This bug occurs when I use the img2img function.

mlc3141 commented 1 year ago

Same error here. Have you found a workaround?

KutsuyaYuki commented 1 year ago

Are you using a JPEG? The WebUI can't change the output format currently. There is an open issue on the 1111 repo.

gembleman commented 1 year ago

Are you using a JPEG? The WebUI can't change the output format currently. There is an open issue on the 1111 repo.

No. I using Png file. qoo1 this file.

KutsuyaYuki commented 1 year ago

hey @gembleman. Why are you using that file? What background are you trying to remove from it? This plugin is mainly meant for humanoids/anime. And besides that, your picture is already transparent.

sedetweiler commented 1 year ago

Same error. I need to find another solution if we are all stuck in the same place.

gembleman commented 1 year ago

hey @gembleman. Why are you using that file? What background are you trying to remove from it? This plugin is mainly meant for humanoids/anime. And besides that, your picture is already transparent.

dddd I recording this issue. check it.

KutsuyaYuki commented 1 year ago

I have attempted to fix the issue. I cannot reproduce it myself, but this should at least work around the exception you are getting.

KutsuyaYuki commented 1 year ago

Closed because no further response