diff --git a/ui/src/app/generate/page.tsx b/ui/src/app/generate/page.tsx index 050ccd5..87b2e2c 100644 --- a/ui/src/app/generate/page.tsx +++ b/ui/src/app/generate/page.tsx @@ -300,8 +300,10 @@ function GeneratePageInner() { const [sidebarOpen, setSidebarOpen] = useState(persisted.sidebarOpen ?? true); const [cards, setCards] = useState<{ [key: string]: boolean }>(persisted.cards || {}); const [loraModalOpen, setLoraModalOpen] = useState(false); - const loras: { path: string; name: string; strength: number }[] = model.loras || []; - const setLoras = (next: { path: string; name: string; strength: number }[]) => setModel(m => ({ ...m, loras: next })); + type LoraItem = { path: string; name: string; strength: number; disabled?: boolean }; + const loras: LoraItem[] = model.loras || []; + const setLoras = (next: LoraItem[]) => setModel(m => ({ ...m, loras: next })); + const activeLoras = loras.filter(l => !l.disabled); const addLora = (pick: LoraPick) => { if (loras.some(l => l.path === pick.path)) return; setLoras([...loras, { path: pick.path, name: pick.name, strength: 1.0 }]); @@ -528,7 +530,7 @@ function GeneratePageInner() { setStatusLine('Submitting'); previewSizeRef.current = sample.width && sample.height ? { width: sample.width, height: sample.height } : null; const body: { model: any; sample: any; stream: any } = { - model: { ...model, arch }, + model: { ...model, arch, loras: activeLoras }, sample: { ...sample, seed: sample.seed === '' ? -1 : sample.seed }, stream: { latents: 'raw', every_n_steps: 1, max_frames: 0 }, }; @@ -942,12 +944,28 @@ function GeneratePageInner() { )} - toggleCard('loras')}> + toggleCard('loras')}>
{loras.map((l, i) => ( -
+
- + + {l.name}