auto-sd-paint-ext icon indicating copy to clipboard operation
auto-sd-paint-ext copied to clipboard

Inpainting error: `TypeError: unsupported operand type(s) for -: 'list' and 'int'`

Open wauterboi opened this issue 1 year ago • 6 comments

For some reason, I keep getting this bizarre error that occurs whenever I try to inpaint. I'm not trying to use any scripts, although it doesn't matter if I specify a script or not - something is expecting an integer and getting a list, and I suspect it is because script_index is an incorrect value: self.selectable_scripts[script_index-1].

Error completing request
Arguments: ('', 4, 'asdf', 'asdf', 'None', <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=512x512 at 0x2951AEBA9E0>, None, None, None, None, <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=512x512 at 0x2951AEBA9E0>, <PIL.Image.Image image mode=L size=512x512 at 0x2951AEBAE60>, 150, 17, 0, None, 1, False, False, 1, 1, 5.0, 0, 0.75, -1, -1, 0.0, 0, 0, False, 512, 512, 1, False, 0, False, '', '', '', [], 0) {}
Traceback (most recent call last):
  File "A:\Programs\stable-diffusion-webui\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "A:\Programs\stable-diffusion-webui\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "A:\Programs\stable-diffusion-webui\modules\img2img.py", line 166, in img2img
    processed = modules.scripts.scripts_img2img.run(p, *args)
  File "A:\Programs\stable-diffusion-webui\modules\scripts.py", line 370, in run
    script = self.selectable_scripts[script_index-1]
TypeError: unsupported operand type(s) for -: 'list' and 'int'

The effect is that the selected layer has its visibility toggled off, and nothing else happens.

wauterboi avatar Mar 04 '23 09:03 wauterboi

It appears reverting to commit 2358931f57f1faee4196d87dd5323473948890dc fixes it.

wauterboi avatar Mar 04 '23 19:03 wauterboi

Hm seems like maybe upstream allows selecting multiple scripts at once now. Well, I will worry about that next weekend.

Interpause avatar Mar 05 '23 13:03 Interpause

I do have the same problem :(

Monster-Zonk avatar May 08 '23 17:05 Monster-Zonk

Hm seems like maybe upstream allows selecting multiple scripts at once now. Well, I will worry about that next weekend.

When I wrote this, why did I not link the specific webUI commit that changed this

Interpause avatar May 14 '23 14:05 Interpause

thanks for this krita extension. text2img works fine but img2img and inpainting don't work at all.

script = self.selectable_scripts[script_index-1]

TypeError: unsupported operand type(s) for -: 'str' and 'int'

kinduun avatar Jun 02 '23 23:06 kinduun

I hope this problem gets solved so that I can use this plugin again. (┬┬﹏┬┬)

shamizen avatar Jun 05 '23 16:06 shamizen