stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: fastapi needs to be updated

Open Rabcor opened this issue 1 year ago • 2 comments

Checklist

  • [X] The issue exists after disabling all extensions
  • [X] 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
  • [X] The issue exists in the current version of the webui
  • [X] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

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.

Rabcor avatar Apr 30 '24 08:04 Rabcor

Thank you! This problem confused me a lot.

shimada-hanzo avatar May 04 '24 19:05 shimada-hanzo

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

Rabcor avatar May 04 '24 20:05 Rabcor