Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lora settings: item filename keyerror #16008

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extensions-builtin/Lora/ui_extra_networks_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def refresh(self):

def create_item(self, name, index=None, enable_filter=True):
lora_on_disk = networks.available_networks.get(name)
if lora_on_disk is None:
lora_on_disk = networks.available_network_aliases.get(name)
if lora_on_disk is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no that is not the fix

thes line of code is just a thread safe check to make sure that the entry is already loaded
otherwise it stopped processing

this functuon is for creading cards not selecting lora in prompt
name MUST be unique and and in available_networks
available_network_aliases should not be used as a fallback

if you use available_network_aliases as fallback then you could end up in a situation where the lora list is not fully loaded but a but the matching alias is, which would then cause you to select the wrong lora to be edited

the issue as you have written is for some reason

    filename, _ = os.path.splitext(item["filename"])
KeyError: filename

so the investigation subsequent fix fix should be about why the filename key is missing
and not adding a problematic pullback

return

Expand Down