Keep Image v2 LoRA names and Flux/Krea chains when Comfy is asleep.

The Add picker vanished after the listing cache went empty, and switching engines wrote one stack over the other.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-30 12:31:58 -05:00
co-authored by Cursor
parent 0fa64ea765
commit 201eb1107f
3 changed files with 90 additions and 19 deletions
+13 -1
View File
@@ -161,6 +161,11 @@ async function loadLoraCache(): Promise<LoraCache> {
image: uniqueNames([...image.image, ...video.image]),
video: uniqueNames([...video.video, ...image.video])
}
// Comfy asleep / unreachable returns empty. Keep the last good list so the picker does not vanish.
if (!next.image.length && !next.video.length && cache && (cache.image.length || cache.video.length)) {
cache = { ...cache, at: Date.now() }
return cache
}
cache = next
return next
})().finally(() => {
@@ -170,15 +175,22 @@ async function loadLoraCache(): Promise<LoraCache> {
}
export async function listStudioLoras() {
const xaigen = isXaigenStudio()
try {
const listed = await loadLoraCache()
const xaigen = isXaigenStudio()
return {
at: listed.at,
image: filterLorasForStudio(listed.image, xaigen),
video: filterLorasForStudio(listed.video, xaigen)
}
} catch {
if (cache) {
return {
at: cache.at,
image: filterLorasForStudio(cache.image, xaigen),
video: filterLorasForStudio(cache.video, xaigen)
}
}
return { at: 0, image: [] as string[], video: [] as string[] }
}
}