The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
feat(gallery): a result lists the LoRAs it was made with, and their strength (B40)
purple4e416519b21b
diff --git a/src/components/create/experimental/PromptDetails.tsx b/src/components/create/experimental/PromptDetails.tsxindex 834066d8..a36146e4 100644--- a/src/components/create/experimental/PromptDetails.tsx+++ b/src/components/create/experimental/PromptDetails.tsx@@ -92,8 +92,8 @@ export function PromptDetails({ item, className, open = false }: {<CopyText text={runSettingsText(item)} label="Copy prompt and settings" /></div><dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5">- {settings.map((s) => (- <div key={s.label} className="contents">+ {settings.map((s, i) => (+ <div key={`${s.label}-${i}`} className="contents"><dt className="t-label text-gray-500">{s.label}</dt><dd className="t-mono min-w-0 select-text break-words text-gray-300">{s.value}</dd></div>diff --git a/src/components/create/experimental/__tests__/galerie-zeigt-die-loras.test.tsx b/src/components/create/experimental/__tests__/galerie-zeigt-die-loras.test.tsxnew file mode 100644index 00000000..0edc5766--- /dev/null+++ b/src/components/create/experimental/__tests__/galerie-zeigt-die-loras.test.tsx@@ -0,0 +1,63 @@+// @vitest-environment jsdom+/**+ * B40 (3.0.9, Discord boromirofgeo 29.10.2026): the gallery and the large view+ * say which LoRAs a picture was made with, and at what strength. The entry+ * carries them since this change (GalleryItem.loras, written by the local+ * runs through ranLoras).+ *+ * Run: npx vitest run src/components/create/experimental/__tests__/galerie-zeigt-die-loras.test.tsx+ */+import { afterEach, describe, expect, it, vi } from 'vitest'+import { cleanup, render, screen } from '@testing-library/react'++vi.mock('../CreateContext', () => ({+ useCreateExp: () => ({ quota: null, enhanceVideo: vi.fn() }),+}))+vi.mock('../useComfyMedia', () => ({+ useComfyMedia: () => ({ src: 'blob:media', onError: vi.fn() }),+}))++import type { GalleryItem } from '../../../../stores/createStore'+import { Lightbox } from '../Lightbox'+import { ranLoras, runSettings, runSettingsText } from '../../../../lib/render/run-settings'++afterEach(() => { cleanup() })++const ITEM = (extra: Partial<GalleryItem> = {}): GalleryItem => ({+ id: 'a', type: 'image', filename: '', subfolder: '', prompt: 'a red fox in the snow',+ negativePrompt: '', model: 'sd_xl_base_1.0.safetensors', modelType: 'sdxl',+ seed: 4242, steps: 25, cfgScale: 7, sampler: 'dpmpp_2m', scheduler: 'karras',+ width: 1024, height: 768, batchSize: 1, createdAt: 1, intent: 'image', ...extra,+})+const LORAS = [{ name: 'styles/film_grain.safetensors', strength: 0.55 }, { name: 'detail_tweaker_xl.safetensors', strength: 1.2 }]++describe('B40: the LoRAs of a picture', () => {+ it('stand right under the model, each with its strength', () => {+ expect(runSettings(ITEM({ loras: LORAS })).slice(0, 3)).toEqual([+ { label: 'Model', value: 'sd xl base 1.0' },+ { label: 'LoRA', value: 'film grain · 0.55' },+ { label: 'LoRA', value: 'detail tweaker xl · 1.2' },+ ])+ })++ it('go into the copied text too', () => {+ expect(runSettingsText(ITEM({ loras: LORAS }))).toContain('LoRA: film grain · 0.55\nLoRA: detail tweaker xl · 1.2')+ })++ it('the large view lists both', () => {+ render(<Lightbox item={ITEM({ loras: LORAS })} onClose={() => {}} />)+ const text = screen.getByTestId('run-settings').textContent ?? ''+ expect(text).toContain('film grain · 0.55')+ expect(text).toContain('detail tweaker xl · 1.2')+ })++ it('an entry without LoRAs, and a tool, list none', () => {+ expect(runSettings(ITEM()).some((s) => s.label === 'LoRA')).toBe(false)+ expect(runSettings(ITEM({ intent: 'upscale', loras: LORAS })).some((s) => s.label === 'LoRA')).toBe(false)+ })++ it('ranLoras writes the field only when LoRAs ran', () => {+ expect(ranLoras([])).toEqual({})+ expect(ranLoras(LORAS)).toEqual({ loras: LORAS })+ })+})diff --git a/src/hooks/__tests__/useCreate-character-chain.test.ts b/src/hooks/__tests__/useCreate-character-chain.test.tsindex ffafe7fe..3c7414bf 100644--- a/src/hooks/__tests__/useCreate-character-chain.test.ts+++ b/src/hooks/__tests__/useCreate-character-chain.test.ts@@ -277,6 +277,8 @@ describe('the character in Image and Edit', () => {expect(seen.builds).toHaveLength(1)expect(imageBuild()?.lora).toEqual(['film_grain.safetensors', CHAR])expect(imageBuild()?.prompt).toBe('mira, walking through the rain')+ // B40: the picture remembers the LoRAs it was made with.+ expect(useCreateStore.getState().gallery[0].loras?.map((l) => l.name)).toEqual(['film_grain.safetensors', CHAR])seen.builds.length = 0on('image', { imageModel: Z_IMAGE, imageModelType: 'zimage' })diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex 168ee8e8..36a50750 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -104,6 +104,7 @@ import { useSettingsStore } from '../stores/settingsStore'import { renderStallLimitMs, renderStallMessage } from '../lib/tool-timeout'import { injectParameters, injectLaneParameters } from '../api/workflows'import { applyEditBatch } from '../api/edit-batch'+import { ranLoras } from '../lib/render/run-settings'import { applyNativeHiresFix, latentDownscale } from '../api/hires-fix'import { editHiresBase } from '../lib/edit-hires'import { lorasForRun, skippedLorasLine } from '../lib/lora-stack'@@ -1232,6 +1233,7 @@ export function useCreate() {createdAt: Date.now(), builderUsed: 'dynamic', intent,...(transparent ? { transparent: true as const } : {}),...(macSkippedNote ? { runNote: macSkippedNote } : {}),+ ...ranLoras(runLoras),})}if (!own.signal.aborted) {@@ -1493,6 +1495,7 @@ export function useCreate() {width: clipSize?.width ?? width, height: clipSize?.height ?? height, batchSize: 1,createdAt: Date.now(), builderUsed: 'dynamic', intent,...(videoSkippedNote ? { runNote: videoSkippedNote } : {}),+ ...ranLoras(videoLoras),})resolve()return@@ -2267,7 +2270,7 @@ export function useCreate() {prompt, ...improveFields, ...transparentFields(), negativePrompt, model: activeModel,modelType: mode === 'image' ? imageModelType : (videoModelsList.find(m => m.name === activeModel)?.type ?? 'wan'),seed: runSeed,- steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize,+ steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize, ...ranLoras(runLoras),createdAt: Date.now(), builderUsed, intent, ...toolFields, ...(skippedNote ? { runNote: skippedNote } : {}),})}@@ -2372,7 +2375,7 @@ export function useCreate() {prompt, ...improveFields, ...transparentFields(), negativePrompt, model: activeModel,modelType: mode === 'image' ? imageModelType : (videoModelsList.find(m => m.name === activeModel)?.type ?? 'wan'),seed: runSeed,- steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize,+ steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize, ...ranLoras(runLoras),createdAt: Date.now(), builderUsed, intent, ...toolFields, ...(skippedNote ? { runNote: skippedNote } : {}),})}@@ -2479,7 +2482,7 @@ export function useCreate() {prompt, ...improveFields, ...transparentFields(), negativePrompt, model: activeModel,modelType: mode === 'image' ? imageModelType : (videoModelsList.find(m => m.name === activeModel)?.type ?? 'wan'),seed: runSeed,- steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize,+ steps, cfgScale, sampler, scheduler, width: outputWidth, height: outputHeight, batchSize, ...ranLoras(runLoras),createdAt: Date.now(), builderUsed, intent, ...toolFields, ...(skippedNote ? { runNote: skippedNote } : {}),})}diff --git a/src/lib/render/run-settings.ts b/src/lib/render/run-settings.tsindex 005c3e4e..62095136 100644--- a/src/lib/render/run-settings.ts+++ b/src/lib/render/run-settings.ts@@ -23,9 +23,15 @@ const NO_SLIDER_INTENTS: ReadonlySet<string> = new Set([])export type RunSettingsSource = Partial<Pick<GalleryItem,- 'type' | 'intent' | 'model' | 'toolModel' | 'negativePrompt' | 'seed' | 'steps' | 'cfgScale' | 'sampler' | 'width' | 'height'+ 'type' | 'intent' | 'model' | 'toolModel' | 'negativePrompt' | 'seed' | 'steps' | 'cfgScale' | 'sampler' | 'width' | 'height' | 'loras'>>+/** B40: the LoRAs of a run, for its gallery entry. Nothing when none ran, so+ * an entry without LoRAs stays as it was. */+export function ranLoras(loras: readonly { name: string; strength: number }[]): Pick<GalleryItem, 'loras'> {+ return loras.length ? { loras: loras.map((l) => ({ name: l.name, strength: l.strength })) } : {}+}+export interface RunSetting {label: stringvalue: string@@ -51,7 +57,7 @@ export function ranNegativePrompt(item: RunSettingsSource): string {return item.negativePrompt?.trim() ?? ''}-/** The settings of a run, in the order they are read: model, steps, CFG,+/** The settings of a run, in the order they are read: model, LoRAs, steps, CFG,* sampler, seed, size. Empty for an entry that carries none (a result from* the chat, which only brings its prompt). */export function runSettings(item: RunSettingsSource): RunSetting[] {@@ -59,6 +65,13 @@ export function runSettings(item: RunSettingsSource): RunSetting[] {const tool = !!item.intent && TOOL_INTENTS.has(item.intent)const model = tool ? item.toolModel : item.modelif (model?.trim()) out.push({ label: 'Model', value: prettyModel(model.trim()) })+ // B40: each LoRA with the strength it ran at, right under the model it+ // steered. A tool runs no diffusion model, so it has none.+ if (!tool) {+ for (const l of item.loras ?? []) {+ if (l?.name?.trim() && Number.isFinite(l.strength)) out.push({ label: 'LoRA', value: `${prettyModel(l.name.trim().split(/[\\/]/).pop() ?? l.name)} · ${cfgText(l.strength)}` })+ }+ }// A track: the model and its seed, the one value a music run takes that// makes it again (the Mac's engine runs its own steps and guidance).if (item.type === 'audio') {diff --git a/src/stores/createStore.ts b/src/stores/createStore.tsindex cb2ec6c9..d7160aaf 100644--- a/src/stores/createStore.ts+++ b/src/stores/createStore.ts@@ -273,6 +273,9 @@ export interface GalleryItem {/** What the run left out of the request, e.g. "Skipping LoRA no longer in* models/loras: style". Shown under the result. */runNote?: string+ /** B40 (3.0.9): the LoRAs the run took, with their strengths. Shown in the+ * settings of the result (lib/render/run-settings). Unset where none ran. */+ loras?: { name: string; strength: number }[]resolvedVAE?: stringresolvedCLIP?: string/** Self-contained media URL for backends that don't serve files over