kohya-ss / kohya-ss/sd-scripts

RuntimeError: output with shape [128, 320, 1, 1]

Open
#397 12 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

After the last upgrade I get this error when trying to use my newly produced lora in SD:

activating extra network lora with arguments [, ]: RuntimeError
Traceback (most recent call last):
File "D:\SD\stable-diffusion-webui\modules\extra_networks.py", line 75, in activate
extra_network.activate(p, extra_network_args)
File "D:\SD\stable-diffusion-webui\extensions-builtin\Lora\extra_networks_lora.py", line 23, in activate
lora.load_loras(names, multipliers)
File "D:\SD\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 214, in load_loras
lora = load_lora(name, lora_on_disk.filename)
File "D:\SD\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 176, in load_lora
module.weight.copy_(weight)
RuntimeError: output with shape [128, 320, 1, 1] doesn't match the broadcast shape [128, 320, 3, 3]

When producing the lors they make fine sample images that seem to be working well, but it's when adding the lora to SD this error appears. Eveything is up to date. I have added additional networks extension.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with extensions-builtin/Lora/lora.py, especially load_lora where module.weight.copy_ raises the shape mismatch, and trace the call from modules/extra_networks.py and extra_networks_lora.py. Reproduce by activating the reported LoRA in Stable Diffusion and compare the produced weight shape with the target module. Done means the LoRA loads without this RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.