continue-revolution/sd-webui-segment-anything

[Bug]: AttributeError: 'NoneType' object has no attribute 'mode'

Enchanted-vwr opened this issue · 1 comments

Is there an existing issue for this?

  • 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 latest version?

  • I have 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?

  • My problem is not about installing GroundingDINO

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

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

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?

  • My problem is not about such issue, otherwise I have tried changing the extension directory name from sd-webui-segment-anything to a1111-sd-webui-segment-anything

What happened?

文生图报错

Steps to reproduce the problem

  1. 预览,并勾选“Copy to Inpaint Upload & img2img ControlNet Inpainting”
  2. 发送到重绘蒙版
  3. 填写prompt并生成图片

What should have happened?

正常执行

Commit where the problem happens

webui: 1.9.3
extension: control net:1.1.448 python:3.10.11

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No

Console logs

Traceback (most recent call last):
      File "D:\SD\sd-webui-aki-v4.8\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "D:\SD\sd-webui-aki-v4.8\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "D:\SD\sd-webui-aki-v4.8\modules\img2img.py", line 232, in img2img
        processed = process_images(p)
      File "D:\SD\sd-webui-aki-v4.8\modules\processing.py", line 845, in process_images
        res = process_images_inner(p)
      File "D:\SD\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 59, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "D:\SD\sd-webui-aki-v4.8\modules\processing.py", line 915, in process_images_inner
        p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
      File "D:\SD\sd-webui-aki-v4.8\modules\processing.py", line 1652, in init
        image = images.flatten(img, opts.img2img_background_color)
      File "D:\SD\sd-webui-aki-v4.8\modules\images.py", line 835, in flatten
        if img.mode == "RGBA":
    AttributeError: 'NoneType' object has no attribute 'mode'

Additional information

尝试更改过文件名,在文件头加上“a1111-”,依旧报错。关闭所有扩展,仅保留control net和segment anything,也报错。已开启设置中“允许其他脚本控制此扩展”的选项,总之过去issue中相同问题的解决办法都试过了,依旧不行。

同样问题,确认以上步骤可以复现。疑似生成的mask和原图没有传到inpaint upload,可能是版本更新导致的。可以确认mask可以正常传值。出问题的仅是图片传值部分。
Confirmed the above steps can reproduce the same issue. It seems that the generated mask and the original image were not copied to inpaint upload, possibly due to a version update.

SD-webui ver.1.9.3
sd-webui-segment-anything ver.982138cf