AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: RuntimeError: Model config for ViT-bigG-14 not found. #13209

Closed ahsan-malik closed 12 months ago

ahsan-malik commented 1 year ago

Is there an existing issue for this?

What happened?

I'm using it as api and testing it on postman Models based on SD1.5 works well, but when I use SDXL based models then it give me the error. But on webui all the models(sd1.5 & sdxl) are working.

Steps to reproduce the problem

just select SDXL based model and make api call

What should have happened?

It should load SDXL based models without any problem as it load SD 1.5 based models

Sysinfo

I'm running to runpod with RTX 4060 Gpu

What browsers do you use to access the UI ?

Google Chrome

Console logs

File "/usr/lib/python3.10/threading.py", line 973, in _bootstrap
2023-09-06T11:02:02.306467009Z     self._bootstrap_inner()
2023-09-06T11:02:02.306470319Z   File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
2023-09-06T11:02:02.306473279Z     self.run()
2023-09-06T11:02:02.306476359Z   File "/usr/lib/python3.10/threading.py", line 953, in run
2023-09-06T11:02:02.306487290Z     self._target(*self._args, **self._kwargs)
2023-09-06T11:02:02.306491380Z   File "/runpod-volume/sd/stable-diffusion-webui/modules/initialize.py", line 147, in load_model
2023-09-06T11:02:02.306494550Z     shared.sd_model  # noqa: B018
2023-09-06T11:02:02.306497620Z   File "/runpod-volume/sd/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
2023-09-06T11:02:02.306509550Z     return modules.sd_models.model_data.get_sd_model()
2023-09-06T11:02:02.306513370Z   File "/runpod-volume/sd/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
2023-09-06T11:02:02.306517380Z     load_model()
2023-09-06T11:02:02.306521140Z   File "/runpod-volume/sd/stable-diffusion-webui/modules/sd_models.py", line 602, in load_model
2023-09-06T11:02:02.306525111Z     sd_model = instantiate_from_config(sd_config.model)
2023-09-06T11:02:02.306529001Z   File "/workspace/sd/stablediffusion/ldm/util.py", line 79, in instantiate_from_config
2023-09-06T11:02:02.306532741Z     return get_obj_from_str(config["target"])(**config.get("params", dict()))
2023-09-06T11:02:02.306535991Z   File "/workspace/sd/stablediffusion/generative-models/sgm/models/diffusion.py", line 61, in __init__
2023-09-06T11:02:02.306539501Z     self.conditioner = instantiate_from_config(
2023-09-06T11:02:02.306542081Z   File "/workspace/sd/stablediffusion/generative-models/sgm/util.py", line 175, in instantiate_from_config
2023-09-06T11:02:02.306545251Z     return get_obj_from_str(config["target"])(**config.get("params", dict()))
2023-09-06T11:02:02.306549721Z   File "/workspace/sd/stablediffusion/generative-models/sgm/modules/encoders/modules.py", line 88, in __init__
2023-09-06T11:02:02.306554411Z     embedder = instantiate_from_config(embconfig)
2023-09-06T11:02:02.306558331Z   File "/workspace/sd/stablediffusion/generative-models/sgm/util.py", line 175, in instantiate_from_config
2023-09-06T11:02:02.306562401Z     return get_obj_from_str(config["target"])(**config.get("params", dict()))
2023-09-06T11:02:02.306565702Z   File "/workspace/sd/stablediffusion/generative-models/sgm/modules/encoders/modules.py", line 428, in __init__
2023-09-06T11:02:02.306569482Z     model, _, _ = open_clip.create_model_and_transforms(
2023-09-06T11:02:02.306573402Z   File "/runpod-volume/sd/stable-diffusion-webui/modules/sd_disable_initialization.py", line 65, in create_model_and_transforms_without_pretrained
2023-09-06T11:02:02.306578842Z     return self.create_model_and_transforms(*args, pretrained=None, **kwargs)
2023-09-06T11:02:02.306583102Z   File "/usr/local/lib/python3.10/dist-packages/open_clip/factory.py", line 201, in create_model_and_transforms
2023-09-06T11:02:02.306587282Z     model = create_model(
2023-09-06T11:02:02.306590822Z   File "/usr/local/lib/python3.10/dist-packages/open_clip/factory.py", line 131, in create_model
2023-09-06T11:02:02.306596222Z     raise RuntimeError(f'Model config for {model_name} not found.')
2023-09-06T11:02:02.306600312Z RuntimeError: Model config for ViT-bigG-14 not found.

"ERROR:root:Model config for ViT-bigG-14 not found; available models ['mt5-base-ViT-B-32', 'mt5-xl-ViT-H-14', 'RN50', 'RN50-quickgelu', 'RN50x4', 'RN50x16', 'RN50x64', 'RN101', 'RN101-quickgelu', 'roberta-ViT-B-32', 'timm-convnext_base', 'timm-convnext_large', 'timm-convnext_xlarge', 'timm-efficientnetv2_rw_s', 'timm-resnetaa50d', 'timm-swin_base_patch4_window7_224', 'timm-vit_medium_patch16_gap_256', 'timm-vit_relpos_medium_patch16_cls_224', 'ViT-B-16', 'ViT-B-16-plus', 'ViT-B-16-plus-240', 'ViT-B-32', 'ViT-B-32-plus-256', 'ViT-B-32-quickgelu', 'ViT-e-14', 'ViT-G-14', 'ViT-g-14', 'ViT-H-14', 'ViT-H-16', 'ViT-L-14', 'ViT-L-14-280', 'ViT-L-14-336', 'ViT-L-16', 'ViT-L-16-320', 'ViT-M-16', 'ViT-M-16-alt', 'ViT-M-32', 'ViT-M-32-alt', 'ViT-S-16', 'ViT-S-16-alt', 'ViT-S-32', 'ViT-S-32-alt', 'xlm-roberta-base-ViT-B-32', 'xlm-roberta-large-ViT-H-14']."

Additional information

No response

SmokyBot commented 1 year ago

@ahsan-malik, quick fix for your local is to add

RUN pip install open-clip-torch==2.20.0

to services/AUTOMATIC1111/Dockerfile before the line that says "COPY . /docker" image

adamflorizone commented 1 year ago

The fix by @SmokyBot worked for https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/615