continue-revolution / sd-webui-segment-anything

Segment Anything for Stable Diffusion WebUI
3.39k stars 205 forks source link

[Bug]: An error occurs when autosam is used with controlnet #123

Closed BanXia-Ww closed 1 year ago

BanXia-Ww commented 1 year ago

Is there an existing issue for this?

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

Do you understand that you should read the 1st item of https://github.com/continue-revolution/sd-webui-segment-anything#faq if you cannot install GroundingDINO?

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

Do you understand that you should read the 2nd item of https://github.com/continue-revolution/sd-webui-segment-anything#faq if you observe problems like AttributeError bool object has no attribute enabled and TypeError bool object is not subscriptable?

What happened?

image An error occurs when autosam is used with controlnet There is no throne when using controlnet normally

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

Normal output picture

Commit where the problem happens

webui: extension:

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

no

Console logs

Start semantic segmentation with processor seg_ofade20k
Pixel Perfect Mode (written by lllyasviel) Enabled.
resize_mode = 1
raw_H = 768
raw_W = 512
target_H = 768
target_W = 512
estimation = 512.0
preprocessor resolution = 512
Generating semantic segmentation without SAM
Loading config D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\extensions\sd-webui-controlnet\annotator\oneformer\configs/ade20k/oneformer_swin_large_IN21k_384_bs16_160k.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content.
Loading config D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\extensions\sd-webui-controlnet\annotator\oneformer\configs/ade20k\Base-ADE20K-UnifiedSegmentation.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content.
Generating semantic segmentation with SAM
Auto SAM strengthening semantic segmentation
Auto SAM generated 83 masks
Auto SAM strengthen process end
Traceback (most recent call last):
  File "D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\python\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\python\lib\site-packages\gradio\blocks.py", line 1326, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\python\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\python\lib\site-packages\gradio\components.py", line 4457, in postprocess
    file = self.img_array_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
  File "D:\Stable_diffusion\sd-webui-aki\sd-webui-aki-v4.1\python\lib\site-packages\gradio\components.py", line 355, in img_array_to_temp_file
    return self.pil_to_temp_file(pil_image, dir, format="png")
TypeError: save_pil_to_file() got an unexpected keyword argument 'format'

Additional information

No response

continue-revolution commented 1 year ago

https://github.com/opparco/stable-diffusion-webui-two-shot/issues/54#issuecomment-1585055946