djbielejeski / a-person-mask-generator

Extension for Automatic1111 and ComfyUI to automatically create masks for Background/Hair/Body/Face/Clothes in Img2Img
MIT License
247 stars 30 forks source link

Script.before_process() wrongly triggered at the 'txt2img' mode #1

Closed LIU-Yinyi closed 8 months ago

LIU-Yinyi commented 8 months ago
Environment Version
Stable Diffusion v1.6.0-2-g4afaaf8a
A Person Mask Generator commit: 04cad56

At the img2img mode, it works perfectly. But when clicking Generate button at the txt2img tab, it will trigger an error:

*** Error running before_process: \path\to\StableDiffusion\stable-diffusion-webui\extensions\a-person-mask-generator\scripts\a_person_mask_generator.py
    Traceback (most recent call last):
      File "\path\to\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 611, in before_process
        script.before_process(p, *script_args)
    TypeError: Script.before_process() missing 2 required positional arguments: 'enabled' and 'mask_targets'

It seems that the bug is caused by no arguments to submit at the txt2img mode while before_process() is wrongly triggered to require two non-exist arguments. May fix it by adding a tab/mode check.

djbielejeski commented 8 months ago

@LIU-Yinyi this has been fixed. Thanks for reporting the issue!