Refresh Studio 2 LoRAs from live Comfy object_info on fresh=1.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,25 @@ test('cached LoRAs survive sleeping GPU and failed explicit refresh',async()=>{
|
||||
const opts={read:()=>cache,write:()=>assert.fail('Do not erase cache'),live:async()=>{queried++;throw Error('Comfy asleep')}}
|
||||
assert.deepEqual(await cachedLoras(opts),cache);assert.equal(queried,0);assert.deepEqual(await cachedLoras({...opts,fresh:true}),cache);assert.equal(queried,1)
|
||||
})
|
||||
test('fresh LoRA refresh replaces disk cache so new Comfy names appear',async()=>{
|
||||
let store={image:['old.safetensors'],video:['old-vid.safetensors']}
|
||||
const next=await cachedLoras({
|
||||
read:()=>store,
|
||||
write:value=>{store=value},
|
||||
live:async()=>({image:['old.safetensors','new-drop.safetensors'],video:['old-vid.safetensors']}),
|
||||
fresh:true
|
||||
})
|
||||
assert.deepEqual(next.image,['old.safetensors','new-drop.safetensors'])
|
||||
assert.deepEqual(store.image,['old.safetensors','new-drop.safetensors'])
|
||||
const removed=await cachedLoras({
|
||||
read:()=>store,
|
||||
write:value=>{store=value},
|
||||
live:async()=>({image:['new-drop.safetensors'],video:[]}),
|
||||
fresh:true
|
||||
})
|
||||
assert.deepEqual(removed,{image:['new-drop.safetensors'],video:[]})
|
||||
assert.deepEqual(store,{image:['new-drop.safetensors'],video:[]})
|
||||
})
|
||||
test('source/hero actions are independent and full input restores structured settings',()=>{
|
||||
const form={identityStillId:'hero',imageAId:'source',promptSections:{action:'old'},settings:{}}
|
||||
assert.equal(useAsHero(form,{id:'new'}).imageAId,'source');assert.equal(useAsSource(form,{id:'new'}).identityStillId,'hero')
|
||||
|
||||
Reference in New Issue
Block a user