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
fix(create): K9 Runde 3 Punkt 2, Shift-Behauptung korrigiert
purpleef0d69d563c0
diff --git a/src/api/__tests__/krea2-sampling-k9.test.ts b/src/api/__tests__/krea2-sampling-k9.test.tsindex f311bc74..2a5b30a1 100644--- a/src/api/__tests__/krea2-sampling-k9.test.ts+++ b/src/api/__tests__/krea2-sampling-k9.test.ts@@ -1,12 +1,24 @@/**- * K9 nachbessert (review-create.md, GH #136, LUSTIFY! v10 Krea2 and- * FinePorn author workflows): Krea 2 is an AuraFlow-family checkpoint, and- * both reported author graphs carry ModelSamplingAuraFlow at shift 4, plus- * ConditioningZeroOut for the negative branch at CFG 1 (the negative prompt- * is a no-op there, so zeroing it out replaces a wasted CLIPTextEncode pass,- * same rule buildDynamicWorkflow already applies to unet_ernie_image).- * Neither node existed on the unet_krea2 path before this fix; the sigma- * schedule the model was actually trained on never applied.+ * K9 nachbessert (review-create.md, GH #136), corrected in Runde 3 after+ * Opus review found the previous version of this test asserted a claim the+ * issue does not make: "both author workflows carry ModelSamplingAuraFlow at+ * shift 4". They do not. The issue documents TWO Krea 2 recipes that+ * disagree on this exact node:+ *+ * - FinePorn v4 NVFP4: the reporter's only PROVEN successful run (Euler,+ * beta, CFG 1, 8 steps), NO ModelSamplingAuraFlow, ComfyUI's own default+ * sampling.+ * - LUSTIFY! v10 Krea2: Euler, simple, CFG 1, 8 steps, PLUS+ * ModelSamplingAuraFlow shift 4 and ConditioningZeroOut.+ *+ * classifyModel cannot tell a LUSTIFY-style checkpoint from a FinePorn-style+ * one (both classify as 'krea2'), so buildDynamicWorkflow no longer forces+ * shift 4 on every krea2 checkpoint: that applied an unevidenced+ * sigma-schedule change to the one variant the issue actually proves works+ * without it. ConditioningZeroOut at CFG 1 stays (Opus: "unkritisch", it+ * only replaces a no-op CLIPTextEncode pass, same rule as unet_ernie_image).+ * MODEL_TYPE_DEFAULTS.krea2's scheduler moved from 'simple' to 'beta' for+ * the same reason: it now defaults to the one PROVEN recipe.** Run: npx vitest run src/api/__tests__/krea2-sampling-k9.test.ts*/@@ -24,6 +36,7 @@ vi.mock('../backend', async (importOriginal) => {import { buildDynamicWorkflow } from '../dynamic-workflow'import { getAllNodeInfo } from '../comfyui-nodes'import { localFetch } from '../backend'+import { MODEL_TYPE_DEFAULTS } from '../comfyui'import { classTypes, nodeOf } from './graph-test-support'const KREA2_NODES = {@@ -42,11 +55,11 @@ const KREA2_NODES = {const baseParams = {model: 'krea2-lustify-v10.safetensors',prompt: 'a red jacket', negativePrompt: '',- sampler: 'euler', scheduler: 'simple',+ sampler: 'euler', scheduler: 'beta',width: 1024, height: 1024, steps: 8, cfgScale: 1, seed: 1, batchSize: 1,} as never-describe('unet_krea2 graph (K9, GH #136)', () => {+describe('unet_krea2 graph (K9, GH #136), corrected Runde 3', () => {beforeEach(() => {vi.clearAllMocks()vi.mocked(getAllNodeInfo).mockResolvedValue(KREA2_NODES as never)@@ -59,18 +72,22 @@ describe('unet_krea2 graph (K9, GH #136)', () => {} as never)})- it('carries ModelSamplingAuraFlow at shift 4, wired between the UNETLoader and KSampler', async () => {+ it('does NOT force ModelSamplingAuraFlow: only one of the two documented recipes uses it, and classifyModel cannot tell them apart', async () => {const wf = await buildDynamicWorkflow(baseParams)- expect(classTypes(wf)).toContain('ModelSamplingAuraFlow')- const [shiftId, shiftNode] = nodeOf(wf, 'ModelSamplingAuraFlow')!- expect(shiftNode.inputs.shift).toBe(4.0)- const [, unetNode] = nodeOf(wf, 'UNETLoader')!- expect(shiftNode.inputs.model).toEqual([Object.entries(wf).find(([, n]) => n === unetNode)![0], 0])+ expect(classTypes(wf)).not.toContain('ModelSamplingAuraFlow')+ // ComfyUI's own default sampling applies: KSampler reads straight off the+ // UNETLoader, the same wiring every other checkpoint-without-a-shift-node+ // strategy uses.+ const [unetId] = nodeOf(wf, 'UNETLoader')!const [, sampler] = nodeOf(wf, 'KSampler')!- expect(sampler.inputs.model).toEqual([shiftId, 0])+ expect(sampler.inputs.model).toEqual([unetId, 0])+ })++ it('MODEL_TYPE_DEFAULTS.krea2 defaults to the PROVEN recipe (FinePorn: beta), not the unproven one (LUSTIFY: simple)', () => {+ expect(MODEL_TYPE_DEFAULTS.krea2.scheduler).toBe('beta')})- it('at CFG 1, the negative branch is ConditioningZeroOut, not CLIPTextEncode', async () => {+ it('at CFG 1, the negative branch is ConditioningZeroOut, not CLIPTextEncode (unaffected by the shift correction)', async () => {const wf = await buildDynamicWorkflow({ ...(baseParams as object), cfgScale: 1 } as never)expect(classTypes(wf)).toContain('ConditioningZeroOut')const [, zeroOut] = nodeOf(wf, 'ConditioningZeroOut')!diff --git a/src/api/comfyui.ts b/src/api/comfyui.tsindex 1d330825..38569e15 100644--- a/src/api/comfyui.ts+++ b/src/api/comfyui.ts@@ -411,8 +411,15 @@ export const MODEL_TYPE_DEFAULTS: Record<string, ModelTypeDefaults> = {sdxl: { steps: 25, cfg: 7.0, sampler: 'dpmpp_2m', scheduler: 'karras', width: 1024, height: 1024, frames: 1, fps: 1 },flux: { steps: 20, cfg: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024, frames: 1, fps: 1 },flux2: { steps: 20, cfg: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024, frames: 1, fps: 1 },- // Krea 2 (GH #136): author workflow runs euler @ CFG 1, 8 steps, 1024x1024.- krea2: { steps: 8, cfg: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024, frames: 1, fps: 1 },+ // Krea 2 (GH #136, corrected Runde 3): the issue documents two author+ // recipes that share nothing but euler / CFG 1 / 8 steps / 1024x1024 -+ // FinePorn v4 NVFP4 (the reporter's only PROVEN successful run) uses+ // scheduler 'beta' and no extra sampling node; LUSTIFY! v10 Krea2 uses+ // 'simple' plus ModelSamplingAuraFlow shift 4 (see buildDynamicWorkflow's+ // unet_krea2 comment). classifyModel cannot tell the two apart, so this+ // default follows the one run the issue actually confirms working rather+ // than guessing at the other.+ krea2: { steps: 8, cfg: 1.0, sampler: 'euler', scheduler: 'beta', width: 1024, height: 1024, frames: 1, fps: 1 },zimage: { steps: 12, cfg: 3.5, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024, frames: 1, fps: 1 },unknown:{ steps: 25, cfg: 7.0, sampler: 'euler', scheduler: 'normal', width: 1024, height: 1024, frames: 1, fps: 1 },// ── Video ──diff --git a/src/api/dynamic-workflow.ts b/src/api/dynamic-workflow.tsindex 8f024f16..56aef424 100644--- a/src/api/dynamic-workflow.ts+++ b/src/api/dynamic-workflow.ts@@ -1016,15 +1016,19 @@ export async function buildDynamicWorkflow(delete workflow[latentId]}- // K9 (GH #136): Krea 2's own AuraFlow-family sampling shift. Both author- // workflows in the issue (FinePorn, LUSTIFY! v10 Krea2) carry- // ModelSamplingAuraFlow at shift 4; without it the sigma schedule the model- // was trained on never applies.- if (strategy === 'unet_krea2') {- const shiftId = String(n++)- workflow[shiftId] = { class_type: 'ModelSamplingAuraFlow', inputs: { model: [samplerModelId, 0], shift: 4.0 } }- samplerModelId = shiftId- }+ // K9 (GH #136), corrected Runde 3 after review: the issue documents TWO+ // Krea 2 author recipes that disagree on this exact node. LUSTIFY! v10+ // Krea2 carries ModelSamplingAuraFlow at shift 4; FinePorn v4 NVFP4, the+ // reporter's only run he actually PROVED working end to end, used NO such+ // node and ComfyUI's own default sampling. classifyModel cannot tell a+ // LUSTIFY-style checkpoint from a FinePorn-style one (both classify as+ // 'krea2'), so forcing shift 4 on every one of them - what this branch+ // used to do - applied an unevidenced sigma-schedule change to the one+ // variant the issue actually proves works without it. Deliberately absent:+ // no ModelSamplingAuraFlow node, ComfyUI's built-in default applies,+ // matching the proven recipe. If a future signal can tell the two variants+ // apart (filename convention, a CivitAI metadata field, ...), gate this+ // node on that signal rather than reintroducing it unconditionally.// ─── Phase 4: Sampling ───diff --git a/src/stores/createStore.ts b/src/stores/createStore.tsindex a3e7f33f..5217771d 100644--- a/src/stores/createStore.ts+++ b/src/stores/createStore.ts@@ -116,9 +116,11 @@ export const MODEL_TYPE_DEFAULTS: Record<ModelType, {sdxl: { steps: 25, cfgScale: 7.0, sampler: 'dpmpp_2m', scheduler: 'karras', width: 1024, height: 1024 },flux: { steps: 20, cfgScale: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024 },flux2: { steps: 20, cfgScale: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024 },- // K9 (GH #136): mirrors comfyui.ts's MODEL_TYPE_DEFAULTS.krea2 (author- // workflow: euler, CFG 1, 8 steps, 1024x1024).- krea2: { steps: 8, cfgScale: 1.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024 },+ // K9 (GH #136, corrected Runde 3): mirrors comfyui.ts's+ // MODEL_TYPE_DEFAULTS.krea2 - scheduler 'beta', the reporter's only+ // PROVEN successful run (FinePorn v4 NVFP4), not the unproven 'simple'+ // this used to copy from the OTHER author's recipe (LUSTIFY! v10 Krea2).+ krea2: { steps: 8, cfgScale: 1.0, sampler: 'euler', scheduler: 'beta', width: 1024, height: 1024 },zimage: { steps: 12, cfgScale: 3.5, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024 },ernie_image: { steps: 20, cfgScale: 4.0, sampler: 'euler', scheduler: 'simple', width: 1024, height: 1024 },wan: { steps: 25, cfgScale: 5.0, sampler: 'euler', scheduler: 'normal', width: 848, height: 480, frames: 49, fps: 16 },