-
Notifications
You must be signed in to change notification settings - Fork 448
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]: cannot import name 'Undefined' from 'pydantic.fields' (stable-diffusion-webui-forge\venv\lib\site-packages\pydantic\fields.py) #717
Comments
+1 I tried to install using stability matrix in the same way and in the usual way, and everything happened the same way with the same error Python:3.10.6 |
+1 Fresh install and got the same error on Win 11 (RTX 2080 Super). However I managed to get it going with this workaround:
This answer gave me the hint to downgrade pydantic to V1.x and although it threw a dependency warning, it worked afterwards.
|
This is an issue with You can fix it by going to the |
Can confirm the issue is there but @kamelohr's fix worked. Added |
+1 same issue. Trying @kamelohr's fix, but doesn't seem to be working. Python 3.10 or 3.11? I have ubuntu 24.04 fresh install, so the system python is 3.12. Using pyenv. |
@Vidyut You might also try to install fastapi==0.111.0 as @mariodian wrote. I had Python 3.10 working on my system level but don't know what version that pyenv had (I'm at another machine atm). |
Thanks. Amazing. It's working now. Fingers crossed. |
@kamelohr method doesn't work for me but @mariodian method works for me. I just manually run |
Both possible solutions do not work for me...
Some clarification - i'm starting forge via a start-script. Here's the relevant code:
|
Checklist
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: 29be1da
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: 29be1da
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: 29be1da
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: 29be1da
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
Additional information
No response
The text was updated successfully, but these errors were encountered: