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

[Bug]: Error with Lora

Open tranthai2k2 opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

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

Are you using the latest version of the colab notebook?

  • [X] Yes, i am using the latest version from the repo

Which colab notebook did you use?

https://colab.research.google.com/github/camenduru/stable-diffusion-webui-colab/blob/v2.0/chillout_mix_webui_colab.ipynb

Which repo branch did the colab you use comes from ?

v2.0

Which tunnel did you use ?

--cloudflared

What happened?

image I saw it created the image but Lora reported an error image

Console logs

activating extra network lora with arguments [<modules.extra_networks.ExtraNetworkParams object at 0x7f6371c1cd00>, <modules.extra_networks.ExtraNetworkParams object at 0x7f6375c25910>, <modules.extra_networks.ExtraNetworkParams object at 0x7f637209cb20>]: RuntimeError
Traceback (most recent call last):
  File "/content/stable-diffusion-webui/modules/extra_networks.py", line 75, in activate
    extra_network.activate(p, extra_network_args)
  File "/content/stable-diffusion-webui/extensions-builtin/Lora/extra_networks_lora.py", line 23, in activate
    lora.load_loras(names, multipliers)
  File "/content/stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 151, in load_loras
    lora = load_lora(name, lora_on_disk.filename)
  File "/content/stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 83, in load_lora
    sd = sd_models.read_state_dict(filename)
  File "/content/stable-diffusion-webui/modules/sd_models.py", line 217, in read_state_dict
    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
  File "/usr/local/lib/python3.8/dist-packages/safetensors/torch.py", line 100, in load_file
    result[k] = f.get_tensor(k)
RuntimeError: self.size(-1) must be divisible by 2 to view Byte as Half (different element sizes), but got 380031

  0% 0/40 [00:00<?, ?it/s]
  2% 1/40 [00:00<00:15,  2.58it/s]
  5% 2/40 [00:00<00:12,  2.94it/s]
  8% 3/40 [00:00<00:11,  3.09it/s]
 10% 4/40 [00:01<00:11,  3.16it/s]
 12% 5/40 [00:01<00:10,  3.19it/s]
 15% 6/40 [00:01<00:10,  3.22it/s]
 18% 7/40 [00:02<00:10,  3.23it/s]
 20% 8/40 [00:02<00:09,  3.23it/s]
 22% 9/40 [00:02<00:09,  3.22it/s]
 25% 10/40 [00:03<00:09,  3.25it/s]
 28% 11/40 [00:03<00:08,  3.24it/s]
 30% 12/40 [00:03<00:08,  3.23it/s]
 32% 13/40 [00:04<00:08,  3.22it/s]
 35% 14/40 [00:04<00:08,  3.22it/s]
 38% 15/40 [00:04<00:07,  3.20it/s]
 40% 16/40 [00:05<00:07,  3.19it/s]
 42% 17/40 [00:05<00:07,  3.18it/s]
 45% 18/40 [00:05<00:06,  3.18it/s]
 48% 19/40 [00:05<00:06,  3.17it/s]
 50% 20/40 [00:06<00:06,  3.16it/s]
 52% 21/40 [00:06<00:06,  3.16it/s]
 55% 22/40 [00:06<00:05,  3.16it/s]
 57% 23/40 [00:07<00:05,  3.13it/s]
 60% 24/40 [00:07<00:05,  3.15it/s]
 62% 25/40 [00:07<00:04,  3.14it/s]
 65% 26/40 [00:08<00:04,  3.14it/s]
 68% 27/40 [00:08<00:04,  3.14it/s]
 70% 28/40 [00:08<00:03,  3.15it/s]
 72% 29/40 [00:09<00:03,  3.14it/s]
 75% 30/40 [00:09<00:03,  3.11it/s]
 78% 31/40 [00:09<00:02,  3.12it/s]
 80% 32/40 [00:10<00:02,  3.12it/s]
 82% 33/40 [00:10<00:02,  3.12it/s]
 85% 34/40 [00:10<00:01,  3.13it/s]
 88% 35/40 [00:11<00:01,  3.12it/s]
 90% 36/40 [00:11<00:01,  3.11it/s]
 92% 37/40 [00:11<00:00,  3.11it/s]
 95% 38/40 [00:12<00:00,  3.10it/s]
 98% 39/40 [00:12<00:00,  3.09it/s]
100% 40/40 [00:12<00:00,  3.15it/s]
Total progress: 100% 40/40 [00:12<00:00,  3.12it/s]

tranthai2k2 avatar Feb 28 '23 03:02 tranthai2k2

  1. try changing LoRA name to normal text, delete Chinese/Japanese text
  2. use 1.5 version instead of 2.0

I have same exact problem like this a week ago

zaviier avatar Feb 28 '23 17:02 zaviier

Hi @tranthai2k2 👋 is this solved with @zaviier's idea ❤ ? if not please open this issue again

camenduru avatar Mar 01 '23 14:03 camenduru