d8ahazard / sd_dreambooth_extension

Other
1.86k stars 282 forks source link

[Bug]: Error loading models #1407

Closed fulleclip closed 9 months ago

fulleclip commented 10 months ago

Is there an existing issue for this?

What happened?

When I try to load the models created by Dreambooth, errors appear and they do not load

Steps to reproduce the problem

Try to load from the interface any model recently created by Dreambooth

Commit and libraries

Initializing Dreambooth Dreambooth revision: 1cf7267f49ecfe24fec9756b1d76c0ad8629087f Checking xformers... Checking bitsandbytes... Checking bitsandbytes (Windows) Virtual environment path: D:\sd1\stable-diffusion-webui\venv Checking for D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll Checking Dreambooth requirements... [Dreambooth] accelerate v0.21.0 is already installed. [Dreambooth] dadaptation v3.1 is already installed. [Dreambooth] diffusers v0.23.1 is already installed. [Dreambooth] discord-webhook v1.3.0 is already installed. [Dreambooth] fastapi is already installed. [Dreambooth] gitpython v3.1.40 is not installed. Successfully installed gitpython-3.1.40

[Dreambooth] pytorch_optimizer v2.12.0 is already installed. [Dreambooth] Pillow is already installed. [Dreambooth] tqdm is already installed. [Dreambooth] tomesd v0.1.2 is already installed. [Dreambooth] transformers v4.30.2 is already installed. [Dreambooth] tensorboard v2.13.0 is already installed. [!] xformers version 0.0.20 installed. [+] torch version 2.0.1+cu118 installed. [+] torchvision version 0.15.2+cu118 installed. [+] accelerate version 0.21.0 installed. [+] diffusers version 0.23.1 installed. [+] transformers version 4.30.2 installed. [+] bitsandbytes version 0.41.2.post2 installed.

Command Line Arguments

--xformers --medvram-sdxl --no-half-vae

Console logs

Already up to date.
venv "D:\sd1\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.1
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Installing requirements
bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 1cf7267f49ecfe24fec9756b1d76c0ad8629087f
Checking xformers...
Checking bitsandbytes...
Checking bitsandbytes (Windows)
Virtual environment path: D:\sd1\stable-diffusion-webui\venv
Checking for D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
Checking Dreambooth requirements...
[Dreambooth] accelerate v0.21.0 is already installed.
[Dreambooth] dadaptation v3.1 is already installed.
[Dreambooth] diffusers v0.23.1 is already installed.
[Dreambooth] discord-webhook v1.3.0 is already installed.
[Dreambooth] fastapi is already installed.
[Dreambooth] gitpython v3.1.40 is not installed.
Successfully installed gitpython-3.1.40

[Dreambooth] pytorch_optimizer v2.12.0 is already installed.
[Dreambooth] Pillow is already installed.
[Dreambooth] tqdm is already installed.
[Dreambooth] tomesd v0.1.2 is already installed.
[Dreambooth] transformers v4.30.2 is already installed.
[Dreambooth] tensorboard v2.13.0 is already installed.
[!] xformers version 0.0.20 installed.
[+] torch version 2.0.1+cu118 installed.
[+] torchvision version 0.15.2+cu118 installed.
[+] accelerate version 0.21.0 installed.
[+] diffusers version 0.23.1 installed.
[+] transformers version 4.30.2 installed.
[+] bitsandbytes version 0.41.2.post2 installed.
Launching Web UI with arguments: --xformers --medvram-sdxl --no-half-vae
bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
[-] ADetailer initialized. version: 23.11.1, num models: 9
2023-12-10 13:03:29,889 - ControlNet - INFO - ControlNet v1.1.422
ControlNet preprocessor location: D:\sd1\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-10 13:03:30,289 - ControlNet - INFO - ControlNet v1.1.422
Loading weights [15012c538f] from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\realisticVisionV51_v51VAE.safetensors
2023-12-10 13:03:31,526 - AnimateDiff - INFO - Injecting LCM to UI.
2023-12-10 13:03:32,013 - AnimateDiff - INFO - Hacking i2i-batch.
Creating model from config: D:\sd1\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 57.3s (prepare environment: 39.5s, import torch: 5.7s, import gradio: 1.3s, setup paths: 0.8s, initialize shared: 0.4s, other imports: 1.4s, setup codeformer: 0.5s, list SD models: 0.3s, load scripts: 4.9s, create ui: 2.0s, gradio launch: 0.5s).
Advanced elements visible: False
Applying attention optimization: xformers... done.
Model loaded in 13.7s (load weights from disk: 1.3s, create model: 1.2s, apply weights to model: 9.6s, apply dtype to VAE: 0.2s, move model to device: 0.1s, load textual inversion embeddings: 0.2s, calculate empty prompt: 1.0s).
Saving backup of webui/extension state to D:\sd1\stable-diffusion-webui\config_states\2023_12_10-13_03_53_Backup (pre-update).json.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.1
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Installing requirements
bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 1cf7267f49ecfe24fec9756b1d76c0ad8629087f
Checking xformers...
Checking bitsandbytes...
Checking bitsandbytes (Windows)
Virtual environment path: D:\sd1\stable-diffusion-webui\venv
Checking for D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
Checking Dreambooth requirements...
[Dreambooth] accelerate v0.21.0 is already installed.
[Dreambooth] dadaptation v3.1 is already installed.
[Dreambooth] diffusers v0.23.1 is already installed.
[Dreambooth] discord-webhook v1.3.0 is already installed.
[Dreambooth] fastapi is already installed.
[Dreambooth] gitpython v3.1.40 is not installed.
Successfully installed gitpython-3.1.40

[Dreambooth] pytorch_optimizer v2.12.0 is already installed.
[Dreambooth] Pillow is already installed.
[Dreambooth] tqdm is already installed.
[Dreambooth] tomesd v0.1.2 is already installed.
[Dreambooth] transformers v4.30.2 is already installed.
[Dreambooth] tensorboard v2.13.0 is already installed.
[!] xformers version 0.0.20 installed.
[+] torch version 2.0.1+cu118 installed.
[+] torchvision version 0.15.2+cu118 installed.
[+] accelerate version 0.21.0 installed.
[+] diffusers version 0.23.1 installed.
[+] transformers version 4.30.2 installed.
[+] bitsandbytes version 0.41.2.post2 installed.
Launching Web UI with arguments: --xformers --medvram-sdxl --no-half-vae
bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll
[-] ADetailer initialized. version: 23.11.1, num models: 9
2023-12-10 13:04:29,109 - ControlNet - INFO - ControlNet v1.1.422
ControlNet preprocessor location: D:\sd1\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-10 13:04:29,255 - ControlNet - INFO - ControlNet v1.1.422
Loading weights [15012c538f] from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\realisticVisionV51_v51VAE.safetensors
2023-12-10 13:04:30,219 - AnimateDiff - INFO - Injecting LCM to UI.
2023-12-10 13:04:30,588 - AnimateDiff - INFO - Hacking i2i-batch.
Creating model from config: D:\sd1\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 37.2s (prepare environment: 21.9s, import torch: 5.8s, import gradio: 1.3s, setup paths: 0.8s, initialize shared: 0.3s, other imports: 0.5s, setup codeformer: 0.3s, load scripts: 4.3s, create ui: 1.6s, gradio launch: 0.2s).
Applying attention optimization: xformers... done.
Model loaded in 5.3s (load weights from disk: 0.9s, create model: 0.8s, apply weights to model: 3.1s, move model to device: 0.1s, calculate empty prompt: 0.2s).
Advanced elements visible: False
Can't load config!
Traceback (most recent call last):
  File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1434, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in postprocess_data
    self.validate_outputs(fn_index, predictions)  # type: ignore
  File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1272, in validate_outputs
    raise ValueError(
ValueError: An event handler (load_model_params) didn't receive enough output values (needed: 11, received: 8).
Wanted outputs:
    [<gradio.layouts.Row object at 0x000001E79202A620>, html, html, html, html, html, html, html, dropdown, dropdown, html]
Received outputs:
    [{'visible': False, '__type__': 'generic_update'}, "", "", "", "", "", {'visible': True, 'choices': [], 'value': '', '__type__': 'generic_update'}, "Error loading model params: 'None'."]
Advanced elements visible: True
Extracting config from D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\..\configs\v1-training-default.yaml
Extracting checkpoint from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\realisticVisionV20_v20.safetensors
D:\sd1\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
  warnings.warn(
Duration: 00:00:19
Updating scheduler name to: DDIM
Advanced elements visible: False
Advanced elements visible: True
Custom model name is adriii
Initializing dreambooth training...
                                                                                                                       We need a total of 11 class images.2it [00:00, 355.04it/s]
Loading pipeline components...: 100%|████████████████████████████████████████████████████| 7/7 [00:05<00:00,  1.25it/s]
Using scheduler: EulerAncestralDiscrete                                                         | 0/11 [00:00<?, ?it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.62it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.84it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.04it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.32it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.41it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.41it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.41it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.42it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.42it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.42it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.44it/s]
Generating class images 10/11::  91%|████████████████████████████████████████████████████▋     | 10/11 [00:00<?, ?it/s]Init dataset!set:   0%|                                                                           | 0/5 [00:00<?, ?it/s]
Preparing Dataset (Without Caching)
Bucket 0 (384, 680, 0) - Instance Images:  1 | Class Images:  1 | Max Examples/batch:  2
Bucket 1 (456, 568, 0) - Instance Images:  1 | Class Images:  1 | Max Examples/batch:  2
Bucket 2 (512, 512, 0) - Instance Images:  9 | Class Images:  9 | Max Examples/batch: 18
Total Buckets 3 - Instance Images: 11 | Class Images: 11 | Max Examples/batch: 22

Total images / batch: 22, total examples: 22█████████████████████████████████████████| 22/22 [00:00<00:00, 4400.53it/s]
                  Initializing bucket counter!
Loading pipeline components...: 100%|████████████████████████████████████████████████████| 7/7 [00:02<00:00,  3.35it/s]
Saving weights/samples...: : 0it [00:00, ?it/s]                                                                        Renaming encoder.mid.attn_1.to_q.weight to encoder.mid.attn_1.q.weight                            | 0/1 [00:00<?, ?it/s]
Renaming encoder.mid.attn_1.to_q.bias to encoder.mid.attn_1.q.bias
Renaming encoder.mid.attn_1.to_k.weight to encoder.mid.attn_1.k.weight
Renaming encoder.mid.attn_1.to_k.bias to encoder.mid.attn_1.k.bias
Renaming encoder.mid.attn_1.to_v.weight to encoder.mid.attn_1.v.weight
Renaming encoder.mid.attn_1.to_v.bias to encoder.mid.attn_1.v.bias
Renaming encoder.mid.attn_1.to_out.0.weight to encoder.mid.attn_1.proj_out.weight
Renaming encoder.mid.attn_1.to_out.0.bias to encoder.mid.attn_1.proj_out.bias
Renaming decoder.mid.attn_1.to_q.weight to decoder.mid.attn_1.q.weight
Renaming decoder.mid.attn_1.to_q.bias to decoder.mid.attn_1.q.bias
Renaming decoder.mid.attn_1.to_k.weight to decoder.mid.attn_1.k.weight
Renaming decoder.mid.attn_1.to_k.bias to decoder.mid.attn_1.k.bias
Renaming decoder.mid.attn_1.to_v.weight to decoder.mid.attn_1.v.weight
Renaming decoder.mid.attn_1.to_v.bias to decoder.mid.attn_1.v.bias
Renaming decoder.mid.attn_1.to_out.0.weight to decoder.mid.attn_1.proj_out.weight
Renaming decoder.mid.attn_1.to_out.0.bias to decoder.mid.attn_1.proj_out.bias
Loading pipeline components...: 100%|████████████████████████████████████████████████████| 7/7 [00:03<00:00,  2.07it/s]
Compiling Checkpoint: : 3it [00:03,  1.27s/it]                                                                         Model name: adriiis:  33%|█████████████████████▎                                          | 1/3 [00:18<00:37, 18.87s/it]
D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\helpers\log_parser.py:324: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.
  all_df_loss = all_df_loss.fillna(method="ffill")
Saving D:\sd1\stable-diffusion-webui\models\dreambooth\adriii\logging\loss_plot_3300.png
Saving D:\sd1\stable-diffusion-webui\models\dreambooth\adriii\logging\ram_plot_3300.png
Cleanup log parse.
                                                                                                                       Cleanup completed.                                                                                | 0/3 [00:00<?, ?it/s]
Steps: 100%|████| 3300/3300 [46:33<00:00,  1.18it/s, inst_loss=0.0418, loss=0.0418, lr=2e-6, prior_loss=None, vram=6.4]
  0%|                                                                                            | 0/3 [00:00<?, ?it/s]
Duration: 00:47:55
Duration: 00:47:56
Reusing loaded model realisticVisionV51_v51VAE.safetensors [15012c538f] to load adriii\adriii_3300.safetensors
Calculating sha256 for D:\sd1\stable-diffusion-webui\models\Stable-diffusion\adriii\adriii_3300.safetensors: f3903f9884422a62bd4e4407afa1eb8ee8fa7afd507460b55beb82145011f84b
Loading weights [f3903f9884] from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\adriii\adriii_3300.safetensors
Creating model from config: D:\sd1\stable-diffusion-webui\models\Stable-diffusion\adriii\adriii_3300.yaml
changing setting sd_model_checkpoint to adriii\adriii_3300.safetensors: RuntimeError
Traceback (most recent call last):
  File "D:\sd1\stable-diffusion-webui\modules\options.py", line 140, in set
    option.onchange()
  File "D:\sd1\stable-diffusion-webui\modules\call_queue.py", line 13, in f
    res = func(*args, **kwargs)
  File "D:\sd1\stable-diffusion-webui\modules\initialize_util.py", line 170, in <lambda>
    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False)
  File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 751, in reload_model_weights
    load_model(checkpoint_info, already_loaded_state_dict=state_dict)
  File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "D:\sd1\stable-diffusion-webui\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "D:\sd1\stable-diffusion-webui\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for LatentDiffusion:
        size mismatch for first_stage_model.encoder.mid.attn_1.q.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.encoder.mid.attn_1.k.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.encoder.mid.attn_1.v.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.encoder.mid.attn_1.proj_out.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.decoder.mid.attn_1.q.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.decoder.mid.attn_1.k.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.decoder.mid.attn_1.v.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).
        size mismatch for first_stage_model.decoder.mid.attn_1.proj_out.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).

Additional information

No response

fulleclip commented 10 months ago

sorry https://github.com/d8ahazard/sd_dreambooth_extension/issues/1405

fulleclip commented 9 months ago

I have realized that now dreambooth uses xformer 0.21, I have deleted both the plugin folder and the venv folder to avoid possible errors, after this I have reinstalled the latest version of dreambooth, everything loads fine, the training also seems to be correct or at least no errors, but when trying to load the new model the error appears again

------- log -----

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.7.0 Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e Installing requirements bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth Dreambooth revision: 1cf7267f49ecfe24fec9756b1d76c0ad8629087f Checking xformers... Checking bitsandbytes... Checking bitsandbytes (Windows) Virtual environment path: D:\sd1\stable-diffusion-webui\venv Checking for D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll Checking Dreambooth requirements... [Dreambooth] accelerate v0.21.0 is already installed. [Dreambooth] dadaptation v3.1 is already installed. [Dreambooth] diffusers v0.23.1 is already installed. [Dreambooth] discord-webhook v1.3.0 is already installed. [Dreambooth] fastapi is already installed. [Dreambooth] gitpython v3.1.40 is not installed. Successfully installed gitpython-3.1.40

[Dreambooth] pytorch_optimizer v2.12.0 is already installed. [Dreambooth] Pillow is already installed. [Dreambooth] tqdm is already installed. [Dreambooth] tomesd v0.1.2 is already installed. [Dreambooth] transformers v4.30.2 is already installed. [Dreambooth] tensorboard v2.13.0 is already installed. [+] xformers version 0.0.21 installed. [+] torch version 2.0.1+cu118 installed. [+] torchvision version 0.15.2+cu118 installed. [+] accelerate version 0.21.0 installed. [+] diffusers version 0.24.0 installed. [+] transformers version 4.30.2 installed. [+] bitsandbytes version 0.41.2.post2 installed. Launching Web UI with arguments: --xformers --medvram-sdxl --no-half-vae bin D:\sd1\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.dll Style database not found: D:\sd1\stable-diffusion-webui\styles.csv [-] ADetailer initialized. version: 23.11.1, num models: 9 ControlNet preprocessor location: D:\sd1\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads 2023-12-18 01:09:31,841 - ControlNet - INFO - ControlNet v1.1.423 2023-12-18 01:09:31,977 - ControlNet - INFO - ControlNet v1.1.423 Loading weights [c55a11068a] from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\adriii55\adriii55_5400.safetensors 2023-12-18 01:09:32,978 - AnimateDiff - INFO - Injecting LCM to UI. 2023-12-18 01:09:33,359 - AnimateDiff - INFO - Hacking i2i-batch. Creating model from config: D:\sd1\stable-diffusion-webui\models\Stable-diffusion\adriii55\adriii55_5400.yaml Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Startup time: 37.2s (prepare environment: 21.5s, import torch: 4.7s, import gradio: 1.5s, setup paths: 1.7s, initialize shared: 0.3s, other imports: 0.5s, setup codeformer: 0.3s, load scripts: 4.4s, create ui: 1.6s, gradio launch: 0.2s). Applying attention optimization: xformers... done. Model loaded in 7.5s (load weights from disk: 1.1s, create model: 0.6s, apply weights to model: 5.2s, calculate empty prompt: 0.2s). Advanced elements visible: False Reusing loaded model adriii55\adriii55_5400.safetensors [c55a11068a] to load p3\p3_300.safetensors [88e401a5b9] Loading weights [88e401a5b9] from D:\sd1\stable-diffusion-webui\models\Stable-diffusion\p3\p3_300.safetensors Creating model from config: D:\sd1\stable-diffusion-webui\models\Stable-diffusion\p3\p3_300.yaml changing setting sd_model_checkpoint to p3\p3_300.safetensors [88e401a5b9]: RuntimeError Traceback (most recent call last): File "D:\sd1\stable-diffusion-webui\modules\options.py", line 146, in set option.onchange() File "D:\sd1\stable-diffusion-webui\modules\call_queue.py", line 13, in f res = func(*args, *kwargs) File "D:\sd1\stable-diffusion-webui\modules\initialize_util.py", line 174, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False) File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 783, in reload_model_weights load_model(checkpoint_info, already_loaded_state_dict=state_dict) File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 658, in load_model load_model_weights(sd_model, checkpoint_info, state_dict, timer) File "D:\sd1\stable-diffusion-webui\modules\sd_models.py", line 375, in load_model_weights model.load_state_dict(state_dict, strict=False) File "D:\sd1\stable-diffusion-webui\modules\sd_disable_initialization.py", line 223, in module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda args, kwargs: load_state_dict(module_load_state_dict, *args, kwargs)) File "D:\sd1\stable-diffusion-webui\modules\sd_disable_initialization.py", line 221, in load_state_dict original(module, state_dict, strict=strict) File "D:\sd1\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for LatentDiffusion: size mismatch for first_stage_model.encoder.mid.attn_1.q.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.encoder.mid.attn_1.k.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.encoder.mid.attn_1.v.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.encoder.mid.attn_1.proj_out.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.decoder.mid.attn_1.q.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.decoder.mid.attn_1.k.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.decoder.mid.attn_1.v.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for first_stage_model.decoder.mid.attn_1.proj_out.bias: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512]).

fulleclip commented 9 months ago

I have updated to the latest version 0c434ad7, generated a new test model, and at least it still gives me the same errors when loading the resulting model

fulleclip commented 9 months ago

perfect thanks, everything seems to work now

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days