Skip to content

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.

fix(create): back from video, the image model gets its own settings

purpleb01e8b8c4ac0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e1aae0f..44b51bc7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -76,6 +76,10 @@ cloud catalogue. It also fixes the bugs reported on GitHub and Discord since
"Generation failed".
- **One message while ComfyUI starts.** The red "ComfyUI is not running" no
longer stands next to "ComfyUI is starting up."
+- **Back from Video, the image model gets its own settings.** Image, Edit
+ and the other image modes only switched the mode, so an image model could
+ render with the video model's steps, sampler and size (sd_turbo after
+ MiniMax H3: 20 steps at 1344x768, several plates instead of one).
- **New Chat in Code works like New.** The sidebar button added an empty
"Coding Agent" on every click and reset Bypass to Ask; it now reuses an
untouched session and keeps your mode.
diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.ts
index e321cab1..e5ec6ae7 100644
--- a/src/lib/release-notes.ts
+++ b/src/lib/release-notes.ts
@@ -156,7 +156,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [
},
{
title: 'Fixes from GitHub and Discord.',
- detail: 'A group chat answers with every LU Engine model in it, also when the models sit in your Model Storage folder. Ollama models download without one already installed. A GGUF from the CivitAI search lands where ComfyUI reads it. A fresh ComfyUI install on Windows gets its own Python environment, which fixes "hipdnn_backend.dll Bad Image" on AMD cards. The window no longer disappears on Linux. A character trained on your own machine takes up to 100 photos, and Details on an LM Studio model says where to delete it. A newer image or video model with a missing encoder or VAE names that file and offers the download, instead of ending in "Value not in list". A LoRA deleted from the loras folder leaves the stack, a run only sends LoRAs ComfyUI lists, and Clear turns the stack off. The Code agent runs tool calls a cloud model writes into its answer or sends under the name "function", instead of stopping on them. A downloaded render is always the one you picked, and Download in the gallery strip opens the Save dialog on Windows. Create no longer offers the starter download while ComfyUI is still starting, and Turbo or Lightning checkpoints start at 4 steps. The Code area has an input box even before the first code conversation, and an installed .ckpt model no longer shows as safetensors. A render that left a LoRA out says so under the picture, a Cancel in the download question reads Not started instead of Generation failed, and New Chat in Code no longer adds an empty session.',
+ detail: 'A group chat answers with every LU Engine model in it, also when the models sit in your Model Storage folder. Ollama models download without one already installed. A GGUF from the CivitAI search lands where ComfyUI reads it. A fresh ComfyUI install on Windows gets its own Python environment, which fixes "hipdnn_backend.dll Bad Image" on AMD cards. The window no longer disappears on Linux. A character trained on your own machine takes up to 100 photos, and Details on an LM Studio model says where to delete it. A newer image or video model with a missing encoder or VAE names that file and offers the download, instead of ending in "Value not in list". A LoRA deleted from the loras folder leaves the stack, a run only sends LoRAs ComfyUI lists, and Clear turns the stack off. The Code agent runs tool calls a cloud model writes into its answer or sends under the name "function", instead of stopping on them. A downloaded render is always the one you picked, and Download in the gallery strip opens the Save dialog on Windows. Create no longer offers the starter download while ComfyUI is still starting, and Turbo or Lightning checkpoints start at 4 steps. The Code area has an input box even before the first code conversation, and an installed .ckpt model no longer shows as safetensors. A render that left a LoRA out says so under the picture, a Cancel in the download question reads Not started instead of Generation failed, New Chat in Code no longer adds an empty session, and switching from Video back to Image gives the image model its own settings again.',
},
{
title: 'Writing a long file no longer ends the run.',
diff --git a/src/stores/__tests__/a-turbo-checkpoint-starts-at-four-steps.test.ts b/src/stores/__tests__/a-turbo-checkpoint-starts-at-four-steps.test.ts
index ec1241dd..bccf3734 100644
--- a/src/stores/__tests__/a-turbo-checkpoint-starts-at-four-steps.test.ts
+++ b/src/stores/__tests__/a-turbo-checkpoint-starts-at-four-steps.test.ts
@@ -26,4 +26,30 @@ describe('distilled image checkpoints', () => {
useCreateStore.getState().setImageModel('juggernautXL_v9.safetensors', 'sdxl')
expect(useCreateStore.getState()).toMatchObject({ steps: MODEL_TYPE_DEFAULTS.sdxl.steps, cfgScale: MODEL_TYPE_DEFAULTS.sdxl.cfgScale })
})
+
+ it('back from a MiniMax H3 video, Image gives sd_turbo its own values again (Gegenprobe 9)', () => {
+ const st = useCreateStore.getState()
+ st.setImageModel('sd_turbo.safetensors', 'sd15')
+ useCreateStore.setState({ videoModel: 'MiniMax-H3-test.safetensors' })
+ st.setIntent('video')
+ expect(useCreateStore.getState()).toMatchObject({ mode: 'video', sampler: 'res_multistep', width: 1344, height: 768 })
+ for (const intent of ['image', 'edit', 'removebg', 'upscale', 'eraser', 'character'] as const) {
+ useCreateStore.getState().setIntent('video')
+ useCreateStore.getState().setIntent(intent)
+ expect(useCreateStore.getState(), intent).toMatchObject({
+ mode: 'image', steps: 4, cfgScale: 1,
+ sampler: MODEL_TYPE_DEFAULTS.sd15.sampler, scheduler: MODEL_TYPE_DEFAULTS.sd15.scheduler,
+ width: 512, height: 512,
+ })
+ }
+ })
+
+ it('inside the image lane a switch keeps what the user tuned', () => {
+ const st = useCreateStore.getState()
+ st.setIntent('image')
+ st.setImageModel('sd_turbo.safetensors', 'sd15')
+ useCreateStore.setState({ steps: 9, width: 640 })
+ st.setIntent('edit')
+ expect(useCreateStore.getState()).toMatchObject({ steps: 9, width: 640 })
+ })
})
diff --git a/src/stores/createStore.ts b/src/stores/createStore.ts
index 3b159856..f7086c5b 100644
--- a/src/stores/createStore.ts
+++ b/src/stores/createStore.ts
@@ -579,6 +579,20 @@ export function distilledImageCheckpoint(model: string, type: ModelType): boolea
return /(^|[^a-z])(turbo|lightning|hyper|lcm)([^a-z]|$)/i.test(model.replace(/^.*[\\/]/, ''))
}
+/** The image model's own sampling values. Leaving the video lane has to put
+ * them back: Image, Edit and the other image intents only flipped the mode,
+ * so sd_turbo rendered with MiniMax H3's 20 steps, res_multistep and
+ * 1344x768 (3.0.4 Gegenprobe 9). */
+function imageModelParams(state: { imageModel: string; imageModelType: ModelType }) {
+ const defaults = MODEL_TYPE_DEFAULTS[state.imageModelType] || MODEL_TYPE_DEFAULTS.unknown
+ const distilled = distilledImageCheckpoint(state.imageModel, state.imageModelType)
+ return {
+ steps: distilled ? 4 : defaults.steps, cfgScale: distilled ? 1.0 : defaults.cfgScale,
+ sampler: defaults.sampler, scheduler: defaults.scheduler,
+ width: defaults.width, height: defaults.height,
+ }
+}
+
export const useCreateStore = create<CreateState>()(
persist(
// Explicit param/return types: LU compiles with `strict: true` (the web
@@ -696,16 +710,7 @@ export const useCreateStore = create<CreateState>()(
...(defaults.fps ? { fps: defaults.fps } : {}),
}
}
- if (mode === 'image' && state.imageModel) {
- const defaults = MODEL_TYPE_DEFAULTS[state.imageModelType] || MODEL_TYPE_DEFAULTS.unknown
- const distilled = distilledImageCheckpoint(state.imageModel, state.imageModelType)
- return {
- mode,
- steps: distilled ? 4 : defaults.steps, cfgScale: distilled ? 1.0 : defaults.cfgScale,
- sampler: defaults.sampler, scheduler: defaults.scheduler,
- width: defaults.width, height: defaults.height,
- }
- }
+ if (mode === 'image' && state.imageModel) return { mode, ...imageModelParams(state) }
return { mode }
}),
setImageSubMode: (subMode) => set({ imageSubMode: subMode }),
@@ -781,7 +786,10 @@ export const useCreateStore = create<CreateState>()(
// mirror setMode's reset so image resolution never leaks into video.
// A stale error from the previous intent never carries over.
const dropAll = { source: null, mask: null, sourceSetAt: 0, references: [] }
- const base = { removebg: false, utilityOp: null, cloudOp: null, error: null }
+ // Back from video, the image model gets its own values again; inside
+ // the image lane a switch keeps what the user tuned.
+ const back = s.mode === 'video' && s.imageModel ? imageModelParams(s) : {}
+ const base = { removebg: false, utilityOp: null, cloudOp: null, error: null, ...back }
switch (intent) {
// ── 2.5.8 cloud categories. Inputs specific to each (train set,
// audio, driving video, extend pick) live in their own slots and are