AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
131.68k stars 25.27k forks source link

[Bug]: fastapi needs to be updated #15662

Open Rabcor opened 3 weeks ago

Rabcor commented 3 weeks ago

Checklist

Description

On a fresh install sd-webui installs this combination of packages

fastapi-0.94.0 albumentations-1.4.4 pydantic-2.7.1 (Required by albumentations 1.4.4, incompatible with fastapi-0.94.0)

So when I try to run it i get a pydantic error (ImportError: cannot import name 'Undefined' from 'pydantic.fields'), and reinstalling the same pydantic version gives me this:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
fastapi 0.94.0 requires pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2, but you have pydantic 2.7.1 which is incompatible.

I solved it by updating fastapi to a version that supports pydantic 2.7.1

fastapi version 0.110.3 to be exact.

shimada-hanzo commented 2 weeks ago

Thank you! This problem confused me a lot.

Rabcor commented 2 weeks ago

Thank you! This problem confused me a lot.

Yeah, i had to scratch my head a bit, i first tried installing pydantic 1.8.2 and it 'worked', i could launch the webui and everything, but it broke albumentations (i'm not really sure what it does, but I believe it means I'd have problems generating batches), so i eventually figured to just update fastapi instead of downgrading pydantic was the way to go, since fastapi was recently updated to support pydantic 2.x