sd-webui-segment-anything icon indicating copy to clipboard operation
sd-webui-segment-anything copied to clipboard

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

Open robbiep opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

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

  • [X] I have updated WebUI and this extension to the most up-to-date version

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

  • [X] My problem is not about installing GroundingDINO

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

  • [X] I have updated ControlNet extension and enabled "Allow other script to control this extension"

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_

robbiep avatar May 18 '23 13:05 robbiep

same error here

4lt3r3go avatar May 19 '23 10:05 4lt3r3go

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

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

continue-revolution avatar May 19 '23 10:05 continue-revolution

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

SebSaga avatar Jun 02 '23 08:06 SebSaga