Always live-scan Studio 2 LoRAs on load and Refresh like Settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
export async function cachedLoras({read,write,live,fresh=false}) {
|
||||
export async function cachedLoras({read,write,live,fresh: _fresh=false}) {
|
||||
const cached=read() || {image:[],video:[]};
|
||||
if (!fresh && (cached.image?.length || cached.video?.length)) return cached;
|
||||
try {
|
||||
// Always live-scan. Disk is asleep/empty fallback only — never a stale snapshot that skips Comfy.
|
||||
const listed=await live();
|
||||
const image=Array.isArray(listed?.image)?listed.image:[];
|
||||
const video=Array.isArray(listed?.video)?listed.video:[];
|
||||
// Comfy asleep / empty: keep disk. Otherwise replace — never merge stale names that freeze adds.
|
||||
if (!image.length && !video.length) return cached;
|
||||
const next={image,video};
|
||||
write(next);
|
||||
|
||||
Reference in New Issue
Block a user