stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Some lora can not be loaded after latest commit

Open VantomPayne opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

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

What happened?

After pulling the latest commit, certain loras are not loaded during generation, instead gives error in console:

activating extra network lora with arguments [<modules.extra_networks.ExtraNetworkParams object at 0x000001A66D7BEBF0>, <modules.extra_networks.ExtraNetworkParams object at 0x000001A66D7BCCD0>]: Exception Traceback (most recent call last): File "F:\stable-diffusion-webui\modules\extra_networks.py", line 75, in activate extra_network.activate(p, extra_network_args) File "F:\stable-diffusion-webui\extensions-builtin\Lora\extra_networks_lora.py", line 17, in activate lora.load_loras(names, multipliers) File "F:\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 151, in load_loras lora = load_lora(name, lora_on_disk.filename) File "F:\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 83, in load_lora sd = sd_models.read_state_dict(filename) File "F:\stable-diffusion-webui\modules\sd_models.py", line 220, in read_state_dict pl_sd = safetensors.torch.load_file(checkpoint_file, device=device) File "F:\stable-diffusion-webui\venv\lib\site-packages\safetensors\torch.py", line 98, in load_file with safe_open(filename, framework="pt", device=device) as f: Exception: Error while deserializing header: InvalidHeaderDeserialization

I have noticed that newer Loras still work, so it's possible the "pre-0.40" lora fix broke during the last commit.

Steps to reproduce the problem

  1. Load lora of choice (older ones tend to produce this problem in my instance) via either the extention method or the new cards method.
  2. Press Generate
  3. Generation should still work, but lora has no effect, console shows error provided above.

What should have happened?

All loras should load properlly.

Commit where the problem happens

93fad28a979727f9b1331dbdc447598824057cdc

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --theme dark

Additional information, context and logs

No response

VantomPayne avatar Jan 24 '23 19:01 VantomPayne

@VantomPayne did you find a workaround for this? I think I'm having the same issue running on debian. super strange.

Mu2u avatar Feb 06 '23 01:02 Mu2u

The same problem, kaggle. Very annoying :(

nickkolok avatar Feb 07 '23 11:02 nickkolok

Same Problem some works and others just dont

Diosito-Dev avatar Feb 09 '23 15:02 Diosito-Dev

This LoRA: https://civitai.com/models/6526/studio-ghibli-style-lora?commentId=20654&modal=commentThread didn't work for me on some commits but did on 7a14c8ab45da8a681792a6331d48a88dd684a0a9

nickkolok avatar Feb 09 '23 19:02 nickkolok

hi all. Same problem. LORA trained through the latest version of Dreambooth gives this error. The log gives the same output, only the type of error at the end is different: "TypeError: pop expected at most 1 argument, got 2"

razor67rus avatar Mar 17 '23 14:03 razor67rus

I've been having the same problem and it seems to be tied to a specific LORA, so far I reproduced the error by creating 4 images that turned more distorted every time, then had to do a full restart that seemed to temporarily "fix" the issue. The only thing closer to a solution is just avoiding the LORA.

chhdez avatar Apr 25 '23 09:04 chhdez

The error in OP likely indicates the file is corrupted.

Exception: Error while deserializing header: InvalidHeaderDeserialization

Extra networks have been refactored as of https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/b75b004fe62826455f1aa77e849e7da13902cb17, so a new issue should be opened if the problem persists.

catboxanon avatar Aug 11 '23 16:08 catboxanon