continue-revolution / sd-webui-segment-anything

Segment Anything for Stable Diffusion WebUI
3.38k stars 204 forks source link

[Bug]: ControlNet error on text2img, fails related to SA #100

Open robbiep opened 1 year ago

robbiep commented 1 year ago

Is there an existing issue for this?

Have you updated WebUI and this extension to the newest version?

Do you understand that you should go to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues if you cannot install GroundingDINO?

Do you know that you should use the newest ControlNet extension and enable external control if you want SAM extension to control ControlNet?

What happened?

SA breaks control net v1.1.166 text2img

Steps to reproduce the problem

  1. Install controlnet 1.1.166 and segment anything master (SHA 040312a)
  2. Load text2img
  3. Use anything in controlnet
  4. receive error

What should have happened?

Controlnet should work independently of segment anything unless SA is being utilized

Commit where the problem happens

webui: commit: 5ab7f213 extension: controlnet 1.1.166, SA 040312a

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

n/a

Console logs

Error running process: C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\sam.py
Traceback (most recent call last):
  File "C:\Stable_Diffusion\stable-diffusion-webui\modules\scripts.py", line 417, in process
    script.process(p, *script_args)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\sam.py", line 761, in process
    process_unit.set_process_attributes(p)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\process_params.py", line 87, in set_process_attributes
    inpaint_image, inpaint_mask = self.sam_inpaint_unit.get_input_and_mask(inpaint_mask_blur)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\process_params.py", line 45, in get_input_and_mask
    mask = Image.open(self.output_mask_gallery[self.output_chosen_mask + 3]['name']).convert('L')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Error running process: C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
Traceback (most recent call last):
  File "C:\Stable_Diffusion\stable-diffusion-webui\modules\scripts.py", line 417, in process
    script.process(p, *script_args)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 984, in process
    self.enabled_units = self.get_enabled_units(p)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 943, in get_enabled_units
    unit = self.parse_remote_call(p, unit, idx)
  File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 795, in parse_remote_call
    unit.enabled = selector(p, "control_net_enabled", unit.enabled, idx, strict=True)
AttributeError: 'bool' object has no attribute 'enabled'


### Additional information

_No response_
4lt3r3go commented 1 year ago

same error here

continue-revolution commented 1 year ago

https://github.com/continue-revolution/sd-webui-segment-anything/issues/93#issuecomment-1546777860

See if this helps. You have probably installed mov2mov extension.

SebSaga commented 1 year ago

Hey has anyone found a fix for this? I tried everything I came across, still not able to use ControlNet in Text2Img even after disabling Segment Anything