lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
5.31k stars 520 forks source link

[Bug]: cannot install new copy of Forge: pydantic #702

Closed rafstahelin closed 1 month ago

rafstahelin commented 2 months ago

Checklist

What happened?

Pydantic error

Steps to reproduce the problem

After you download, you uncompress, use update.bat to update, and use run.bat to run. then run webui-user.bat

What should have happened?

install then start webui

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

2024-05-01 03-12-01

Console logs

Creating venv in directory E:\webui_forge_cu121_torch21\webui\venv using python "C:\Python310\python.exe"
venv "E:\webui_forge_cu121_torch21\webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Collecting torch==2.1.2
  Using cached https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-win_amd64.whl (2473.9 MB)
Collecting torchvision==0.16.2
  Using cached https://download.pytorch.org/whl/cu121/torchvision-0.16.2%2Bcu121-cp310-cp310-win_amd64.whl (5.6 MB)
Collecting filelock
  Using cached filelock-3.14.0-py3-none-any.whl (12 kB)
Collecting fsspec
  Using cached fsspec-2024.3.1-py3-none-any.whl (171 kB)
Collecting networkx
  Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Collecting sympy
  Using cached https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting jinja2
  Using cached https://download.pytorch.org/whl/Jinja2-3.1.3-py3-none-any.whl (133 kB)
Collecting typing-extensions
  Using cached typing_extensions-4.11.0-py3-none-any.whl (34 kB)
Collecting numpy
  Using cached numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
Collecting requests
  Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Collecting pillow!=8.3.*,>=5.3.0
  Using cached pillow-10.3.0-cp310-cp310-win_amd64.whl (2.5 MB)
Collecting MarkupSafe>=2.0
  Using cached https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl (17 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (100 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.7-py3-none-any.whl (66 kB)
Collecting urllib3<3,>=1.21.1
  Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)
Collecting mpmath>=0.19
  Using cached https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, fsspec, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision
Successfully installed MarkupSafe-2.1.5 certifi-2024.2.2 charset-normalizer-3.3.2 filelock-3.14.0 fsspec-2024.3.1 idna-3.7 jinja2-3.1.3 mpmath-1.3.0 networkx-3.3 numpy-1.26.4 pillow-10.3.0 requests-2.31.0 sympy-1.12 torch-2.1.2+cu121 torchvision-0.16.2+cu121 typing-extensions-4.11.0 urllib3-2.2.1

[notice] A new release of pip available: 22.3.1 -> 24.0
[notice] To update, run: E:\webui_forge_cu121_torch21\webui\venv\Scripts\python.exe -m pip install --upgrade pip
Installing clip
Installing open_clip
Installing requirements
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
Launching Web UI with arguments: --ckpt-dir E:\studio Dropbox\studio\ai\libs\SD\1models --lora-dir E:\studio Dropbox\studio\ai\libs\SD\2loras --vae-dir E:\studio Dropbox\studio\ai\libs\SD\7vae --embeddings-dir E:\studio Dropbox\studio\ai\libs\SD\8embeddings
Total VRAM 24563 MB, total RAM 65427 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : 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
The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "E:\webui_forge_cu121_torch21\webui\launch.py", line 51, in <module>
    main()
  File "E:\webui_forge_cu121_torch21\webui\launch.py", line 47, in main
    start()
  File "E:\webui_forge_cu121_torch21\webui\modules\launch_utils.py", line 541, in start
    import webui
  File "E:\webui_forge_cu121_torch21\webui\webui.py", line 19, in <module>
    initialize.imports()
  File "E:\webui_forge_cu121_torch21\webui\modules\initialize.py", line 35, in imports
    import gradio  # noqa: F401
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\gradio\components\base.py", line 20, in <module>
    from fastapi import UploadFile
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\fastapi\__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\fastapi\applications.py", line 15, in <module>
    from fastapi import routing
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\fastapi\routing.py", line 22, in <module>
    from fastapi import params
  File "E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\fastapi\params.py", line 4, in <module>
    from pydantic.fields import FieldInfo, Undefined
ImportError: cannot import name 'Undefined' from 'pydantic.fields' (E:\webui_forge_cu121_torch21\webui\venv\lib\site-packages\pydantic\fields.py)
Press any key to continue . . .


### Additional information

latest NVIDIA Studio Driver. Running on 4090
CasanovaSan commented 2 months ago

having the same issue image

Echostorm44 commented 2 months ago

same here

image

SergeyFilippov commented 2 months ago

It seems installing Insightface module is causing upgrades that are breaking ControlNet and complete WebUI in case of forge. As described here A1111 Issue, it helped me to downgrade two dependencies in my venv (needs to be activated first):

pip install albumentations==1.4.3
pip install pydantic==1.10.15

After that things started working for me.

GuruVirus commented 1 month ago

It seems installing Insightface module is causing upgrades that are breaking ControlNet and complete WebUI in case of forge. As described here A1111 Issue, it helped me to downgrade two dependencies in my venv (needs to be activated first):

pip install albumentations==1.4.3
pip install pydantic==1.10.15

After that things started working for me.

Thanks

Working now