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(music): the cloud Music tab follows the model, length slider and text fields
purple52e3dc76ae94
diff --git a/src/components/create/experimental/Composer.tsx b/src/components/create/experimental/Composer.tsxindex 0abb483b..68a8435e 100644--- a/src/components/create/experimental/Composer.tsx+++ b/src/components/create/experimental/Composer.tsx@@ -21,6 +21,7 @@ import { effectiveVideoDurations, snapToVideoDuration } from '../../../lib/rendeimport { mediaSeconds, useStudioPrice } from './useStudioPrice'import { getJob } from '../../../api/cloud/jobs'import { INTENT_MAP, intentTakesPrompt } from './intents'+import { MUSIC_PLACEHOLDER, musicText } from '../../../lib/render/music-ui'import { subscribeInstallRuns, getInstallRun } from '../../../lib/model-install-runs'import { useWorkflowStore, shouldShowManagerNotice } from '../../../stores/workflowStore'import { noPromptHint, shouldShowLaneHint } from './laneHint'@@ -303,7 +304,11 @@ export function Composer({ onOpenAdvanced, onOpenWorkflows }: Props) {// cloud model requires a mask.: (intent === 'edit' && needsMask? 'Describe the new look. Paint an area first to tell it what to change…'- : meta.placeholder)+ // Cloud music: the field asks for what the model does+ // with it, a description or the lyrics it sings.+ : intent === 'music' && backend === 'cloud'+ ? MUSIC_PLACEHOLDER[musicText(runModel).main]+ : meta.placeholder)}onSubmit={() => canGenerate && !isGenerating && guardedGenerate()}/>diff --git a/src/components/create/experimental/ImproveToggle.tsx b/src/components/create/experimental/ImproveToggle.tsxindex e0b06e39..4f918b35 100644--- a/src/components/create/experimental/ImproveToggle.tsx+++ b/src/components/create/experimental/ImproveToggle.tsx@@ -1,6 +1,8 @@import { Wand2 } from 'lucide-react'import { useCreateStore } from '../../../stores/createStore'import { improveKindForIntent } from '../../../lib/render/improve-prompt'+import { improveKindForRun } from '../../../lib/render/music-ui'+import { createRunModel } from '../../../lib/render/create-studio'import { useImproveAvailability } from '../../../lib/render/improve-prompt-run'import { QWEN_ENHANCER_HINT, activeWriter, improveWriters } from '../../../lib/render/qwen-enhancer'import { isMlxImageHost } from '../../../api/mlx-image'@@ -10,19 +12,23 @@ import { cn } from '../ui/cn'// "Improve my prompt": a switch in the advanced settings. It never sits in or// above the prompt field. Off by default and remembered. Shown only on the-// tools that write a prompt for an image, a clip or a track.+// tools that write a prompt for an image, a clip or a track, and never where+// the prompt is the lyrics of a song.//// On a local Qwen-Image 2.1 with a prompt enhancer installed the enhancer// writes instead of the chat model, for a new picture and for an edit, and a// row under the switch lets the user pick who writes. Same switch, same place.export function ImproveToggle() {const intent = useCreateStore((s) => s.intent())- const kind = improveKindForIntent(intent)+ const backend = useCreateStore((s) => s.backend)+ // Cloud music asks the model: a text field that carries lyrics is never+ // rewritten. Local music keeps the prompt as the style for every checkpoint.+ const musicModel = useCreateStore((s) => createRunModel('music', { image: '', video: '', op: s.cloudOpModel }))+ const kind = backend === 'cloud' ? improveKindForRun(intent, musicModel) : improveKindForIntent(intent)const on = useCreateStore((s) => s.improvePrompt)const setOn = useCreateStore((s) => s.setImprovePrompt)const choice = useCreateStore((s) => s.improveWith)const setChoice = useCreateStore((s) => s.setImproveWith)- const backend = useCreateStore((s) => s.backend)const imageModel = useCreateStore((s) => s.imageModel)const imageModelList = useCreateStore((s) => s.imageModelList)const textEncoders = useCreateStore((s) => s.textEncoderList)diff --git a/src/components/create/experimental/SchemaControl.tsx b/src/components/create/experimental/SchemaControl.tsxindex 2bf0fb99..fb990307 100644--- a/src/components/create/experimental/SchemaControl.tsx+++ b/src/components/create/experimental/SchemaControl.tsx@@ -54,12 +54,14 @@ function Feldname({ text }: { text: string }) {return <span className="t-control text-gray-400">{text}</span>}-export function SchemaControl({ name, schema, value, onChange, disabled, className }: {+export function SchemaControl({ name, schema, value, onChange, disabled, className, title }: {name: string; schema: Schema; value: unknown; onChange: (v: unknown) => void; disabled: boolean; className?: string+ /** What the field is called where the schema's own name misleads. */+ title?: string}) {const fieldClass = className ?? baseFieldClassconst current = value ?? schema.default ?? (schema.type === 'boolean' ? false : '')- const titel = name === 'preset' ? 'Style preset' : label(name)+ const titel = title ?? (name === 'preset' ? 'Style preset' : label(name))if (schema.type === 'array' && name === 'loras') {const rows = (Array.isArray(value) ? value : []) as { path: string; scale?: number }[]diff --git a/src/components/create/experimental/SpecialIntentControls.tsx b/src/components/create/experimental/SpecialIntentControls.tsxindex 456a1fbe..d4361139 100644--- a/src/components/create/experimental/SpecialIntentControls.tsx+++ b/src/components/create/experimental/SpecialIntentControls.tsx@@ -23,7 +23,8 @@ import { startModelDownload, getDownloadProgress, catalogDigestFor } from '../..import { useDownloadStore } from '../../../stores/downloadStore'import { getLoraModels } from '../../../api/comfyui'import { isWindows, isMacOS } from '../../../api/backend'-import { musicTakesLyrics, musicHowtoLines } from '../../../lib/render/music-ui'+import { LOCAL_MUSIC_TEXT, SECONDS_LENGTH, musicHowtoLines, musicLength, musicText } from '../../../lib/render/music-ui'+import { createRunModel, studioShownValue } from '../../../lib/render/create-studio'import { galleryLabelShort } from '../../../lib/render/gallery-label'import { TRAIN_PRESETS, trainStepsNote } from '../../../lib/trainer-presets'import { trainerPathPlaceholder } from '../../../lib/trainer-path-placeholder'@@ -896,53 +897,79 @@ function MusicControls() {const setMusicLyrics = useCreateStore((s) => s.setMusicLyrics)const cloudOpModel = useCreateStore((s) => s.cloudOpModel)const isCloud = useCreateStore((s) => s.backend) === 'cloud'- // Cloud: only ace-step-1.5 has a lyrics input on the wire (catalog `lyrics`- // flag); the other music endpoints write their own lyrics from the prompt,- // so offering the box there would be a lie.- // Local: every music checkpoint runs through buildMusicWorkflow, which feeds- // `lyrics` straight into the ACE-Step encoder. Asking the CLOUD catalog about- // a local checkpoint returns undefined, which is how the local tab ended up- // hiding the lyrics box and claiming the model writes its own, while sitting- // on the one model that sings yours (#108, ElBiggus).- const canLyrics = musicTakesLyrics(- isCloud ? 'cloud' : 'local',- cloudModelById(modelForOp('audio', 'music', cloudOpModel))?.lyrics === true,- )- const howtoLines = musicHowtoLines(isCloud ? 'cloud' : 'local')const musicHowtoSeen = useCreateStore((s) => s.musicHowtoSeen)const setMusicHowtoSeen = useCreateStore((s) => s.setMusicHowtoSeen)- const [lyricsOpen, setLyricsOpen] = useState(musicLyrics.length > 0)const [howtoOpen, setHowtoOpen] = useState(false)+ // The catalog decides which models the picker holds, so this surface redraws+ // when it arrives.+ useCloudCatalogStore((s) => s.models)+ const model = createRunModel('music', { image: '', video: '', op: cloudOpModel })+ const studioOptions = useCreateStore((s) => s.cloudStudioOptions)+ const setStudioOptions = useCreateStore((s) => s.setCloudStudioOptions)+ // Cloud: which text goes where is the model's own business. For most the+ // prompt is the style and a few take lyrics next to it, for Mureka Song and+ // YuE2 the prompt IS the lyrics and the style sits next to it. The second+ // text is offered wherever the model reads one, under its real name.+ // Local: every music checkpoint runs through buildMusicWorkflow, which feeds+ // the lyrics box straight into the encoder. Asking the CLOUD catalog about a+ // local checkpoint is how the local tab once hid the box while sitting on+ // the one model that sings yours (#108, ElBiggus).+ const text = isCloud ? musicText(model) : LOCAL_MUSIC_TEXT+ const second = text.second+ const secondValue = !second ? '' : second.option+ ? String(studioShownValue(model, studioOptions, second.option) ?? '')+ : musicLyrics+ const setSecondValue = (v: string) => {+ if (!second) return+ if (second.option) setStudioOptions({ ...studioOptions, [second.option]: v === '' ? undefined : v })+ else setMusicLyrics(v)+ }+ const [secondOpen, setSecondOpen] = useState(musicLyrics.length > 0)+ // The length slider stands only where the run reads a length, and sets the+ // field the run sends: the store's seconds for a local or a classic cloud+ // model, the model's own option for a Studio one (the same option the price+ // is computed from).+ const length = isCloud ? musicLength(model) : SECONDS_LENGTH+ const lengthOption = length?.option+ const seconds = length && lengthOption+ ? Math.round(Number(studioShownValue(model, studioOptions, lengthOption)) / length.perSecond)+ : musicDuration+ const howtoLines = musicHowtoLines(isCloud ? 'cloud' : 'local', { text, length })return (<div className="space-y-2"><div className="flex items-center justify-center gap-3">- <div className="w-56">- <Slider- label="Length"- min={5}- max={240}- step={5}- value={musicDuration}- onChange={setMusicDuration}- format={(v) => `${Math.floor(v / 60)}:${String(v % 60).padStart(2, '0')}`}- />- </div>- {canLyrics ? (+ {length && (+ <div className="w-56">+ <Slider+ label="Length"+ min={length.min}+ max={length.max}+ step={length.step}+ value={Math.max(length.min, Math.min(length.max, seconds))}+ onChange={(v) => (lengthOption+ ? setStudioOptions({ ...studioOptions, [lengthOption]: v * length.perSecond })+ : setMusicDuration(v))}+ format={(v) => `${Math.floor(v / 60)}:${String(v % 60).padStart(2, '0')}`}+ />+ </div>+ )}+ {second ? (<button- onClick={() => setLyricsOpen((o) => !o)}+ onClick={() => setSecondOpen((o) => !o)}+ aria-expanded={secondOpen}className={cn('t-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',- lyricsOpen+ secondOpen? 'bg-white/[0.06] border-white/10 text-gray-200': 'bg-white/[0.03] border-white/[0.06] text-gray-400 hover:text-gray-200',)}>- <Music2 size={12} /> Lyrics+ <Music2 size={12} /> {second.is === 'lyrics' ? 'Lyrics' : 'Style'}</button>) : (<span className="t-control text-gray-500">- This model writes its own lyrics from the prompt. Pick ACE-Step 1.5 to sing yours.+ {text.main === 'lyrics' ? 'This model sings the lyrics you write.' : 'This model writes its own lyrics from the prompt.'}</span>)}<div className="relative">@@ -976,7 +1003,8 @@ function MusicControls() {<div className="t-control px-3 py-2 rounded-md bg-white/[0.03] border border-white/[0.06] text-gray-400 space-y-1 text-left">{/* Copy lives in music-ui.ts so the claims are asserted, noteyeballed. The local panel used to promise other downloadable- models and per-second billing (#108). */}+ models and per-second billing (#108), the cloud panel follows+ the model on screen. */}{howtoLines.map((line, i) => (<p key={i} className={i === 0 ? 'text-gray-200' : undefined}>{line}</p>))}@@ -985,7 +1013,7 @@ function MusicControls() {)}</AnimatePresence><AnimatePresence>- {canLyrics && lyricsOpen && (+ {second && secondOpen && (<motion.divinitial={{ height: 0, opacity: 0 }}animate={{ height: 'auto', opacity: 1 }}@@ -993,10 +1021,13 @@ function MusicControls() {className="overflow-hidden"><textarea- value={musicLyrics}- onChange={(e) => setMusicLyrics(e.target.value)}- placeholder="Your lyrics. [Verse] and [Chorus] markers make them sing best…"- rows={3}+ value={secondValue}+ onChange={(e) => setSecondValue(e.target.value)}+ aria-label={second.is === 'lyrics' ? 'Lyrics' : 'Style'}+ placeholder={second.is === 'lyrics'+ ? 'Your lyrics. [Verse] and [Chorus] markers make them sing best…'+ : 'Genre, mood, tempo, voice…'}+ rows={second.is === 'lyrics' ? 3 : 1}className="w-full t-control px-2.5 py-1.5 rounded-md bg-white/[0.03] border border-white/[0.06] text-gray-200 placeholder-gray-600 focus:outline-none focus:border-white/15 resize-none"/></motion.div>diff --git a/src/components/create/experimental/Stage.tsx b/src/components/create/experimental/Stage.tsxindex ee517c60..3b48b435 100644--- a/src/components/create/experimental/Stage.tsx+++ b/src/components/create/experimental/Stage.tsx@@ -2,6 +2,8 @@ import { useRef, useState, useSyncExternalStore } from 'react'import { motion, AnimatePresence } from 'framer-motion'import { UploadCloud, ImagePlus, Scissors, Wand2, Sparkles, X, Loader2, Download, AlertTriangle, Image as ImageIcon, Film } from 'lucide-react'import { useCreateStore, type GalleryItem } from '../../../stores/createStore'+import { createRunModel } from '../../../lib/render/create-studio'+import { musicText } from '../../../lib/render/music-ui'import { useCreateExp } from './CreateContext'import { INTENT_MAP } from './intents'import { editNeedsMask, defaultCloudModel, modelForOp } from '../../../stores/cloudCatalogStore'@@ -108,6 +110,12 @@ export function Stage({ displayed, onOpenMaskEditor, onEditResult, onAnimateResuconst characterTab = useCreateStore((s) => s.characterTab)const characterTrain = intent === 'character' && characterTab === 'train'+ // The example chips of Music are style descriptions. Where the prompt of a+ // cloud model is the lyrics, a chip would be sung word for word, so that+ // model shows none. Local music keeps them: its prompt is always the style.+ const musicIsLyrics = useCreateStore((s) =>+ s.backend === 'cloud' && musicText(createRunModel('music', { image: '', video: '', op: s.cloudOpModel })).main === 'lyrics')+ const examples = intent === 'music' && musicIsLyrics ? [] : meta.examples// A bundle is not usable until ALL of its files are down, and the lane list// refills the moment the diffusion model alone lands. Measured on the box@@ -161,9 +169,9 @@ export function Stage({ displayed, onOpenMaskEditor, onEditResult, onAnimateResu// Weiss — den Text daneben faengt `index.css:863-868` ab, das Bild nicht.body = (<EmptyState icon={Sparkles} logoSrc={MONOGRAM} logoClassName={MONOGRAM_INVERT} title={teachTitle(intent)}>- {meta.examples.length > 0 && (+ {examples.length > 0 && (<div className="flex flex-wrap justify-center gap-1.5 pt-1">- {meta.examples.map((ex) => (+ {examples.map((ex) => (<buttonkey={ex}onClick={() => setPrompt(ex)}diff --git a/src/components/create/experimental/StudioParams.tsx b/src/components/create/experimental/StudioParams.tsxindex 45f5b012..49ec7851 100644--- a/src/components/create/experimental/StudioParams.tsx+++ b/src/components/create/experimental/StudioParams.tsx@@ -10,6 +10,8 @@ import { useCreateStore } from '../../../stores/createStore'import { SchemaControl, isCompactField, studioFieldsInOrder } from './SchemaControl'import { modelHint, modelLabel } from '../../../lib/render/preset-models'import { studioShownValue } from '../../../lib/render/create-studio'+import { STUDIO_MODELS } from '../../../lib/render/studio-contract'+import { musicText } from '../../../lib/render/music-ui'export function StudioParams({ model }: { model: string }) {const options = useCreateStore((s) => s.cloudStudioOptions)@@ -17,6 +19,9 @@ export function StudioParams({ model }: { model: string }) {const isGenerating = useCreateStore((s) => s.isGenerating)const fields = studioFieldsInOrder(model)const hint = modelHint(model)+ // Mureka Song calls its style field "prompt" while the prompt field carries+ // the lyrics. The control is named for what it does.+ const styleOption = STUDIO_MODELS[model]?.kind === 'audio' ? musicText(model).second : nullreturn (<div className="px-1 py-3">{/* Eine Ueberschrift, damit die Klappe sagt, wessen Einstellungen das@@ -33,6 +38,7 @@ export function StudioParams({ model }: { model: string }) {<div key={key} className={isCompactField(schema) ? undefined : 'col-span-2'}><SchemaControlname={key}+ title={styleOption?.option === key ? (styleOption.is === 'style' ? 'Style' : 'Lyrics') : undefined}schema={schema}value={studioShownValue(model, options, key)}disabled={isGenerating}diff --git a/src/components/create/experimental/__tests__/musik-felder.test.tsx b/src/components/create/experimental/__tests__/musik-felder.test.tsxnew file mode 100644index 00000000..f9f84099--- /dev/null+++ b/src/components/create/experimental/__tests__/musik-felder.test.tsx@@ -0,0 +1,267 @@+// @vitest-environment jsdom+/**+ * Fund M2 und M1 (05.10.2026, Vorlagen: apps/web/components/create/+ * experimental/__tests__/musik-laenge.test.tsx und+ * musik-liedtext-und-stil.test.tsx).+ *+ * M2: der Laengen-Regler in Musik stand bei jedem Modell da, wirkte bei den+ * vier Studio-Musikmodellen aber nicht. Er steht nur, wo das Modell eine Laenge+ * liest, und setzt genau das Feld, das der Lauf schickt und aus dem der Preis+ * rechnet.+ *+ * M1: bei Mureka Song und YuE2 ist das grosse Textfeld laut Schema der+ * Liedtext. Die Oberflaeche sagte "Describe the track" und behauptete, das+ * Modell schreibe den Text selbst. Beschriftung, Hinweis und das zweite+ * Textfeld kommen aus dem Schema des gewaehlten Modells.+ *+ * Lokal bleibt alles, wie es war: Regler von 5 Sekunden bis 4 Minuten, der+ * Prompt ist der Stil, der Liedtext-Kasten steht immer da.+ */+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'+import { render, cleanup, screen, fireEvent } from '@testing-library/react'++vi.mock('../CreateContext', () => ({+ useCreateExp: () => ({+ generate: vi.fn(), cancel: vi.fn(), makeVoice: vi.fn(), quota: null,+ samplerList: [], schedulerList: [], loraList: [], vaeList: [], refreshModelLists: vi.fn(),+ connected: true, modelsLoaded: true, modelLoadError: null, mlxMissing: false,+ installCapability: vi.fn(), installModelBundle: vi.fn(),+ }),+}))+vi.mock('../../../../api/mlx-image', () => ({ isMlxImageHost: () => false }))+vi.mock('../../../../api/backend', async (orig) => ({+ ...((await orig()) as Record<string, unknown>),+ openExternal: vi.fn(),+}))++import { SpecialControls } from '../SpecialIntentControls'+import { Composer } from '../Composer'+import { Stage } from '../Stage'+import { StudioParams } from '../StudioParams'+import { ImproveToggle } from '../ImproveToggle'+import { useCreateStore } from '../../../../stores/createStore'+import { useCloudCatalogStore } from '../../../../stores/cloudCatalogStore'+import { neuerServer } from '../../../../lib/render/__tests__/fixtures/test-catalogs'+import { MUSIC_PLACEHOLDER, improveKindForRun, musicLength, musicText } from '../../../../lib/render/music-ui'+import { intentPickerModels } from '../../../../lib/render/create-studio'+import { STUDIO_MODELS, studioFields, studioOptions, studioPreviewCredits, studioSchema } from '../../../../lib/render/studio-contract'+import { INTENT_MAP } from '../intents'++const range = (c: HTMLElement) => c.querySelector('input[type=range]') as HTMLInputElement | null++function pick(model: string) {+ const s = useCreateStore.getState()+ s.setIntent('music'); s.setCloudOpModel(model)+}+function musik(model: string) {+ pick(model)+ return render(<SpecialControls intent="music" />)+}+function composer(model: string) {+ pick(model)+ return render(<Composer onOpenAdvanced={() => {}} onOpenWorkflows={() => {}} />)+}++beforeEach(() => {+ useCloudCatalogStore.setState({ models: neuerServer() })+ useCreateStore.setState({+ backend: 'cloud', isGenerating: false, error: null, cloudStudioOptions: {}, cloudOpModel: '', cloudOpPicks: {},+ musicDuration: 30, musicLyrics: '', improvePrompt: false, gallery: [], audioModelList: [],+ })+ useCreateStore.getState().setPrompt('')+})+afterEach(cleanup)++describe('Laengen-Regler in Musik', () => {+ it('ElevenLabs Music: der Regler setzt das Millisekunden-Feld in dessen Grenzen', () => {+ const { container } = musik('eleven-music')+ const r = range(container)!+ expect(screen.getByText('Length')).toBeTruthy()+ expect([r.min, r.max]).toEqual(['5', '600'])+ // Ohne Zutun steht dort, was der Lauf schickt: 30 Sekunden.+ expect(r.value).toBe('30')+ expect(screen.getByText('0:30')).toBeTruthy()+ fireEvent.change(r, { target: { value: '180' } })+ const options = useCreateStore.getState().cloudStudioOptions+ expect(options).toEqual({ music_length_ms: 180000 })+ expect(useCreateStore.getState().musicDuration).toBe(30)+ // Anfrage und Preis lesen dasselbe Feld: drei angefangene Minuten.+ expect(studioOptions('eleven-music', 'x', options).music_length_ms).toBe(180000)+ expect(studioPreviewCredits('eleven-music', options)).toBe(3 * studioPreviewCredits('eleven-music', {})!)+ })++ it('MiniMax Music, Mureka Song und YuE2 kennen keine Laenge und zeigen keinen Regler', () => {+ for (const model of ['minimax-music', 'mureka-song', 'yue2']) {+ const { container, unmount } = musik(model)+ expect(screen.queryByText('Length'), model).toBeNull()+ expect(range(container), model).toBeNull()+ unmount()+ }+ })++ it('ein klassisches Modell behaelt seinen Regler in Sekunden', () => {+ const { container } = musik('ace-step-1.5')+ const r = range(container)!+ expect([r.min, r.max]).toEqual(['5', '240'])+ fireEvent.change(r, { target: { value: '120' } })+ expect(useCreateStore.getState().musicDuration).toBe(120)+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({})+ })++ it('jedes Musikmodell im Waehler: Regler genau dann, wenn sein Schema eine Laenge traegt', () => {+ const models = intentPickerModels('music')+ expect(models.some((m) => STUDIO_MODELS[m.id])).toBe(true)+ for (const m of models) {+ const studio = STUDIO_MODELS[m.id]+ const length = musicLength(m.id)+ if (!studio) { expect(length?.option, m.id).toBeUndefined(); expect(length, m.id).not.toBeNull(); continue }+ const field = Object.keys(studioFields(m.id)).find((k) => /length|duration/.test(k))+ expect(length?.option, m.id).toBe(field)+ }+ })++ it('lokal bleibt der Regler von 5 Sekunden bis 4 Minuten, auch wenn die Cloud-Wahl keine Laenge kennt', () => {+ pick('mureka-song')+ useCreateStore.setState({ backend: 'local', cloudStudioOptions: {} })+ const { container } = render(<SpecialControls intent="music" />)+ const r = range(container)!+ expect([r.min, r.max]).toEqual(['5', '240'])+ fireEvent.change(r, { target: { value: '90' } })+ expect(useCreateStore.getState().musicDuration).toBe(90)+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({})+ })+})++describe('welcher Text wohin gehoert, je Modell aus dem Schema', () => {+ it('jedes Musikmodell: Hauptfeld und zweites Feld stimmen mit seinem Schema', () => {+ for (const m of intentPickerModels('music')) {+ const text = musicText(m.id)+ const studio = STUDIO_MODELS[m.id]+ if (!studio) { expect(text.main, m.id).toBe('style'); continue }+ expect(text.main, m.id).toBe((studio.promptField ?? 'prompt') === 'lyrics' ? 'lyrics' : 'style')+ if (text.second) {+ expect(text.second.option, m.id).not.toBe(studio.promptField ?? 'prompt')+ expect(studioSchema(m.id).properties?.[text.second.option!]?.type, m.id).toBe('string')+ }+ }+ expect(musicText('mureka-song')).toEqual({ main: 'lyrics', second: { is: 'style', option: 'prompt' } })+ expect(musicText('yue2')).toEqual({ main: 'lyrics', second: { is: 'style', option: 'style' } })+ expect(musicText('minimax-music')).toEqual({ main: 'style', second: { is: 'lyrics', option: 'lyrics' } })+ expect(musicText('eleven-music')).toEqual({ main: 'style', second: null })+ expect(musicText('ace-step-1.5')).toEqual({ main: 'style', second: { is: 'lyrics' } })+ expect(musicText('ace-step')).toEqual({ main: 'style', second: null })+ })++ it('Mureka Song und YuE2: das Feld fragt nach dem Liedtext, nicht nach einer Beschreibung', () => {+ for (const model of ['mureka-song', 'yue2']) {+ const { unmount } = composer(model)+ expect(screen.getByPlaceholderText(MUSIC_PLACEHOLDER.lyrics), model).toBeTruthy()+ expect(screen.queryByPlaceholderText(MUSIC_PLACEHOLDER.style), model).toBeNull()+ expect(screen.queryByText(/writes its own lyrics/), model).toBeNull()+ expect(screen.getByRole('button', { name: 'Style' }), model).toBeTruthy()+ unmount()+ }+ })++ it('ein Modell, das den Stil liest, fragt weiter nach der Beschreibung', () => {+ composer('eleven-music')+ expect(INTENT_MAP.music.placeholder).toBe(MUSIC_PLACEHOLDER.style)+ expect(screen.getByPlaceholderText(MUSIC_PLACEHOLDER.style)).toBeTruthy()+ expect(screen.getByText('This model writes its own lyrics from the prompt.')).toBeTruthy()+ expect(screen.queryByRole('button', { name: 'Lyrics' })).toBeNull()+ })++ it('YuE2: das Stilfeld zeigt den Stil, der sonst still mitgeht, und schreibt in dessen Option', () => {+ musik('yue2')+ fireEvent.click(screen.getByRole('button', { name: 'Style' }))+ const feld = screen.getByLabelText('Style') as HTMLTextAreaElement+ expect(feld.value).toBe(STUDIO_MODELS.yue2.defaults.style)+ fireEvent.change(feld, { target: { value: 'slow jazz, smoky female vocals' } })+ const options = useCreateStore.getState().cloudStudioOptions+ expect(options).toEqual({ style: 'slow jazz, smoky female vocals' })+ expect(studioOptions('yue2', '[Verse]\nla la', options).style).toBe('slow jazz, smoky female vocals')+ })++ it('Mureka Song: der Stil geht in das Feld, das der Anbieter "prompt" nennt', () => {+ musik('mureka-song')+ fireEvent.click(screen.getByRole('button', { name: 'Style' }))+ fireEvent.change(screen.getByLabelText('Style'), { target: { value: 'dreamy lofi' } })+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({ prompt: 'dreamy lofi' })+ })++ it('Mureka Song: auch die Klappe nennt das Feld Style und nicht Prompt', () => {+ render(<StudioParams model="mureka-song" />)+ expect(screen.getByLabelText('Style')).toBeTruthy()+ expect(screen.queryByLabelText('Prompt')).toBeNull()+ })++ it('MiniMax Music: der eigene Liedtext geht in die Option lyrics, nicht in den klassischen Kasten', () => {+ musik('minimax-music')+ fireEvent.click(screen.getByRole('button', { name: 'Lyrics' }))+ fireEvent.change(screen.getByLabelText('Lyrics'), { target: { value: '[Verse]\nla la' } })+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({ lyrics: '[Verse]\nla la' })+ expect(useCreateStore.getState().musicLyrics).toBe('')+ })++ it('ACE-Step 1.5 behaelt seinen Liedtext-Kasten', () => {+ musik('ace-step-1.5')+ fireEvent.click(screen.getByRole('button', { name: 'Lyrics' }))+ fireEvent.change(screen.getByLabelText('Lyrics'), { target: { value: 'la la' } })+ expect(useCreateStore.getState().musicLyrics).toBe('la la')+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({})+ })++ it('lokal: der Prompt bleibt der Stil und der Liedtext-Kasten steht immer da, was auch immer die Cloud-Wahl ist', () => {+ pick('mureka-song')+ useCreateStore.setState({ backend: 'local', cloudStudioOptions: {} })+ render(<Composer onOpenAdvanced={() => {}} onOpenWorkflows={() => {}} />)+ expect(screen.getByPlaceholderText(MUSIC_PLACEHOLDER.style)).toBeTruthy()+ expect(screen.queryByRole('button', { name: 'Style' })).toBeNull()+ fireEvent.click(screen.getByRole('button', { name: 'Lyrics' }))+ fireEvent.change(screen.getByLabelText('Lyrics'), { target: { value: 'la la' } })+ expect(useCreateStore.getState().musicLyrics).toBe('la la')+ expect(useCreateStore.getState().cloudStudioOptions).toEqual({})+ })+})++describe('Improve my prompt', () => {+ it('ein Liedtext-Feld bekommt keine Umschreibung, ein Stil-Feld schon', () => {+ expect(improveKindForRun('music', 'mureka-song')).toBeNull()+ expect(improveKindForRun('music', 'yue2')).toBeNull()+ expect(improveKindForRun('music', 'eleven-music')).toBe('music')+ expect(improveKindForRun('music', 'ace-step-1.5')).toBe('music')+ expect(improveKindForRun('image', 'mureka-song')).toBe('image')+ expect(improveKindForRun('lipsync', 'x')).toBeNull()+ })++ it('der Schalter steht in der Cloud bei einem Liedtext-Modell nicht in der Klappe, lokal immer', () => {+ pick('mureka-song')+ const a = render(<ImproveToggle />)+ expect(screen.queryByText('Improve my prompt')).toBeNull()+ a.unmount()+ pick('eleven-music')+ const b = render(<ImproveToggle />)+ expect(screen.getByText('Improve my prompt')).toBeTruthy()+ b.unmount()+ pick('mureka-song')+ useCreateStore.setState({ backend: 'local' })+ render(<ImproveToggle />)+ expect(screen.getByText('Improve my prompt')).toBeTruthy()+ })++ it('die Stil-Beispiele stehen in der Cloud nicht da, wo sie gesungen wuerden', () => {+ const BEISPIEL = INTENT_MAP.music.examples[0]+ const stage = () => render(<Stage onOpenMaskEditor={() => {}} onFullscreen={() => {}} />)+ pick('eleven-music')+ const a = stage()+ expect(screen.getByText(BEISPIEL)).toBeTruthy()+ a.unmount()+ pick('mureka-song')+ const b = stage()+ expect(screen.queryByText(BEISPIEL)).toBeNull()+ b.unmount()+ useCreateStore.setState({ backend: 'local', audioModelList: [{ name: 'yue2_3b_int8_convrot.safetensors', type: 'ace' }] } as never)+ stage()+ expect(screen.getByText(BEISPIEL)).toBeTruthy()+ })+})diff --git a/src/components/create/experimental/intents.ts b/src/components/create/experimental/intents.tsindex 26ebb888..de2ecb89 100644--- a/src/components/create/experimental/intents.ts+++ b/src/components/create/experimental/intents.ts@@ -4,6 +4,7 @@ import {} from 'lucide-react'import type { LucideIcon } from 'lucide-react'import type { CreateBackend, CreateIntent } from '../../../stores/createStore'+import { MUSIC_PLACEHOLDER } from '../../../lib/render/music-ui'export interface IntentMeta {id: CreateIntent@@ -135,7 +136,7 @@ export const INTENTS: IntentMeta[] = [},{id: 'music', label: 'Music', short: 'Music', icon: Music,- placeholder: 'Describe the track. Genre, mood, tempo, instruments…',+ placeholder: MUSIC_PLACEHOLDER.style,needsSource: false, needsPrompt: true, allowsMask: false, isVideo: false,cloudOnly: true, hasLocalLane: true, requiresModels: 'audio',examples: [diff --git a/src/hooks/__tests__/useCloudCreate-improve.test.ts b/src/hooks/__tests__/useCloudCreate-improve.test.tsindex 5a4afcd4..8ab4b480 100644--- a/src/hooks/__tests__/useCloudCreate-improve.test.ts+++ b/src/hooks/__tests__/useCloudCreate-improve.test.ts@@ -221,3 +221,36 @@ describe('Improve my prompt: Cloud (Desktop)', () => {expect(useCreateStore.getState().improvePrompt).toBe(false)})})++// Fund M1 (05.10.2026): bei Mureka Song und YuE2 ist das Textfeld der Liedtext.+// Die Umschreibung machte daraus eine Stilbeschreibung, und die wurde gesungen.+describe('Improve my prompt: Musik', () => {+ const LIED = '[Verse]\nmorning light on the kitchen floor'++ it('ein Liedtext wird nie umgeschrieben, auch wenn der Schalter an ist', async () => {+ const { generate } = useCloudCreate()+ for (const model of ['mureka-song', 'yue2']) {+ submitted.length = 0+ improve.calls.length = 0+ const s = useCreateStore.getState()+ s.setIntent('music'); s.setCloudOpModel(model); s.setPrompt(LIED)+ useCreateStore.setState({ improvePrompt: true })+ await generate()+ expect(useCreateStore.getState().error, model).toBeNull()+ expect(improve.calls, model).toHaveLength(0)+ expect(submitted[0].model, model).toBe(model)+ expect(submitted[0].prompt, model).toBe(LIED)+ expect(submitted[0].params.prompt_original, model).toBeUndefined()+ }+ })++ it('eine Stilbeschreibung wird weiter umgeschrieben', async () => {+ const s = useCreateStore.getState()+ s.setIntent('music'); s.setCloudOpModel('eleven-music'); s.setPrompt('slow jazz, upright bass')+ useCreateStore.setState({ improvePrompt: true })+ await useCloudCreate().generate()+ expect(improve.calls).toHaveLength(1)+ expect(improve.calls[0].kind).toBe('music')+ expect(submitted[0].prompt).toBe('A rewritten prompt.')+ })+})diff --git a/src/hooks/useCloudCreate.ts b/src/hooks/useCloudCreate.tsindex a5786721..176eb24f 100644--- a/src/hooks/useCloudCreate.ts+++ b/src/hooks/useCloudCreate.ts@@ -42,7 +42,8 @@ import { STANDARD_UPSCALE, intentRoles, intentRequiredInputs, isStudioModel, resimport { bumpSeed, runImageCount } from '../lib/render/image-count'import { STUDIO_MODELS, studioFields } from '../lib/render/studio-contract'import { modelLabel } from '../lib/render/preset-models'-import { improveKindForIntent, IMPROVING_PROMPT } from '../lib/render/improve-prompt'+import { IMPROVING_PROMPT } from '../lib/render/improve-prompt'+import { improveKindForRun } from '../lib/render/music-ui'import { intentTakesPrompt } from '../components/create/experimental/intents'import { rewrittenByName } from '../lib/render/qwen-enhancer'import { elapsedLine } from '../lib/elapsed-line'@@ -553,7 +554,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {let promptOriginal: string | undefinedlet rewrittenBy: string | undefinedlet improveFailed = false- const improveKind = s.improvePrompt && !characterUse ? improveKindForIntent(intent) : null+ const improveKind = s.improvePrompt && !characterUse ? improveKindForRun(intent, model) : nullif (improveKind && prompt.trim() && !ac.signal.aborted) {const improving = elapsedLine((text) => s.setProgress(8, text), IMPROVING_PROMPT)const out = await improvePrompt(prompt, { kind: improveKind, modelLabel: modelLabel(model) }, ac.signal).finally(improving.stop)diff --git a/src/lib/render/__tests__/music-ui.test.ts b/src/lib/render/__tests__/music-ui.test.tsindex 954a1b18..88407432 100644--- a/src/lib/render/__tests__/music-ui.test.ts+++ b/src/lib/render/__tests__/music-ui.test.ts@@ -3,24 +3,31 @@// described a box that was not on screen, implied other music models were// downloadable, and said the length slider bills per second on a machine where// nothing is billed.-import { describe, it, expect } from 'vitest'-import { musicTakesLyrics, musicHowtoLines } from '../music-ui'+//+// And for the cloud panel (findings M1 and M2, 2026-10-05): it follows the+// model on screen, so it never describes a lyrics box or a length slider that+// model does not have.+import { describe, it, expect, beforeEach } from 'vitest'+import { LOCAL_MUSIC_TEXT, SECONDS_LENGTH, musicHowtoLines, musicLength, musicText } from '../music-ui'+import { useCloudCatalogStore } from '../../../stores/cloudCatalogStore'+import { neuerServer } from './fixtures/test-catalogs'-describe('musicTakesLyrics', () => {- it('always offers the box locally, because every local checkpoint takes lyrics', () => {- expect(musicTakesLyrics('local', false)).toBe(true)- expect(musicTakesLyrics('local', true)).toBe(true)- })+beforeEach(() => { useCloudCatalogStore.setState({ models: neuerServer() }) })++const cloudLines = (model: string) =>+ musicHowtoLines('cloud', { text: musicText(model), length: musicLength(model) })- it('follows the catalog flag on cloud, where only ace-step-1.5 has the input', () => {- expect(musicTakesLyrics('cloud', true)).toBe(true)- expect(musicTakesLyrics('cloud', false)).toBe(false)+describe('local music', () => {+ it('always offers the lyrics box, because every local checkpoint takes lyrics', () => {+ expect(LOCAL_MUSIC_TEXT).toEqual({ main: 'style', second: { is: 'lyrics' } })+ expect(SECONDS_LENGTH).toMatchObject({ min: 5, max: 240, perSecond: 1 })+ expect(SECONDS_LENGTH.option).toBeUndefined()})})describe('musicHowtoLines', () => {const local = musicHowtoLines('local').join('\n').toLowerCase()- const cloud = musicHowtoLines('cloud').join('\n').toLowerCase()+ const cloud = cloudLines('ace-step-1.5').join('\n').toLowerCase()it('never talks about billing on the local tab', () => {expect(local).not.toContain('bill')@@ -29,13 +36,16 @@ describe('musicHowtoLines', () => {it('never promises other music models on the local tab, where there is one', () => {expect(local).not.toContain('other music models')- expect(cloud).toContain('other music models')+ expect(local).not.toContain('this model writes its own lyrics')})it('only describes the lyrics box where the box exists', () => {// Locally the box is always there, so mentioning it is fair.- expect(musicTakesLyrics('local', false)).toBe(true)expect(local).toContain('lyrics box')+ expect(cloud).toContain('lyrics box')+ for (const model of ['ace-step', 'eleven-music', 'mureka-song', 'yue2', 'minimax-music']) {+ expect(cloudLines(model).join('\n').toLowerCase(), model).not.toContain('lyrics box')+ }})it('keeps the advice that actually applies to both, the tags and the markers', () => {@@ -48,6 +58,25 @@ describe('musicHowtoLines', () => {it('leads with the heading and stays a short panel', () => {expect(musicHowtoLines('local')[0]).toBe('Make it sing your words')expect(musicHowtoLines('local').length).toBe(5)- expect(musicHowtoLines('cloud').length).toBe(6)+ expect(cloudLines('ace-step-1.5')[0]).toBe('Make it sing your words')+ expect(cloudLines('ace-step-1.5').length).toBe(5)+ })++ it('the cloud panel says what the model on screen does with the prompt and the length', () => {+ expect(cloudLines('mureka-song')).toEqual([+ 'Make it sing your words',+ 'The prompt takes your lyrics, and the model sings them as written. Structure them with [Verse], [Chorus] and [Bridge] markers and write in the language you want sung.',+ 'Open Style to set genre, mood and voice: comma-separated tags like slow jazz, smoky female vocals, upright bass.',+ 'This model decides the length of the track itself.',+ ])+ expect(cloudLines('eleven-music')).toEqual([+ 'Make it sing your words',+ 'The prompt sets the style: comma-separated tags like slow jazz, smoky female vocals, upright bass.',+ 'This model writes its own lyrics from the prompt.',+ 'The length slider sets how long the track runs, up to 10 minutes.',+ ])+ expect(cloudLines('minimax-music')[2]).toBe(+ 'Open Lyrics to write your own words. Structure them with [Verse], [Chorus] and [Bridge] markers and write in the language you want sung.',+ )})})diff --git a/src/lib/render/music-ui.ts b/src/lib/render/music-ui.tsindex f192ad27..ce922e0b 100644--- a/src/lib/render/music-ui.ts+++ b/src/lib/render/music-ui.ts@@ -1,4 +1,4 @@-// What the Music tab may claim, per backend.+// What the Music tab offers and may claim, per backend and per model.//// #108 (ElBiggus) was a page of cloud facts printed at a local user: the tab// said the model writes its own lyrics while hiding the lyrics box, the how-to@@ -6,34 +6,131 @@// models, and said the length slider "bills per second" on a machine where// nothing is billed. The copy lives here so those claims can be asserted// instead of eyeballed.+//+// In the cloud the answer comes from the model itself (the web twin is+// apps/web/lib/render/music-surface.ts). The classic music models take a+// length in seconds and bill by it. A Studio music model carries its own+// schema: one has a length field in milliseconds, the others have none at all,+// and for two of them the prompt field is the lyrics. The tab shows a control+// only where the run reads it, and sets exactly the field the run sends.++import { STUDIO_MODELS, studioFields } from './studio-contract'+import { cloudModelById } from '../../stores/cloudCatalogStore'+import { improveKindForIntent, type ImproveKind } from './improve-prompt'export type CreateBackendKind = 'local' | 'cloud'+export interface MusicText {+ /** What the big text field carries: a description of the track, or the words+ * the model sings. A Studio model says so itself (`promptField`). */+ main: 'style' | 'lyrics'+ /** The other text, where the model reads one. `option` names the Studio+ * option that carries it. Unset means the lyrics box of the store, which a+ * classic cloud model gets as `params.lyrics` and every local one as+ * `lyrics`. */+ second: null | { is: 'style' | 'lyrics'; option?: string }+}+/*** Local music runs an ACE-Step or a YuE2 checkpoint through buildMusicWorkflow,* and that builder feeds `lyrics` into the encoder for every one of them, so- * the box is always right locally. Cloud depends on the catalog flag, because- * only ace-step-1.5 has a lyrics input on the wire.+ * the prompt is the style and the lyrics box is always right locally.*/-export function musicTakesLyrics(backend: CreateBackendKind, cloudModelTakesLyrics: boolean): boolean {- return backend === 'cloud' ? cloudModelTakesLyrics : true+export const LOCAL_MUSIC_TEXT: MusicText = { main: 'style', second: { is: 'lyrics' } }++/** Which text goes where for this cloud music model. A classic one offers the+ * lyrics box only where the catalog says the endpoint has the input. */+export function musicText(model: string): MusicText {+ const studio = STUDIO_MODELS[model]+ if (!studio) return { main: 'style', second: cloudModelById(model)?.lyrics === true ? { is: 'lyrics' } : null }+ const fields = studioFields(model)+ if (studio.promptField === 'lyrics') {+ const option = ['style', 'prompt'].find((key) => fields[key]?.type === 'string')+ return { main: 'lyrics', second: option ? { is: 'style', option } : null }+ }+ return { main: 'style', second: fields.lyrics?.type === 'string' ? { is: 'lyrics', option: 'lyrics' } : null }+}++/** "Improve my prompt" for the cloud run on screen. It rewrites a description+ * into a better description. Lyrics are the customer's own words and are sung+ * as written, so a model whose text field is the lyrics never gets a rewrite. */+export function improveKindForRun(intent: string, model: string): ImproveKind | null {+ if (intent === 'music' && musicText(model).main === 'lyrics') return null+ return improveKindForIntent(intent)}-/** The how-to panel, as lines. First line is the heading. */-export function musicHowtoLines(backend: CreateBackendKind): string[] {- const lines = [- 'Make it sing your words',- 'The prompt sets the style: comma-separated tags like slow jazz, smoky female vocals, upright bass.',- ]- if (backend === 'cloud') {- lines.push('Only ACE-Step 1.5 sings your own lyrics. The other music models write theirs from the prompt.')+export const MUSIC_PLACEHOLDER = {+ style: 'Describe the track. Genre, mood, tempo, instruments…',+ lyrics: 'Write the lyrics. [Verse] and [Chorus] markers help the model sing them…',+} as const++export interface MusicLength {+ /** The Studio option that carries the length. Unset where the length is the+ * store's seconds: a classic cloud model (`params.duration`) and local. */+ option?: string+ /** How many units of the option make one second (1000 for milliseconds). */+ perSecond: number+ /** The slider, in seconds. */+ min: number+ max: number+ step: number+}++const STEP = 5++/** The slider of the store's seconds: every local model and the classic cloud ones. */+export const SECONDS_LENGTH: MusicLength = { perSecond: 1, min: 5, max: 240, step: STEP }++/** The length control of this cloud music model, or null where the model has+ * no length to set. */+export function musicLength(model: string): MusicLength | null {+ const studio = STUDIO_MODELS[model]+ if (!studio) return SECONDS_LENGTH+ const fields = studioFields(model)+ const option = studio.price.durationField ?? 'duration'+ const schema = fields[option]+ if (schema?.minimum === undefined || schema.maximum === undefined) return null+ const perSecond = studio.price.unitDivisor ?? 1+ return {+ option,+ perSecond,+ min: Math.ceil(schema.minimum / perSecond / STEP) * STEP,+ max: Math.floor(schema.maximum / perSecond / STEP) * STEP,+ step: STEP,+ }+}++/** The how-to panel, as lines. First line is the heading. The cloud panel+ * follows the model on screen (`cloud`), the local one is the same for every+ * checkpoint. */+export function musicHowtoLines(+ backend: CreateBackendKind,+ cloud: { text: MusicText; length: MusicLength | null } = { text: LOCAL_MUSIC_TEXT, length: SECONDS_LENGTH },+): string[] {+ const lines = ['Make it sing your words']+ if (backend === 'local') {+ lines.push(+ 'The prompt sets the style: comma-separated tags like slow jazz, smoky female vocals, upright bass.',+ 'Structure your lines with [Verse], [Chorus] and [Bridge] markers so the model sings them. Plain lines get wrapped in a [Verse] for you.',+ 'Leave the lyrics box empty for an instrumental track, and write in the language you want sung.',+ 'The length slider sets the track length, up to 4 minutes. Local runs cost nothing but time.',+ )+ return lines+ }+ const { text, length } = cloud+ const second = text.second+ if (text.main === 'style') {+ lines.push('The prompt sets the style: comma-separated tags like slow jazz, smoky female vocals, upright bass.')+ lines.push(second+ ? 'Open Lyrics to write your own words. Structure them with [Verse], [Chorus] and [Bridge] markers and write in the language you want sung.'+ : 'This model writes its own lyrics from the prompt.')+ if (second && !second.option) lines.push('Plain lines get wrapped in a [Verse] for you. Leave the lyrics box empty for an instrumental track.')+ } else {+ lines.push('The prompt takes your lyrics, and the model sings them as written. Structure them with [Verse], [Chorus] and [Bridge] markers and write in the language you want sung.')+ if (second) lines.push('Open Style to set genre, mood and voice: comma-separated tags like slow jazz, smoky female vocals, upright bass.')}- lines.push(- 'Structure your lines with [Verse], [Chorus] and [Bridge] markers so the model sings them. Plain lines get wrapped in a [Verse] for you.',- 'Leave the lyrics box empty for an instrumental track, and write in the language you want sung.',- backend === 'cloud'- ? 'The length slider bills per second, tracks can run up to 4 minutes.'- : 'The length slider sets the track length, up to 4 minutes. Local runs cost nothing but time.',- )+ if (length && !length.option) lines.push('The length slider bills per second, tracks can run up to 4 minutes.')+ if (length?.option) lines.push(`The length slider sets how long the track runs, up to ${Math.floor(length.max / 60)} minutes.`)+ if (!length) lines.push('This model decides the length of the track itself.')return lines}