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(trainer): say before the run that the local trainer makes a Z-Image LoRA (GH #210)
purple6c359c84de18
diff --git a/src/api/character-import.ts b/src/api/character-import.tsindex 7ddade2e..1c680bb4 100644--- a/src/api/character-import.ts+++ b/src/api/character-import.ts@@ -38,6 +38,13 @@ export const CLOUD_ONLY_LABEL = 'Cloud only'export const CLOUD_TRAINING_FAMILY_NOTE ='Characters trained on Flux or Qwen run in LU Cloud only. Pick Z-Image to use the character on your machine too.'+/** Under the local trainer (GH #210, 31.10.2026): it trains on Z-Image Base+ * alone, whatever image model is picked at the top. A tester on Qwen-Image+ * 2.1 read the finished Z-Image character as the wrong model trained. */+export function localTrainingFamilyNote(kind: 'character' | 'style'): string {+ return `The local trainer makes a Z-Image ${kind}, whatever image model is picked. Use it with a Z-Image model.`+}+/** The line under a saved import, or null when nothing needs saying. */export function keyFormatNote(format: KeyFormat): string | null {if (format === 'unknown') {diff --git a/src/components/create/experimental/SpecialIntentControls.tsx b/src/components/create/experimental/SpecialIntentControls.tsxindex ab7d9d91..613fb42d 100644--- a/src/components/create/experimental/SpecialIntentControls.tsx+++ b/src/components/create/experimental/SpecialIntentControls.tsx@@ -44,7 +44,7 @@ import { trainerPathPlaceholder } from '../../../lib/trainer-path-placeholder'import { trainerRootHint } from '../../../lib/trainer-root-hint'import { useCreateExp } from './CreateContext'import { CharacterUseLocally } from './CharacterUseLocally'-import { CLOUD_TRAINING_FAMILY_NOTE } from '../../../api/character-import'+import { CLOUD_TRAINING_FAMILY_NOTE, localTrainingFamilyNote } from '../../../api/character-import'import { useLocalPick } from './localPick'import { characterBaseModel, characterRunBlock } from '../../../lib/character-base'import { HINWEIS_TEXT } from '../../../lib/hinweis'@@ -770,6 +770,9 @@ function LocalTrainControls() {</button></div>)}+ {!isGenerating && (+ <div className="t-label text-gray-600 max-w-[560px] text-center" data-testid="local-train-family-note">{localTrainingFamilyNote(trainKind)}</div>+ )}{!isGenerating && trainVramPreset === 'low-vram' && (<div className="t-label text-gray-600 max-w-[560px] text-center" data-testid="low-vram-note">{LOW_VRAM_NOTE}</div>)}diff --git a/src/components/create/experimental/__tests__/lokaler-trainer-nennt-z-image.test.tsx b/src/components/create/experimental/__tests__/lokaler-trainer-nennt-z-image.test.tsxnew file mode 100644index 00000000..09162f67--- /dev/null+++ b/src/components/create/experimental/__tests__/lokaler-trainer-nennt-z-image.test.tsx@@ -0,0 +1,62 @@+// @vitest-environment jsdom+/**+ * GH #210 (31.10.2026, Linux Mint, RX 9070 XT, 3.0.8): with Qwen-Image 2.1+ * picked, Train new made a Z-Image LoRA, and the tester read that as the wrong+ * model trained. The local trainer trains on Z-Image Base alone (musubi, the+ * three TRAINER_BASE_FILES); the picked image model never reaches it. Nothing+ * said so before the run. Now a line under the trainer does.+ */+import { beforeEach, describe, expect, it, vi } from 'vitest'+import { readFileSync } from 'node:fs'+import { resolve } from 'node:path'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'++vi.mock('../../../../api/backend', () => ({+ isTauri: () => true,+ isMacOS: () => false,+ isWindows: () => false,+ isLinux: () => true,+ backendCall: vi.fn(async () => ({ status: 'ok' })),+}))+vi.mock('../../../../api/trainer', async () => {+ const actual = await vi.importActual<typeof import('../../../../api/trainer')>('../../../../api/trainer')+ return {+ ...actual,+ characterTrainerStatus: vi.fn(async () => ({+ envReady: true, basesReady: true, root: '/data/lu/musubi', customized: false, suggestedRoot: null,+ install: { status: 'done', step: '', percent: 100 },+ })),+ installCharacterTrainer: vi.fn(async () => undefined),+ }+})+vi.mock('../../../../api/comfyui', () => ({ getLoraModels: vi.fn(async () => []), getSystemVRAM: vi.fn(async () => null) }))+vi.mock('../../../../hooks/useGraphicsMemory', () => ({ useGraphicsCardGb: () => 16 }))+vi.mock('../../../../api/cloud/loras', () => ({ listLoras: vi.fn(async () => []), deleteLora: vi.fn() }))++import { SpecialControls } from '../SpecialIntentControls'+import { useCreateStore } from '../../../../stores/createStore'++beforeEach(() => {+ cleanup()+ useCreateStore.setState({ backend: 'local', characterTab: 'train', trainKind: 'character', imageModel: 'qwen_image_2.1_fp8.safetensors' } as never)+})++describe('the local trainer says which model it trains', () => {+ it('with Qwen-Image 2.1 picked, the line says the character comes out for Z-Image', async () => {+ render(<SpecialControls intent="character" />)+ const line = await screen.findByTestId('local-train-family-note')+ expect(line.textContent).toBe('The local trainer makes a Z-Image character, whatever image model is picked. Use it with a Z-Image model.')+ })++ it('in style mode it says style', async () => {+ render(<SpecialControls intent="character" />)+ await screen.findByTestId('local-train-family-note')+ fireEvent.click(screen.getByRole('radio', { name: 'Style / concept' }))+ expect(screen.getByTestId('local-train-family-note').textContent).toContain('makes a Z-Image style')+ })++ it('the training call carries no model: Z-Image is the trainer itself, not a lost choice', () => {+ const api = readFileSync(resolve(__dirname, '../../../../api/trainer.ts'), 'utf8')+ expect(api).toContain("backendCall('start_character_training', { setId, name, triggerWord, steps: steps ?? null, preset: preset ?? null, kind: kind ?? null })")+ })+})