Repository: stable-diffusion-webui
Issue: [Bug]: "AttributeError: __config__" in "sagemaker studio lab"
Labels: asking-for-help-with-local-system-issues

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

![스크린샷(146)](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/142673517/813ccbf1-6eee-47ee-af22-3bd13b9846f0)

The bug shown in the picture occurred while installing stable diffusion with sagemaker studio lab.

### Steps to reproduce the problem

1. use this notebook https://gist.github.com/ShMcK/d14d90abea1437fdc9cfe8ecda864b06

2. run the whole process

3. Execute all processes except "Run: Launch web ui"

4.
![스크린샷(149)](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/142673517/78ad2618-5075-468d-bd10-04df53a0d7db)
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 <module>
    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 <module>
    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

```Shell
#!/bin/bash
#########################################################
# Uncomment and change the variables below to your need:#
#########################################################

# Install directory without trailing slash
#install_dir="/home/$(whoami)"

# Name of the subdirectory
#clone_dir="stable-diffusion-webui"

# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
#export COMMANDLINE_ARGS=""

# python3 executable
#python_cmd="python3"

# git executable
#export GIT="git"

# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
#venv_dir="venv"

# script to launch to start the app
#export LAUNCH_SCRIPT="launch.py"

# install command for torch
#export TORCH_COMMAND="pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"

# Requirements file to use for stable-diffusion-webui
#export REQS_FILE="requirements_versions.txt"

# Fixed git repos
#export K_DIFFUSION_PACKAGE=""
#export GFPGAN_PACKAGE=""

# Fixed git commits
#export STABLE_DIFFUSION_COMMIT_HASH=""
#export CODEFORMER_COMMIT_HASH=""
#export BLIP_COMMIT_HASH=""

# Uncomment to enable accelerated launch
#export ACCELERATE="True"

# Uncomment to disable TCMalloc
#export NO_TCMALLOC="True"

###########################################
```


### List of extensions

no

### Console logs

```Shell
Saving ngrok auth token to ~/.ngrok_token
/home/studio-lab-user/SageMaker/stable-diffusion-webui
Python 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03) 
[GCC 11.3.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Launching Web UI with arguments: --xformers --disable-console-progressbars --gradio-debug --gradio-auth 1:2 --ngrok xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ngrok authtoken detected, trying to connect...
ngrok connected to localhost:7860! URL: https://65b8-3-135-152-169.ngrok-free.app
You can use this link after the launch is complete.
Checkpoint  not found; loading fallback v1-5-pruned-emaonly.safetensors [6ce0161689]
Loading weights [6ce0161689] from /home/studio-lab-user/SageMaker/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Traceback (most recent call last):
  File "/home/studio-lab-user/SageMaker/stable-diffusion-webui/launch.py", line 39, in <module>
    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 <module>
    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).
```


### 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