Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
16.96k stars 1.95k forks source link

[Bug]: AttributeError: 'NoneType' object has no attribute 'rsplit' #1639

Open Hulkhao opened 1 year ago

Hulkhao commented 1 year ago

Is there an existing issue for this?

What happened?

01-fs8 02-fs8

Steps to reproduce the problem

  1. start SD
  2. Enable☑️ Congtrolnet, enable☑️ Allow Preview
  3. Upload one picture , Choose a Control Type
  4. click🖱 Run preprocessor report error

Any Control Type reports an error

What should have happened?

show preview

Commit where the problem happens

webui: controlnet:

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

no

List of enabled extensions

03-fs8

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.3.1
Commit hash: b6af0a3809ea869fb180633f9affcae4b199ffcf
Installing requirements

Launching Web UI with arguments: --theme dark --xformers --autolaunch
[AddNet] Updating model hashes...

[AddNet] Updating model hashes...

2023-06-14 13:31:45,598 - ControlNet - INFO - ControlNet v1.1.224
ControlNet preprocessor location: C:\AIGC\sd-webui-aki-v4.1\extensions\sd-webui-controlnet\annotator\downloads
2023-06-14 13:31:45,697 - ControlNet - INFO - ControlNet v1.1.224
Loading weights [e1441589a6] from C:\AIGC\sd-webui-aki-v4.1\models\Stable-diffusion\v1-5-pruned.ckpt
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 7.7s (import torch: 1.9s, import gradio: 1.0s, import ldm: 0.7s, other imports: 0.9s, load scripts: 1.7s, create ui: 0.4s, gradio launch: 0.9s).
Creating model from config: C:\AIGC\sd-webui-aki-v4.1\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying optimization: xformers... done.
Textual inversion embeddings loaded(6): bad-artist, bad-artist-anime, bad-hands-5, bad_prompt, bad_prompt_version2, EasyNegative
Model loaded in 8.0s (load weights from disk: 5.1s, create model: 0.5s, apply weights to model: 0.7s, apply half(): 0.6s, move model to device: 1.1s).
Traceback (most recent call last):
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\routes.py", line 414, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\blocks.py", line 1321, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
  File "C:\AIGC\sd-webui-aki-v4.1\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess
    return preprocess(inputs)
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\components.py", line 1808, in preprocess
    mask_im = processing_utils.decode_base64_to_image(mask)
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\processing_utils.py", line 50, in decode_base64_to_image
    image_encoded = extract_base64_data(encoding)
  File "C:\AIGC\sd-webui-aki-v4.1\python\lib\site-packages\gradio\processing_utils.py", line 41, in extract_base64_data
    return x.rsplit(",", 1)[-1]
AttributeError: 'NoneType' object has no attribute 'rsplit'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

Additional information

win10 x64, nvidia 3060

huchenlei commented 1 year ago

Seems like an SVG related problem. Can you attach the problematic SVG image?

Hulkhao commented 1 year ago

Seems like an SVG related problem. Can you attach the problematic SVG image?

No SVG, it's a PNG image. The same error is reported when using jpg pictures.

huchenlei commented 1 year ago

Can you still share the image? I cannot reproduce the issue.

Hulkhao commented 1 year ago

Can you still share the image? I cannot reproduce the issue.

It's not about the pictures. I found out how to reproduce this error. If you access the SD service from the LAN, no error will be reported. For example "10.0.10.111:7860" If you access the SD service from "127.0.0.1:7860", an error will be reported.

vipzero commented 1 year ago

I too am struggling with this issue. It always works fine the 1st time after rebooting the SD. After 2-5 times it either gets killed or freezes. I can keep generating images continuously for a while by setting Preprocessor to none and setting the image directly, so that's how I'm dealing with it. I have had this problem with Shuffle and Depth.

Tested on Debian 11 (Bullseye)

Launching launch.py...
Using TCMalloc: libtcmalloc.so.4
Python 3.10.11 (main, Apr  5 2023, 14:15:10) [GCC 9.4.0]
Version: v1.3.2
Commit hash: baf6946e06249c5af9851c60171692c44ef633e0
rookiexjl commented 1 year ago

有人解决了吗,我本地点击controlnet 发生尺寸到stable diffusion 不报错 ,局域网访问就报错

rookiexjl commented 1 year ago

AttributeError: 'NoneType' object has no attribute 'rsplit'

NovNovikov commented 1 year ago

Why was this closed? It was never fixed - I am expiriencing the same issue

IPv6 commented 1 year ago

same here...

ylkjick532428 commented 1 year ago

same here

cailong1028 commented 1 year ago

same here

thijsi123 commented 1 year ago

Me too :\

BasicGearwheel commented 1 year ago

+1

francoisbonnard commented 1 year ago

+1

Bassquake commented 1 year ago

I have this same issue when clicking the camera icon to view the camera image from a webcam.

version: [v1.6.0]  •  python: 3.10.6  •  torch: 2.0.1+cu118  •  xformers: N/A  •  gradio: 3.41.2  •  checkpoint: [aadddd3d75]

Traceback (most recent call last):█████████████| 20/20 [00:41<00:00, 2.06s/it] File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\blocks.py", line 1429, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\blocks.py", line 1239, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "C:\AI Metahuman\Software\Automatic1111 webui\webui\extensions\sd-webui-controlnet\scripts\utils.py", line 137, in svg_preprocess return preprocess(inputs) File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\components\image.py", line 290, in preprocess mask_im = processing_utils.decode_base64_to_image(mask) File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\processing_utils.py", line 58, in decode_base64_to_image image_encoded = extract_base64_data(encoding) File "C:\AI Metahuman\Software\Automatic1111 webui\webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in extract_base64_data return x.rsplit(",", 1)[-1] AttributeError: 'NoneType' object has no attribute 'rsplit'

comzyh commented 11 months ago

Seems like some components are sending null mask to the backend predict API. Like this: {"image": "<base64_data>", "mask": null}

hubx-ml commented 10 months ago

why is this closed? there isn't a solution

KatsPurr commented 10 months ago

I seem to have this issue when I've been generating images with ControlNet for a very long time. We're talking hundreds of images. What has helped me is opening a fresh instance of Automatic1111. Restarting webuser-user.bat doesn't seem to be necessary. Just the web UI.

GChristensen commented 9 months ago

This issue is pretty annoying. This happens after I paste a ControlNet image with ctrl+v several times. It seems that it is necessary to press the "Clear" button on the gradio image control to fix this error until the next paste. Somehow a null mask from the control sneaks into the "inputs" at the extension. Please, fix this.

rookiexjl commented 9 months ago

什么事

hansolocambo commented 9 months ago

Still happens all the time. One or two runs of the preprocessor and Automatic1111 has to be restarted :(

KatsPurr commented 9 months ago

This issue is pretty annoying. This happens after I paste a ControlNet image with ctrl+v several times. It seems that it is necessary to press the "Clear" button on the gradio image control to fix this error until the next paste. Somehow a null mask from the control sneaks into the "inputs" at the extension. Please, fix this.

The "clear" button doesn't seem to do anything for me, however your message was still very useful because it enlightened me to the fact that this is a copy paste issue. I also have been simply copy pasting the images in. Now I've stopped doing that and instead "Remove image" from the X and press the "Drop image here or click to upload" and fetch the image from a file instead. It sucks because it forces me to save my reference images as files, but at least ControlNet keeps working perfectly.

Summarized: Copy pasting bad. Fetching an image file good.

bananaguys commented 7 months ago

看起来像是 SVG 相关的问题。您能附上有问题的 SVG 图像吗?

感谢,我的图片是:jpeg,我修改了后缀名为:jpg,重新拖入图片到ControlNet,就好了😆