AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Loras not working aymore #15880

Open JediMaDMZ opened 1 month ago

JediMaDMZ commented 1 month ago

Checklist

What happened?

Since I had to do a clean installation my loras don't work anymore

Already up to date. venv "I:\AI\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Version: v1.9.3 Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0 Launching Web UI with arguments: --xformers reading lora I:\AI\stable-diffusion-webui\models\Lora\3DMM_V5.safetensors: AssertionError Traceback (most recent call last): File "I:\AI\stable-diffusion-webui\extensions-builtin\Lora\network.py", line 37, in init self.metadata = cache.cached_data_for_file('safetensors-metadata', "lora/" + self.name, filename, read_metadata) File "I:\AI\stable-diffusion-webui\modules\cache.py", line 114, in cached_data_for_file value = func() File "I:\AI\stable-diffusion-webui\extensions-builtin\Lora\network.py", line 31, in read_metadata metadata = sd_models.read_metadata_from_safetensors(filename) File "I:\AI\stable-diffusion-webui\modules\sd_models.py", line 282, in read_metadata_from_safetensors assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file" AssertionError: I:\AI\stable-diffusion-webui\models\Lora\3DMM_V5.safetensors is not a safetensors file

Steps to reproduce the problem

1 Make a clean installation 2 Download 1 lora in Models/lora 3 Try to generate 1 image with a Lora

What should have happened?

Lora should load and work

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-05-25-03-31.json

Console logs

Already up to date.
venv "I:\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Launching Web UI with arguments: --xformers
reading lora I:\AI\stable-diffusion-webui\models\Lora\3DMM_V5.safetensors: AssertionError
Traceback (most recent call last):
  File "I:\AI\stable-diffusion-webui\extensions-builtin\Lora\network.py", line 37, in __init__
    self.metadata = cache.cached_data_for_file('safetensors-metadata', "lora/" + self.name, filename, read_metadata)
  File "I:\AI\stable-diffusion-webui\modules\cache.py", line 114, in cached_data_for_file
    value = func()
  File "I:\AI\stable-diffusion-webui\extensions-builtin\Lora\network.py", line 31, in read_metadata
    metadata = sd_models.read_metadata_from_safetensors(filename)
  File "I:\AI\stable-diffusion-webui\modules\sd_models.py", line 282, in read_metadata_from_safetensors
    assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file"
AssertionError: I:\AI\stable-diffusion-webui\models\Lora\3DMM_V5.safetensors is not a safetensors file

[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
ControlNet preprocessor location: I:\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2024-05-25 05:33:22,401 - ControlNet - INFO - ControlNet v1.1.449
Loading weights [445ffb5195] from I:\AI\stable-diffusion-webui\models\Stable-diffusion\epicrealism_pureEvolutionV4.safetensors
2024-05-25 05:33:22,830 - ControlNet - INFO - ControlNet UI callback registered.
Creating model from config: I:\AI\stable-diffusion-webui\configs\v1-inference.yaml
I:\AI\stable-diffusion-webui\extensions\sd-webui-additional-networks\scripts\metadata_editor.py:399: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
I:\AI\stable-diffusion-webui\extensions\sd-webui-additional-networks\scripts\metadata_editor.py:521: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  cover_image = gr.Image(
I:\AI\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
IIB Database file has been successfully backed up to the backup folder.
Startup time: 10.6s (prepare environment: 3.8s, import torch: 2.9s, import gradio: 0.5s, setup paths: 0.6s, initialize shared: 0.2s, other imports: 0.4s, load scripts: 1.4s, create ui: 0.6s, gradio launch: 0.2s).
Loading VAE weights specified in settings: I:\AI\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: xformers... done.
Model loaded in 2.3s (load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 1.3s, calculate empty prompt: 0.1s).

Additional information

I just had to do a clean installation, before that It was working perfectly but I didnt update A1111 for months, so it happened as I had to install the most recent one

Ichimikichiki commented 1 month ago

What's going on with this? Nobody has been able to use this app for days!!

Linux here. Firefox. No Lora's - tolerable. Call a single Lora in your prompt = image is REKT Rebuilding from scratch doesn't work. Nothing works. Disabling the Lora extension completely = works. Tried forcing torch 2.3.0, 2.2.0, no good...

dwarfstar5 commented 4 weeks ago

Same issue on Runpod version: v1.9.4 •  python: 3.10.12  •  torch: 2.3.0+cu121  •  xformers: 0.0.26.post1  •  gradio: 3.41.2

LLimLimesis commented 3 weeks ago

The same issue here. Using v1.9.4. There is no issue with the Lora file or model file. There is no issue with the base model version. Not applied to the prompt. When I type lora prompt manually, it draws meaningless image.

HenriqueCrj commented 1 week ago

Same issue, all Loras are on the models/Lora folder, however none of them can be activated.