-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
Conversation
in what case does that happen? |
After editing cards with different names and aliases. If I understand correctly. Or just after opening and closing. It's also connected with preview update, the error happens there In general I had very inconsistent card settings, and after adding these 2 lines all started to be ok. I found this solution while making sdxl support in my old-sd-firstpasser extension, because SD model field is filled in the same place |
@@ -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: |
There was a problem hiding this comment.
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
I don't understand
I know, and I write in the description about cards in ui
Available networks are loaded first, and then "info" objects for cards are being loaded. How does it possible to not have lora list fully loaded
Okay I'll find a way to reproduce |
Oh I see, thank you @w-e-w . This problem happens only if the backend was reloaded, but the frontend - not. Users need to press reload button |
Description
Sometimes opening settings doesn't work due to this error:
It happens because lora's name is alias
Checklist: