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]: ControlNet breaks my WebUI #15556

Closed
4 of 6 tasks
KingsmanZer0 opened this issue Apr 17, 2024 · 10 comments
Closed
4 of 6 tasks

[Bug]: ControlNet breaks my WebUI #15556

KingsmanZer0 opened this issue Apr 17, 2024 · 10 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@KingsmanZer0
Copy link

KingsmanZer0 commented Apr 17, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

After installing controlnet, geting: Failed install handrefineportable error.
https://github.com/Mikubill/sd-webui-controlnet
then on reboot the server/webui gets

Launching Web UI with arguments: --autolaunch --xformers
Traceback (most recent call last):
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\launch.py", line 48, in
main()
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\launch.py", line 44, in main
start()
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\modules\launch_utils.py", line 465, in start
import webui
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\webui.py", line 13, in
initialize.imports()
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\modules\initialize.py", line 23, in imports
import gradio # noqa: F401
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio_init_.py", line 3, in
import gradio.components as components
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components_init_.py", line 1, in
from gradio.components.annotated_image import AnnotatedImage
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in
from gradio.components.base import IOComponent, Keywords
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components\base.py", line 20, in
from fastapi import UploadFile
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi_init
.py", line 7, in
from .applications import FastAPI as FastAPI
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\applications.py", line 15, in
from fastapi import routing
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\routing.py", line 22, in
from fastapi import params
File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\params.py", line 4, in
from pydantic.fields import FieldInfo, Undefined
ImportError: cannot import name 'Undefined' from 'pydantic.fields' (C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\pydantic\fields.py)

Steps to reproduce the problem

installed fresh a1111 version 1.9
installed controlnet extension thru the webui
get: Failed install handrefineportable error.
rebooted server/webui
webui stops working and get

What should have happened?

should NOT get handrefineportable error during controlnet install
and webui should boot up without errors

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

webui does not boot

Console logs

venv "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\Scripts\Python.exe"
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.8.0-RC
Commit hash: <none>
Launching Web UI with arguments: --autolaunch --xformers
Traceback (most recent call last):
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\launch.py", line 48, in <module>
    main()
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\launch.py", line 44, in main
    start()
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\modules\launch_utils.py", line 465, in start
    import webui
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\webui.py", line 13, in <module>
    initialize.imports()
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\modules\initialize.py", line 23, in imports
    import gradio  # noqa: F401
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\gradio\components\base.py", line 20, in <module>
    from fastapi import UploadFile
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\applications.py", line 15, in <module>
    from fastapi import routing
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\routing.py", line 22, in <module>
    from fastapi import params
  File "C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\fastapi\params.py", line 4, in <module>
    from pydantic.fields import FieldInfo, Undefined
ImportError: cannot import name 'Undefined' from 'pydantic.fields' (C:\StableDiffusion\stable-diffusion-webui-1.8.0\venv\lib\site-packages\pydantic\fields.py)
Press any key to continue . . .

Additional information

Someone else reported same issue on Controlnet repo but author said to report problem to A1111 as they have not changed anything new
https://github.com/Mikubill/sd-webui-controlnet/issues/2757

@KingsmanZer0 KingsmanZer0 added the bug-report Report of a bug, yet to be confirmed label Apr 17, 2024
@ssplashh
Copy link

I am having a similar issue: ImportError: cannot import name 'Undefined' from 'pydantic.fields' (C:\Users\palom\sdwebui\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\pydantic\fields.py)

@KingsmanZer0
Copy link
Author

I am having a similar issue: ImportError: cannot import name 'Undefined' from 'pydantic.fields' (C:\Users\palom\sdwebui\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\pydantic\fields.py)

actually there was already a thread about this, someone found a temporary fix i tried it and it worked. here is the link
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/15551

@NZperegrine
Copy link

NZperegrine commented Apr 18, 2024

Was having this error, what worked; , renamed extension folder, deleted venv folder, reinstalled and going again.
Borked again, does it with CN and Deforum

@lastYoueven
Copy link

Some lib is not download/install it`s seem like, last month i got some issue;

@ucandoit74
Copy link

I also had the same problem. How do I solve this?

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 18, 2024

downgrading pydantic to 1.10.15 and albumentations to 1.4.3

the can be done by running a pip command in the webui's python environment

from the webui root the following commands
if using powershell on windwos

.\venv\Scripts\Activate.ps1
pip install albumentations==1.4.3
pip install pydantic==1.10.15

if using cmd on windows

venv\Scripts\activate
pip install albumentations==1.4.3
pip install pydantic==1.10.15

if using linux

source venv/bin/activate
pip install albumentations==1.4.3
pip install pydantic==1.10.15

@ssplashh
Copy link

I solved it by reinstalling Automatic1111 again with Windows :)

@lucia520
Copy link

Hello, I just solved the problem. It seems that the issue might be due to the version incompatibility between the Pydantic version used and the version referenced in the code where "Undefined" is being used.

To address this issue, I tried resetting the virtual environment. You can manually delete the venv folder in the directory and then create a new venv folder in the same directory. Then activate the virtual environment:

venv\Scripts\activate

After activation, restart webui-user.bat and wait for the new dependencies to be installed. Then, downgrade Pydantic to the version 1.10.15:

pip install pydantic==1.10.15

After that, run webui-user.bat again, and everything should work fine.

I hope this helps everyone.

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 18, 2024

notice
there is a update to the command that you need to run
#15556 (comment)

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

7 participants