Open overchoke2128 opened 1 year ago
You're using a version of Pydantic that's not supported by the webui. I believe it gets installed as a dependency of fastapi
.
You probably want to try installing the requirements from requirements_versions.txt
rather than requirements.txt
. The one without requirements really only applies to Google Colab to my knowledge.
I also encountered the same problem. I guess it was caused by the pydantic's version, but I don't know which version to use or what to solve it.this has't pydantic version config at requirements_versions.txt
To clarify somewhat:
This is caused by upgrading the pydantic version to 2.x.
To fix this, the generate_model method in modules/api/models.py needs to be updated according to the migration document I linked above.
Is there an existing issue for this?
What happened?
The bug shown in the picture occurred while installing stable diffusion with sagemaker studio lab.
Steps to reproduce the problem
use this notebook https://gist.github.com/ShMcK/d14d90abea1437fdc9cfe8ecda864b06
run the whole process
Execute all processes except "Run: Launch web ui"
Add "--xformers"
5.fix error need to change to "from pytorch_lightning.utilities.rank_zero"
6.Pray to all the gods in the world and execute "Run: Launch web ui"
7.Traceback (most recent call last): File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/launch.py", line 39, in
main()
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/launch.py", line 35, in main
start()
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/launch_utils.py", line 394, in start
webui.webui()
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/webui.py", line 393, in webui
shared.demo = modules.ui.create_ui()
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/ui.py", line 504, in create_ui
modules.scripts.scripts_txt2img.setup_ui_for_section(category)
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/scripts.py", line 433, in setup_ui_for_section
self.create_script_ui(script)
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/scripts.py", line 383, in create_script_ui
import modules.api.models as api_models
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/api/models.py", line 101, in
StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/modules/api/models.py", line 97, in generate_model
DynamicModel.config.allow_population_by_field_name = True
File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 210, in getattr
raise AttributeError(item)
AttributeError: config
Creating model from config: /home/studio-lab-user/SageMaker/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying attention optimization: xformers... done.
Model loaded in 4.1s (load weights from disk: 0.3s, create model: 1.2s, apply weights to model: 1.3s, apply half(): 0.6s, move model to device: 0.6s).
What should have happened?
A URL that allows you to run "stable diffusion" appears.
Something like "ngork error:3200,3004" does not appear and the webui works fine.
Version or Commit where the problem happens
https://gist.github.com/ShMcK/d14d90abea1437fdc9cfe8ecda864b06
What Python version are you running on ?
Python 3.9.x (below, no recommended)
What platforms do you use to access the UI ?
Other/Cloud
What device are you running WebUI on?
Other GPUs
Cross attention optimization
xformers
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
List of extensions
no
Console logs
Additional information
I hope this can be resolved... To solve this error, it is the 12th day to ask many large sites in Korea, fix it, and fail. Seniors, please, I beg you very earnestly. . . .please save me