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:
+13
-1
@@ -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[] }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user