AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Fails to load some models without a config file (1.6 Mega Model - Photo Realistic) #9143

Closed machado2 closed 1 year ago

machado2 commented 1 year ago

Is there an existing issue for this?

What happened?

When I try to load "1.6 Mega Model - Photo Realistic", it fails with a message in the log. It works with EasyDiffusion and ComfyUI, so I think this should work with webui out of the box.

The author put out a config file now, and with that it works, so its a minor issue now. Since users are used to not need the config files, I think it's worthy of your consideration to look at it

Steps to reproduce the problem

  1. Get the model at https://civitai.com/models/25533 but not the config file. The version I used has the hash b52505d9b7
  2. Try to load the model with webui
  3. It will revert to another model, and an error is written in its log

What should have happened?

It should load the model normally, doing whatever magic it does when I download other models without their config files

Commit where the problem happens

3856ada5cc9ac4124e20ff311ce7aa77330845d9

What platforms do you use to access the UI ?

No response

What browsers do you use to access the UI ?

No response

Command Line Arguments

--autolaunch --medvram --xformers

List of extensions

The activated extensions are pretty common

auto1111extensions

03/02/2023 10:25

ABG_extension 17/02/2023 00:45 animator_extension 10/02/2023 07:33 auto-sd-paint-ext 22/02/2023 11:22 auto1111-improved-prompt-matrix 28/03/2023 23:11 clip-interrogator-ext 10/02/2023 22:30 Config-Presets 25/01/2023 12:26 ddetailer 03/02/2023 10:28 deforum-for-automatic1111-webui 03/02/2023 10:26 depthmap2mask 25/01/2023 12:25 DreamArtist-sd-webui-extension 03/02/2023 10:26 embedding-inspector 29/03/2023 09:50 0 extensions.txt 17/02/2023 08:40 gif2gif 28/03/2023 23:11 model-keyword 17/01/2023 00:58 multi-subject-render 25/03/2023 12:08 multidiffusion-upscaler-for-automatic1111 02/02/2023 12:42 openOutpaint-webUI-extension 25/01/2023 12:25 PromptGallery-stable-diffusion-webui 25/01/2023 22:24 48 prompt_gallery_name.json 11/01/2023 13:43 0 put extensions here.txt 17/02/2023 00:42 sd-extension-steps-animation 26/02/2023 23:39 sd-extension-system-info 29/03/2023 09:38 sd-webui-additional-networks 17/02/2023 00:32 sd-webui-colorizer 25/03/2023 12:08 sd-webui-controlnet 10/02/2023 07:33 sd-webui-model-converter 25/03/2023 12:08 sd_dreambooth_extension 17/02/2023 00:43 sd_save_intermediate_images 25/01/2023 12:26 shift-attention 25/01/2023 12:28 stable-diffusion-webui-artists-to-study 25/01/2023 12:24 stable-diffusion-webui-daam 28/03/2023 23:11 stable-diffusion-webui-dataset-tag-editor 26/01/2023 12:39 stable-diffusion-webui-images-browser 28/03/2023 23:11 stable-diffusion-webui-images-browser-fork-alulkesh 25/01/2023 13:11 stable-diffusion-webui-inspiration 05/02/2023 23:08 stable-diffusion-webui-instruct-pix2pix 31/01/2023 22:49 stable-diffusion-webui-prompt-travel 21/02/2023 12:54 stable-diffusion-webui-promptgen 25/03/2023 12:08 stable-diffusion-webui-Prompt_Generator 31/01/2023 22:47 stable-diffusion-webui-sonar 31/01/2023 22:49 stable-diffusion-webui-stable-horde 25/01/2023 12:25 stable-diffusion-webui-visualize-cross-attention-extension 21/02/2023 12:54 StylePile 31/01/2023 01:12 ultimate-upscale-for-automatic1111 15/02/2023 13:26 video_loopback_for_webui

Console logs

venv "d:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Commit hash: 3856ada5cc9ac4124e20ff311ce7aa77330845d9
Installing requirements for Web UI

Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Dreambooth revision: da2e40415f1cb63cc4de46d6dc97eb8676c6e30c
SD-WebUI revision: 3856ada5cc9ac4124e20ff311ce7aa77330845d9

Successfully installed accelerate-0.17.1
Successfully installed requests-2.28.2
Successfully installed fastapi-0.90.1 starlette-0.23.1
Successfully installed gitpython-3.1.31
Successfully installed google-auth-oauthlib-0.4.6 tensorboard-data-server-0.6.1
Successfully installed transformers-4.27.2

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
ERROR: Could not find a version that satisfies the requirement xformers==0.0.17.dev476 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16, 0.0.17.dev483, 0.0.17.dev484, 0.0.17.dev486, 0.0.17rc481, 0.0.17rc482, 0.0.17, 0.0.18.dev487, 0.0.18.dev489)
ERROR: No matching distribution found for xformers==0.0.17.dev476

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip

[+] torch version 1.13.1+cu117 installed.
[+] torchvision version 0.14.1+cu117 installed.
[!] xformers version 0.0.16rc425 installed.
[+] accelerate version 0.17.1 installed.
[+] diffusers version 0.14.0 installed.
[+] transformers version 4.27.2 installed.
[+] bitsandbytes version 0.35.4 installed.

#######################################################################################################
#                                       LIBRARY ISSUE DETECTED                                        #
#######################################################################################################
#
# xformers is below the required 0.0.17.dev version.
#
# Dreambooth may not work properly.
#
# TROUBLESHOOTING
# 1. Fully restart your project (not just the webpage)
# 2. Update your A1111 project and extensions
# 3. Dreambooth requirements should have installed automatically, but you can manually install them
#    by running the following 4 commands from the A1111 project root:
cd venv/Scripts
activate
cd ../..
pip install -r ./extensions/sd_dreambooth_extension/requirements.txt
#######################################################################################################

Launching Web UI with arguments: --autolaunch --medvram --xformers
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 181.56it/s]
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 998.88it/s]
Loading weights [b52505d9b7] from D:\stable-diffusion-webui\models\Stable-diffusion\16MegaModelPhoto_16MegaModelPhoto.safetensors
Creating model from config: D:\stable-diffusion-webui\configs\alt-diffusion-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
loading stable diffusion model: AttributeError
Traceback (most recent call last):
  File "d:\stable-diffusion-webui\webui.py", line 139, in initialize
    modules.sd_models.load_model()
  File "D:\stable-diffusion-webui\modules\sd_models.py", line 447, in load_model
    lowvram.setup_for_low_vram(sd_model, shared.cmd_opts.medvram)
  File "D:\stable-diffusion-webui\modules\lowvram.py", line 60, in setup_for_low_vram
    stored = sd_model.cond_stage_model.transformer, sd_model.first_stage_model, getattr(sd_model, 'depth_model', None), getattr(sd_model, 'embedder', None), sd_model.model
  File "d:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1269, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'BertSeriesModelWithTransformation' object has no attribute 'transformer'

Stable diffusion model failed to load, exiting

Additional information

No response

machado2 commented 1 year ago

More information from the model author

What happened is there are some chinesse models that use to quote the issue tracker for the dev team "Alt-diffusion uses Alt-Clip, (multilingual text-encoder) this model can be merged with any model, with the text encoder being used with the new model."

so some files here have alt-clip as well as clip 1 or 2 in them, it allows multiple languages to be used for the model to say translate chinesse inputs into language (actually making this model stronger because if u put in chinesse, french, english etc i think about 9 languages supported) it allows the use of tags in other languages and for tags in other languages to be pulled in generation.

That helps this big model pull 9 languages rather than internally siloing them when generating images.

ClashSAN commented 1 year ago

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9126