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

cannot import name 'Undefined' from 'pydantic.fields' Error #671

Open
afk22 opened this issue Apr 17, 2024 · 2 comments
Open

cannot import name 'Undefined' from 'pydantic.fields' Error #671

afk22 opened this issue Apr 17, 2024 · 2 comments

Comments

@afk22
Copy link

afk22 commented Apr 17, 2024

I can use stable diffusion without any problems. However, whenever I try to install ControlNet, I encounter the error below and can't use the program. I've reinstalled the program from scratch, but it didn't fix the issue. I tried "pip install --upgrade pip" but it didn't work either. Most of the solutions I found online didn't help.

File "C:\Users\AFK\Downloads\sd.webui\system\python\lib\site-packages\fastapi\params.py", line 4, in
from pydantic.fields import FieldInfo, Undefined
ImportError: cannot import name 'Undefined' from 'pydantic.fields' (C:\Users\AFK\Downloads\sd.webui\system\python\lib\site-packages\pydantic\fields.py)
Press any key to continue . . .

@carlosjandro
Copy link

Hi @afk22! I had the same problem and someone awesome helps me with this in a Discord group, it works!!!

  1. First of all you need to have pip installed.
  2. Open and explorer window and go to the folder of your SD ...\stable-diffusion-webui\venv\Scripts
  3. Type "CMD" in the address bar.
  4. Write in the console: activate
  5. Write: cd.. two times to arrive at your stable-diffusion-webui directory
  6. Write: pip install -r requirements.txt

And that´s all! I hope it works :)

@afk22
Copy link
Author

afk22 commented Apr 20, 2024

Hi @carlosjandro , thank you for the solution. It worked perfectly!

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

2 participants