lllyasviel / lllyasviel/stable-diffusion-webui-forge

[Bug]: ImportError: cannot import name 'Undefined' from 'pydantic.fields'

Open
#734 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [X] The issue exists after disabling all extensions
- [X] 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
- [X] 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?

Fresh install gives error while starting

ImportError:
cannot import name 'Undefined' from 'pydantic.fields' (E:\StableDiffusion\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)

### Steps to reproduce the problem

Fresh clone of the repo and starting the webui.bat

### What should have happened?

WegUI should start

### What browsers do you use to access the UI ?

_No response_

### Sysinfo

This gives the same error, also when dumping on the commandline

### Console logs

```Shell
stable-diffusion-webui-forge>webui.bat
venv "stable-diffusion-webui-forge\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Launching Web UI with arguments:
Total VRAM 24576 MB, total RAM 32689 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : native
Hint: your device supports --pin-shared-memory for potential speed improvements.
Hint: your device supports --cuda-malloc for potential speed improvements.
Hint: your device supports --cuda-stream for potential speed improvements.
VAE dtype: torch.bfloat16
CUDA Stream Activated: False

------------------------------------------------------------------------------------------------------------------------
launch.py 51
main()

launch.py 47 main
start()

launch_utils.py 541 start
import webui

webui.py 19
initialize.imports()

initialize.py 35 imports
import gradio # noqa: F401

__init__.py 3
import gradio.components as components

__init__.py 1
from gradio.components.annotated_image import AnnotatedImage

annotated_image.py 13
from gradio.components.base import IOComponent, _Keywords

base.py 20
from fastapi import UploadFile

__init__.py 7
from .applications import FastAPI as FastAPI

applications.py 15
from fastapi import routing

routing.py 22
from fastapi import params

params.py 4
from pydantic.fields import FieldInfo, Undefined

ImportError:
cannot import name 'Undefined' from 'pydantic.fields' (stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)
```

### Additional information

GPU drivers are up up to date

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with webui.bat and read the import chain through launch.py, launch_utils.py, webui.py, initialize.py, and the FastAPI traceback. Check the installed FastAPI and Pydantic versions involved in the failing import. Done means a fresh installation can start the web UI without the Undefined import error.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.