lllyasviel / lllyasviel/stable-diffusion-webui-forge

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

Open
#717 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 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?

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path Data\Images
Total VRAM 6144 MB, total RAM 32620 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : 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' (Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)

### Steps to reproduce the problem

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path Data\Images
Total VRAM 6144 MB, total RAM 32620 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : 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' (Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)

### What should have happened?

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path Data\Images
Total VRAM 6144 MB, total RAM 32620 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : 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' (Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)

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

_No response_

### Sysinfo

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path Data\Images
Total VRAM 6144 MB, total RAM 32620 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : 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' (Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)

### Console logs

```Shell
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Data\Packages\stable-diffusion-webui-forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path Data\Images
Total VRAM 6144 MB, total RAM 32620 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : 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' (Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py)
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with launch_utils.py, webui.py, and initialize.py to trace the startup import chain into FastAPI's params module. Reproduce the Python 3.10.11 installation failure and inspect the installed FastAPI and Pydantic versions involved. Done means the web UI starts without the Undefined import error on a clean installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.