LykosAI / StabilityMatrix

Multi-Platform Package Manager for Stable Diffusion
https://lykos.ai
GNU Affero General Public License v3.0
3.47k stars 229 forks source link

Forge UI not working #602

Closed Salamala893 closed 1 week ago

Salamala893 commented 3 months ago

ImportError: cannot import name 'Undefined' from 'pydantic.fields'

I also have installed Fooocus, Automatic1111 and ComfyUI

SkGirlUru commented 3 months ago

same problem

dhstsw commented 3 months ago

Same. Complete starting logs:

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 Installing clip Cloning assets into H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\stable-diffusion-webui-assets... Cloning into 'H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\stable-diffusion-webui-assets'... Cloning Stable Diffusion into H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\stable-diffusion-stability-ai... Cloning into 'H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\stable-diffusion-stability-ai'... Cloning Stable Diffusion XL into H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\generative-models... Cloning into 'H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\generative-models'... Cloning K-diffusion into H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\k-diffusion... Cloning into 'H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\k-diffusion'... Cloning BLIP into H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\BLIP... Cloning into 'H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\repositories\BLIP'... H:\SM\SMData\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 Installing forge_legacy_preprocessor requirement: fvcore Installing forge_legacy_preprocessor requirement: mediapipe Installing forge_legacy_preprocessor requirement: onnxruntime Installing forge_legacy_preprocessor requirement: svglib Installing forge_legacy_preprocessor requirement: insightface Installing forge_legacy_preprocessor requirement: handrefinerportable Installing forge_legacy_preprocessor requirement: depth_anything H:\SM\SMData\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 H:\SM\SMData\Images Total VRAM 16376 MB, total RAM 32644 MB Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 : 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 Traceback (most recent call last): File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\launch.py", line 51, in main() File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\launch.py", line 47, in main start() File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\modules\launch_utils.py", line 541, in start import webui File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\webui.py", line 19, in initialize.imports() File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\modules\initialize.py", line 35, in imports import gradio # noqa: F401 File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio__init.py", line 3, in import gradio.components as components File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components__init__.py", line 1, in from gradio.components.annotated_image import AnnotatedImage File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in from gradio.components.base import IOComponent, _Keywords File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\base.py", line 20, in from fastapi import UploadFile File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\fastapi\init__.py", line 7, in from .applications import FastAPI as FastAPI File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\fastapi\applications.py", line 15, in from fastapi import routing File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\fastapi\routing.py", line 22, in from fastapi import params File "H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\fastapi\params.py", line 4, in from pydantic.fields import FieldInfo, Undefined ImportError: cannot import name 'Undefined' from 'pydantic.fields' (H:\SM\SMData\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\pydantic\fields.py)

ionite34 commented 3 months ago

Seems to caused by one of their upstream dependencies breaking it by updating pydantic to a version that's too new https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/674

Easiest way to fix is probably by adding a strict version requirement for pydantic in their requirements txt file (since the install and update is done at runtime by them after our initial install)

But if Forge upstream doesn't issue a fix soon we can look to do a file edit when installing to fix it on our end for now.

vova2698 commented 2 months ago

If the problem is still here change the pydantic version from 2.7.1 to 2.7 in python packages Снимок экрана 2024-05-20 133425 Снимок экрана 2024-05-20 133510

Koitenshin commented 1 month ago

Issue is still here as of June 10th, 2024 but thanks to vova2698's image instructions, it was easily remedied.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove the stale label or comment, else this will be closed in 5 days.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stale for 5 days with no activity.