Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AttributeError: 'NoneType' object has no attribute '_id' #2136

Closed
1 task
iurysouzatx opened this issue Sep 20, 2023 · 11 comments
Closed
1 task

[Bug]: AttributeError: 'NoneType' object has no attribute '_id' #2136

iurysouzatx opened this issue Sep 20, 2023 · 11 comments

Comments

@iurysouzatx
Copy link

iurysouzatx commented Sep 20, 2023

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

What happened?

Can't even launch the WebUI when ControlNet is installed.
I updated the ControlNet and that's it.

Steps to reproduce the problem

Just open the WebUI

What should have happened?

The WebUI started normally.

Commit where the problem happens

webui: 5ef669de080814067961f28357256e8fe27544f4
controlnet: e67e017

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--xformers

List of enabled extensions

Pixel Art

Console logs

*** Error calling: E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py/ui
    Traceback (most recent call last):
      File "E:\AI\SD\webui\modules\scripts.py", line 402, in wrap_call
        return func(*args, **kwargs)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 288, in ui
        group, state = self.uigroup(f"ControlNet-{i}", is_img2img, elem_id_tabname)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 268, in uigroup
        group.register_callbacks(is_img2img)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 820, in register_callbacks
        self.preset_panel.register_callbacks(
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\preset.py", line 172, in register_callbacks
        getattr(element, action)(
      File "E:\AI\SD\system\python\lib\site-packages\gradio\events.py", line 140, in __call__
        dep, dep_index = self.trigger.set_event_trigger(
      File "E:\AI\SD\system\python\lib\site-packages\gradio\blocks.py", line 286, in set_event_trigger
        "inputs": [block._id for block in inputs],
      File "E:\AI\SD\system\python\lib\site-packages\gradio\blocks.py", line 286, in <listcomp>
        "inputs": [block._id for block in inputs],
    AttributeError: 'NoneType' object has no attribute '_id'

---
*** Error calling: E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py/ui
    Traceback (most recent call last):
      File "E:\AI\SD\webui\modules\scripts.py", line 402, in wrap_call
        return func(*args, **kwargs)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 288, in ui
        group, state = self.uigroup(f"ControlNet-{i}", is_img2img, elem_id_tabname)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 268, in uigroup
        group.register_callbacks(is_img2img)
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 820, in register_callbacks
        self.preset_panel.register_callbacks(
      File "E:\AI\SD\webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\preset.py", line 172, in register_callbacks
        getattr(element, action)(
      File "E:\AI\SD\system\python\lib\site-packages\gradio\events.py", line 140, in __call__
        dep, dep_index = self.trigger.set_event_trigger(
      File "E:\AI\SD\system\python\lib\site-packages\gradio\blocks.py", line 286, in set_event_trigger
        "inputs": [block._id for block in inputs],
      File "E:\AI\SD\system\python\lib\site-packages\gradio\blocks.py", line 286, in <listcomp>
        "inputs": [block._id for block in inputs],
    AttributeError: 'NoneType' object has no attribute '_id'

---

Additional information

No response

@Guillaume-Fgt
Copy link
Contributor

in your stable-diffusion-webui\extensions\sd-webui-controlnet folder, do you have a presets folder? Is it empty? If not, try to delete this folder and reload the webui.

@iurysouzatx
Copy link
Author

in your stable-diffusion-webui\extensions\sd-webui-controlnet folder, do you have a presets folder? Is it empty? If not, try to delete this folder and reload the webui.

Nothing on presets folder because I removed controlnet and tried to reinstall again, same problem.

@PeterTF656
Copy link

same issue here

@iurysouzatx
Copy link
Author

I don't know what caused this, but a new fresh install of SD got it to work again :/

@PeterTF656
Copy link

I don't know what caused this, but a new fresh install of SD got it to work again :/

I tried a lot of fixes, but none worked. Finally I had to reinstall as well. Took me half a day... But I can make my waifus again now, so overall not bad...

@Munichschntz
Copy link

Delete your ui-config.json and config.json files.

AUTO1111 will complain the files don't exist on starting the server; don't worry, it's just a warning. You can recreate them by going to Settings and clicking "Apply settings"

Hopefully this saves others from having to completely rebuild their install.

@CurtisDS
Copy link

CurtisDS commented Nov 2, 2023

For me it was the "txt2img/img2img UI item order" setting (Settings > User Interface). If you have changed it at all this extension throws all those errors on start up. Very annoying as I like having Scripts at the top of my UI.

@CurtisDS
Copy link

@huchenlei This issue is still happening on the latest commit if I alter the order of the UI. You marked this as closed, Was it supposed to have been fixed?

@huchenlei
Copy link
Collaborator

huchenlei commented Nov 15, 2023

Please follow instructions in this comment:
#2136 (comment)

@CurtisDS
Copy link

CurtisDS commented Nov 15, 2023

That doesn't fix the issue. See #2136 (comment)
As soon as I change the UI order back to the way I like it (using the built in setting of Automatic1111) the error occurs again.

It appears that Control Net is assuming the UI will have a specific structure but because the order of the UI was changed it leads to the gradio error. I don't mean to be pushy but this is a repeatable and narrow issue with the extension where it does not support a built in setting of Automatic1111 so I think this issue is deserving of a proper fix.

@YuLinkun
Copy link

I print the list inputs, and found one of the list is empty, so I repair it by change [block._id for block in inputs] to [block._id for block in inputs if block is not None]. It works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants