KohakuBlueleaf / a1111-sd-webui-lycoris

An extension for stable-diffusion-webui to load lycoris models.
Apache License 2.0
861 stars 116 forks source link

Failed to load LyCORIS due to HeaderTooLarge error #52

Closed LieDeath closed 1 year ago

LieDeath commented 1 year ago

Failed to load LyCORIS Note: the test LyCORIS model is running normaly on A1111 V1.3.2, but failed on V1.4.0. The error model is download from HERE.

reading lora D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors: AssertionError,  1.14s/it]
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 83, in __init__
    self.metadata = sd_models.read_metadata_from_safetensors(filename)
  File "D:\AI6\stable-diffusion-webui\modules\sd_models.py", line 230, in read_metadata_from_safetensors
    assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file"
AssertionError: D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors is not a safetensors file

                                                                                                                       locon load lora method                                                                           | 0/12 [00:00<?, ?it/s]
locon load lora method
loading Lora D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors: Exception
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 253, in load_loras
    lora = load_lora(name, lora_on_disk)
  File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\main.py", line 373, in load_lora
    sd = sd_models.read_state_dict(lora_on_disk.filename)
  File "D:\AI6\stable-diffusion-webui\modules\sd_models.py", line 250, in read_state_dict
    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
  File "D:\AI6\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: HeaderTooLarge
KohakuBlueleaf commented 1 year ago

I guess what you are using is actually locon... Not LyCORIS

LieDeath commented 1 year ago

I guess what you are using is actually locon... Not LyCORIS

oh...... i see them as the same, it is incorrect. however, i don't know why it work before and fail now.

KohakuBlueleaf commented 1 year ago

I don't know too This is not my problem But safetensors' problem

LieDeath commented 1 year ago

I don't know too This is not my problem But safetensors' problem

thank you much, maybe something is broken in a1111 update. i have check the model itself, and it is uncorrupted. so strange.

LieDeath commented 1 year ago

I don't know too This is not my problem But safetensors' problem

I get it. The file is actually a ckpt, in ZIP64 form. It is not a safetensors. I go to the wrong way.