sd-webui-controlnet icon indicating copy to clipboard operation
sd-webui-controlnet copied to clipboard

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

Open Hulkhao opened this issue 1 year ago • 23 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

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

Hulkhao avatar Jun 14 '23 05:06 Hulkhao

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

huchenlei avatar Jun 14 '23 12:06 huchenlei

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.

Hulkhao avatar Jun 15 '23 01:06 Hulkhao

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

huchenlei avatar Jun 15 '23 01:06 huchenlei

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.

Hulkhao avatar Jun 15 '23 07:06 Hulkhao

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

vipzero avatar Jun 17 '23 06:06 vipzero

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

rookiexjl avatar Jul 26 '23 06:07 rookiexjl

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

rookiexjl avatar Jul 26 '23 06:07 rookiexjl

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

NovNovikov avatar Aug 09 '23 14:08 NovNovikov

same here...

IPv6 avatar Aug 19 '23 13:08 IPv6

same here

ylkjick532428 avatar Aug 26 '23 20:08 ylkjick532428

same here

cailong1028 avatar Aug 29 '23 06:08 cailong1028

Me too :\

thijsi123 avatar Aug 30 '23 05:08 thijsi123

+1

BasicGearwheel avatar Aug 31 '23 01:08 BasicGearwheel

+1

francoisbonnard avatar Sep 12 '23 10:09 francoisbonnard

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'

Bassquake avatar Sep 13 '23 17:09 Bassquake

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

comzyh avatar Nov 06 '23 18:11 comzyh

why is this closed? there isn't a solution

hubx-ml avatar Dec 18 '23 11:12 hubx-ml

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.

KatsPurr avatar Dec 19 '23 14:12 KatsPurr

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.

GChristensen avatar Jan 08 '24 11:01 GChristensen

什么事

rookiexjl avatar Jan 08 '24 11:01 rookiexjl

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

hansolocambo avatar Jan 19 '24 08:01 hansolocambo

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.

KatsPurr avatar Jan 19 '24 09:01 KatsPurr

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

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

bananaguys avatar Feb 27 '24 17:02 bananaguys