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

[Bug]: LORAs not working

Open Ac3n opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

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

What happened?

LORA's not working in the latest update.

Steps to reproduce the problem

launch webui enter prompt with lora press generate lora doesn't work

What should have happened?

LORA should work normally

Commit where the problem happens

4723

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--no-half-vae
--auto-launch
--xformers

List of extensions

only lora extension

Console logs

venv "F:\AI\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.3.0
Commit hash: 20ae71faa8ef035c31aa3a410b707d792c8203a3
Installing requirements
Launching Web UI with arguments: --no-half-vae --xformers --autolaunch
==============================================================================
You are running torch 1.13.1+cu117.
The program is tested to work with torch 2.0.0.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.
==============================================================================
=================================================================================
You are running xformers 0.0.16rc425.
The program is tested to work with xformers 0.0.17.
To reinstall the desired version, run with commandline flag --reinstall-xformers.

Use --skip-version-check commandline argument to disable this check.
=================================================================================
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[AddNet] Updating model hashes...
100%|██████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 2103.46it/s]
[AddNet] Updating model hashes...
100%|██████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 2998.07it/s]
Loading weights [49ef66fc4c] from F:\AI\stable-diffusion-webui\models\Stable-diffusion\kotosmix_v10.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: F:\AI\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
Startup time: 8.2s (import torch: 1.8s, import gradio: 1.1s, import ldm: 0.6s, other imports: 1.0s, list SD models: 0.1s, load scripts: 1.3s, create ui: 0.5s, gradio launch: 1.5s).
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: F:\AI\stable-diffusion-webui\models\VAE\orangemix.vae.pt
Applying optimization: xformers... done.
Textual inversion embeddings loaded(4): bad-artist, bad-hands-5, EasyNegative, ng_deepnegative_v1_75t
Model loaded in 7.7s (load weights from disk: 1.7s, create model: 1.2s, apply weights to model: 1.6s, apply half(): 0.6s, load VAE: 0.7s, move model to device: 0.9s, load textual inversion embeddings: 0.9s).
There is no image in gallery to save as a preview.
locon load lora method
loading Lora F:\AI\stable-diffusion-webui\models\Lora\art_haikawahemulen-03.safetensors: TypeError
Traceback (most recent call last):
  File "F:\AI\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 "F:\AI\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\main.py", line 367, in load_lora
    lora.mtime = os.path.getmtime(filename)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\genericpath.py", line 55, in getmtime
    return os.stat(filename).st_mtime
TypeError: stat: path should be string, bytes, os.PathLike or integer, not LoraOnDisk

Additional information

No response

Ac3n avatar May 28 '23 16:05 Ac3n

yeah same here on endeavor linux amd ryzen cpu wayland

s-b-repo avatar May 28 '23 17:05 s-b-repo

File "F:\AI\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) to fix this

\stable-diffusion-webui-directml\extensions\a1111-sd-webui-locon\scripts\main.py

You must delete the character string .filename

line 371: lora.mtime = os.path.getmtime(lora_on_disk)

line 373: sd = sd_models.read_state_dict(lora_on_disk)

This fixed the problem for me.

s-b-repo avatar May 28 '23 17:05 s-b-repo

https://www.reddit.com/r/StableDiffusion/comments/13nz1c2/comment/jl2olt5/

s-b-repo avatar May 28 '23 17:05 s-b-repo

This is related to the a1111-sd-webui-locon extension you're using. Please make sure you're using the most recent version of that extension, and if that doesn't fix the issue, please raise an issue on https://github.com/KohakuBlueleaf/a1111-sd-webui-locon/issues instead.

akx avatar May 28 '23 19:05 akx