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.

feat(create): shot list for LTX 2.5 multishot

purplef7c83b665935
diff --git a/src/components/create/experimental/ParamGroups.tsx b/src/components/create/experimental/ParamGroups.tsx
index ad4b2eec..52ccd616 100644
--- a/src/components/create/experimental/ParamGroups.tsx
+++ b/src/components/create/experimental/ParamGroups.tsx
@@ -19,6 +19,7 @@ import { cn } from '../ui/cn'
import { HINWEIS_TEXT } from '../../../lib/hinweis'
import { lorasForRun, loraFitsModel } from '../../../lib/lora-stack'
import { supportsTransparent } from '../../../lib/transparent-image'
+import { MAX_SHOTS, MAX_SHOT_CHARS, supportsMultishot } from '../../../lib/ltx-multishot'
// Video families whose dynamic-workflow strategy actually wires a LoRA node:
// the generic UNET path (wan/hunyuan/ltx/mochi/cosmos) plus Wan 2.2's dedicated
@@ -91,6 +92,10 @@ export function ParamGroups() {
// model family whose VAE writes an alpha channel (lib/transparent-image.ts).
const showTransparent = !isCloud && !isVideo && meta.id === 'image' && !isMlxLocal && supportsTransparent(laneType)
+ // Shots: LTX 2.5 can cut between several shots in one run, with the same
+ // figure (lib/ltx-multishot.ts). Local text-to-video on that model only.
+ const showShots = !isCloud && meta.id === 'video' && !isMlxLocal && supportsMultishot(laneType)
+
const samplers = samplerList.length ? samplerList : SAMPLERS_FALLBACK
const schedulers = schedulerList.length ? schedulerList : SCHEDULERS_FALLBACK
const vaes = vaeList.length ? vaeList : ['auto']
@@ -222,7 +227,7 @@ export function ParamGroups() {
>
<span>
<span className="block t-control text-gray-300">Transparent background</span>
- <span className="block text-[11px] leading-4 text-gray-600">Saves a PNG with a see-through background</span>
+ <span className="block t-micro text-gray-600">Saves a PNG with a see-through background</span>
</span>
<span className={cn('t-mono text-xs', s.transparentBackground ? 'text-emerald-400' : 'text-gray-600')}>
{s.transparentBackground ? 'on' : 'off'}
@@ -230,6 +235,29 @@ export function ParamGroups() {
</button>
)}
{!isVideo && !isCloud && <Slider label="Batch size" min={1} max={8} step={1} value={s.batchSize} onChange={s.setBatchSize} />}
+ {showShots && (
+ <div className="space-y-2">
+ <Slider label="Shots" min={1} max={MAX_SHOTS} step={1} value={1 + s.videoShots.length} onChange={s.setVideoShotCount} />
+ {s.videoShots.map((text, i) => (
+ <label key={i} className="block space-y-1">
+ <span className="t-control text-gray-400">Shot {i + 2}</span>
+ <textarea
+ rows={2}
+ maxLength={MAX_SHOT_CHARS}
+ value={text}
+ onChange={(e) => s.setVideoShot(i, e.target.value)}
+ placeholder="Describe the next shot…"
+ className="w-full resize-none rounded-[var(--radius-control)] border border-white/[0.08] bg-white/[0.04] px-2.5 py-1.5 t-control text-gray-200 outline-none transition-colors placeholder:text-gray-600 focus:border-white/25"
+ />
+ </label>
+ ))}
+ <p className="t-micro text-gray-600">
+ {s.videoShots.length === 0
+ ? 'One shot. Add more to cut between shots in one clip.'
+ : 'Shot 1 is your prompt. Describe the same person the same way in every shot. More shots need a longer clip.'}
+ </p>
+ </div>
+ )}
{isVideo && (
<div className="grid grid-cols-2 gap-2">
<Slider label="Frames" min={1} max={120} step={1} value={s.frames} onChange={s.setFrames} />
diff --git a/src/components/create/experimental/__tests__/multishot-oberflaeche.test.tsx b/src/components/create/experimental/__tests__/multishot-oberflaeche.test.tsx
new file mode 100644
index 00000000..c12c3733
--- /dev/null
+++ b/src/components/create/experimental/__tests__/multishot-oberflaeche.test.tsx
@@ -0,0 +1,115 @@
+// @vitest-environment jsdom
+/**
+ * Multishot mit LTX 2.5 (02.10.2026): die Shot-Liste in den erweiterten
+ * Einstellungen, nur lokal und nur wenn ein LTX-2.5-Modell gewaehlt ist.
+ */
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+
+const host = vi.hoisted(() => ({ mlx: false }))
+vi.mock('../../../../api/mlx-image', () => ({ isMlxImageHost: () => host.mlx }))
+vi.mock('../../../../api/comfyui', async (orig) => ({
+ ...((await orig()) as Record<string, unknown>),
+ classifyModel: (n: string) => (/ltx[._-]?2[._-]?5/i.test(n) ? 'ltx25' : /wan/i.test(n) ? 'wan22' : 'sdxl'),
+}))
+vi.mock('../CreateContext', () => ({
+ useCreateExp: () => ({
+ samplerList: [], schedulerList: [], loraList: [], vaeList: [], refreshModelLists: vi.fn(),
+ }),
+}))
+
+import { ParamGroups } from '../ParamGroups'
+import { Composer } from '../Composer'
+import { useCreateStore } from '../../../../stores/createStore'
+
+const LTX = 'ltx-2.5-22b-distilled.safetensors'
+const WAN = 'wan2.2_t2v_14b.safetensors'
+
+function setup(model: string, type: string, intent: 'video' | 'animate' = 'video') {
+ useCreateStore.setState({
+ backend: 'local', isGenerating: false, videoShots: [],
+ videoModel: model, videoModelList: [{ name: model, type }], cloudOp: null, utilityOp: null, removebg: false,
+ } as never)
+ useCreateStore.getState().setMode('video')
+ useCreateStore.getState().setIntent(intent)
+}
+
+beforeEach(() => { host.mlx = false })
+afterEach(() => { cleanup() })
+
+describe('Shot-Liste', () => {
+ it('steht bei lokalem Text-zu-Video mit LTX 2.5, standardmaessig mit einem Shot', () => {
+ setup(LTX, 'ltx25')
+ render(<ParamGroups />)
+ expect(screen.getByText('Shots')).toBeTruthy()
+ expect(screen.queryByLabelText(/Shot 2/)).toBeNull()
+ expect(screen.getByText(/Add more to cut between shots/i)).toBeTruthy()
+ })
+
+ it('mehr Shots geben je ein Feld, Shot 1 ist der Prompt', () => {
+ setup(LTX, 'ltx25')
+ const { container } = render(<ParamGroups />)
+ const range = [...container.querySelectorAll('input[type=range]')].find((el) => (el as HTMLInputElement).max === '4') as HTMLInputElement
+ expect(range.min).toBe('1')
+ fireEvent.change(range, { target: { value: '3' } })
+ expect(useCreateStore.getState().videoShots).toEqual(['', ''])
+ expect(screen.getByText('Shot 2')).toBeTruthy()
+ expect(screen.getByText('Shot 3')).toBeTruthy()
+ expect(screen.queryByText('Shot 4')).toBeNull()
+ expect(screen.getByText(/Shot 1 is your prompt/i)).toBeTruthy()
+ })
+
+ it('schreibt in den Speicher und behaelt den Text, wenn die Zahl waechst oder schrumpft', () => {
+ setup(LTX, 'ltx25')
+ const s = useCreateStore.getState()
+ s.setVideoShotCount(3)
+ s.setVideoShot(0, 'a close-up')
+ s.setVideoShot(1, 'a wide shot')
+ s.setVideoShotCount(4)
+ expect(useCreateStore.getState().videoShots).toEqual(['a close-up', 'a wide shot', ''])
+ s.setVideoShotCount(2)
+ expect(useCreateStore.getState().videoShots).toEqual(['a close-up'])
+ s.setVideoShotCount(1)
+ expect(useCreateStore.getState().videoShots).toEqual([])
+ s.setVideoShotCount(99)
+ expect(useCreateStore.getState().videoShots).toHaveLength(3)
+ })
+
+ it('ein Feld nimmt Tippen an', () => {
+ setup(LTX, 'ltx25')
+ useCreateStore.getState().setVideoShotCount(2)
+ render(<ParamGroups />)
+ fireEvent.change(screen.getByPlaceholderText(/describe the next shot/i), { target: { value: 'a close-up of her hands' } })
+ expect(useCreateStore.getState().videoShots).toEqual(['a close-up of her hands'])
+ })
+
+ it('fehlt bei jedem anderen Videomodell', () => {
+ setup(WAN, 'wan22')
+ render(<ParamGroups />)
+ expect(screen.queryByText('Shots')).toBeNull()
+ })
+
+ it('fehlt bei Animate, in der Cloud, bei Bildern und auf dem Mac', () => {
+ setup(LTX, 'ltx25', 'animate')
+ const a = render(<ParamGroups />)
+ expect(screen.queryByText('Shots')).toBeNull()
+ a.unmount()
+ setup(LTX, 'ltx25')
+ useCreateStore.setState({ backend: 'cloud' } as never)
+ const c = render(<ParamGroups />)
+ expect(screen.queryByText('Shots')).toBeNull()
+ c.unmount()
+ setup(LTX, 'ltx25')
+ host.mlx = true
+ render(<ParamGroups />)
+ expect(screen.queryByText('Shots')).toBeNull()
+ })
+
+ it('steht nie im Prompt-Fenster: der Composer zeigt die Liste nicht', () => {
+ setup(LTX, 'ltx25')
+ useCreateStore.getState().setVideoShotCount(2)
+ render(<Composer onOpenAdvanced={() => {}} onOpenWorkflows={() => {}} />)
+ expect(screen.queryByText('Shots')).toBeNull()
+ expect(screen.queryByPlaceholderText(/describe the next shot/i)).toBeNull()
+ })
+})
diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.ts
index 33d7b311..f16b6eef 100644
--- a/src/hooks/useCreate.ts
+++ b/src/hooks/useCreate.ts
@@ -61,6 +61,7 @@ import { useDownloadStore } from '../stores/downloadStore'
import { useComfyInstallStore } from '../stores/comfyInstallStore'
import { checkPromptSafety, SAFETY_BLOCK_MESSAGE } from '../lib/render/safety'
import { wantsTransparent } from '../lib/transparent-image'
+import { scenePromptFor } from '../lib/ltx-multishot'
import { improveKindForIntent } from '../lib/render/improve-prompt'
import { improvePrompt } from '../lib/render/improve-prompt-run'
import { resolveRunSeed } from '../lib/run-seed'
@@ -572,7 +573,7 @@ export function useCreate() {
// 2026-08-14).
{
const verdict = checkPromptSafety(
- `${state.prompt} ${state.negativePrompt} ${state.musicLyrics} ${state.triggerWord}`,
+ `${state.prompt} ${state.negativePrompt} ${state.musicLyrics} ${state.triggerWord} ${state.videoShots.join(' ')}`,
)
if (verdict.blocked) {
state.setError(SAFETY_BLOCK_MESSAGE)
@@ -639,23 +640,34 @@ export function useCreate() {
? imageModel
: (state.imageModelList[0]?.name ?? imageModel)
+ // LTX 2.5 multishot: the prompt field is shot 1, the shots from the advanced
+ // settings follow, each cut written out in plain words (lib/ltx-multishot).
+ // The rewrite below sees the whole scene, so it keeps the cuts.
+ // The model the run really uses: the picker shows the first capable one when
+ // the stored pick cannot run the intent, and so does the submit below.
+ const capableVideo = !localOp && mode === 'video' && state.videoModelList.length > 0 ? videoLaneModels(state.videoModelList, intent) : []
+ const effVideoModel = capableVideo.length > 0 && !capableVideo.some((m) => m.name === videoModel) ? capableVideo[0].name : videoModel
+ const scenePrompt = scenePromptFor({
+ prompt: typedPrompt, shots: state.videoShots, mode, intent, onMlxHost: isMlxImageHost(),
+ modelType: state.videoModelList.find((m) => m.name === effVideoModel)?.type ?? classifyModel(effVideoModel),
+ })
// "Improve my prompt": the chat model the user picked rewrites the prompt
// for this model before the run. Local chat models run on this machine,
// LU Cloud ones are billed like chat. The field itself is never touched:
// the run uses `prompt`, the gallery keeps both. A rewrite that fails never
// stops the run, it goes on with the user's own prompt.
- let prompt = typedPrompt
+ let prompt = scenePrompt
let improveFields: { promptOriginal?: string; improveFailed?: true } = {}
const improveKind = state.improvePrompt ? improveKindForIntent(intent) : null
- if (improveKind && typedPrompt.trim()) {
+ if (improveKind && scenePrompt.trim()) {
const own = new AbortController()
abortRef.current = own
setIsGenerating(true)
setProgress(3, 'Improving your prompt…')
- const runModel = improveKind === 'music' ? state.localOpModel : improveKind === 'video' ? videoModel : effImageModel
+ const runModel = improveKind === 'music' ? state.localOpModel : improveKind === 'video' ? effVideoModel : effImageModel
let out: Awaited<ReturnType<typeof improvePrompt>> = { status: 'failed' }
try {
- out = await improvePrompt(typedPrompt, {
+ out = await improvePrompt(scenePrompt, {
kind: improveKind,
modelLabel: runModel || undefined,
tags: improveKind === 'image' && ['sd15', 'sdxl'].includes(state.imageModelList.find((m) => m.name === runModel)?.type ?? classifyModel(runModel)),
@@ -671,7 +683,7 @@ export function useCreate() {
// prompt, the model must not turn it into a refusal.
if (out.status === 'improved' && !checkPromptSafety(out.prompt).blocked) {
prompt = out.prompt
- improveFields = { promptOriginal: typedPrompt }
+ improveFields = { promptOriginal: scenePrompt }
} else if (out.status !== 'unchanged') {
improveFields = { improveFailed: true }
}
diff --git a/src/lib/__tests__/ltx-multishot.test.ts b/src/lib/__tests__/ltx-multishot.test.ts
new file mode 100644
index 00000000..fd9123dc
--- /dev/null
+++ b/src/lib/__tests__/ltx-multishot.test.ts
@@ -0,0 +1,90 @@
+import { describe, it, expect } from 'vitest'
+import { MAX_SHOTS, composeShots, shotCount, supportsMultishot } from '../ltx-multishot'
+
+// Die Fassung kommt aus docs.ltx.io, Prompting Guide, "Multi-Shot Prompts":
+// ein Absatz, jeder Schnitt in Worten benannt, kein Shot-Listen-Format.
+
+describe('Multishot: welche Modelle', () => {
+ it('nur LTX 2.5', () => {
+ expect(supportsMultishot('ltx25')).toBe(true)
+ for (const t of ['ltx', 'wan', 'wan22', 'hunyuan', 'minimaxh3', 'unknown', '', null, undefined]) {
+ expect(supportsMultishot(t as string)).toBe(false)
+ }
+ })
+
+ it('die Grenze ist vier Shots, wie der Leitfaden es nennt', () => {
+ expect(MAX_SHOTS).toBe(4)
+ })
+})
+
+describe('Multishot: der Prompt', () => {
+ it('ein Shot allein bleibt wie geschrieben, auch mit leeren Feldern', () => {
+ expect(composeShots('a fox in snow', [])).toBe('a fox in snow')
+ expect(composeShots('a fox in snow', ['', ' '])).toBe('a fox in snow')
+ })
+
+ it('ohne Prompt gibt es keine Szene, auch wenn weitere Shots Text haben', () => {
+ expect(composeShots('', ['two'])).toBe('')
+ expect(composeShots(' ', ['two'])).toBe(' ')
+ })
+
+ it('zwei Shots werden ein Absatz mit einem benannten Schnitt', () => {
+ expect(composeShots('A wide shot of a fox in snow', ['A close-up of the fox, snow on its nose'])).toBe(
+ 'A wide shot of a fox in snow. A hard cut transitions to the next shot, with the same characters. A close-up of the fox, snow on its nose.',
+ )
+ })
+
+ it('jeder weitere Shot bekommt seinen eigenen Schnitt, in der Reihenfolge', () => {
+ const p = composeShots('one', ['two', 'three', 'four'])
+ expect(p.match(/A hard cut transitions/g)).toHaveLength(3)
+ expect(p.indexOf('one')).toBeLessThan(p.indexOf('two'))
+ expect(p.indexOf('two')).toBeLessThan(p.indexOf('three'))
+ expect(p.indexOf('three')).toBeLessThan(p.indexOf('four'))
+ })
+
+ it('ein leerer Shot in der Mitte faellt weg, ohne einen leeren Schnitt', () => {
+ const p = composeShots('one', ['', 'three'])
+ expect(p.match(/A hard cut transitions/g)).toHaveLength(1)
+ expect(p).toContain('three.')
+ })
+
+ it('ein Satzzeichen des Nutzers wird nicht verdoppelt', () => {
+ expect(composeShots('One!', ['Two?'])).toContain('One! A hard cut')
+ expect(composeShots('One.', ['Two.'])).not.toContain('..')
+ })
+
+ it('es ist ein einziger Absatz: kein Zeilenumbruch, keine Nummerierung, keine Labels', () => {
+ const p = composeShots('one\nline', ['two\n\nlines', 'three'])
+ expect(p).not.toMatch(/\n/)
+ expect(p).not.toMatch(/\b(shot|beat|scene) ?\d/i)
+ expect(p).not.toMatch(/^\s*[-*\d]/m)
+ })
+
+ it('kein Gedankenstrich im Text, der an das Modell geht', () => {
+ expect(composeShots('a', ['b'])).not.toMatch(/[—–]/)
+ })
+
+ it('zaehlt die Shots, die wirklich Text haben', () => {
+ expect(shotCount('one', ['two', '', 'four'])).toBe(3)
+ expect(shotCount('', ['two'])).toBe(1)
+ })
+})
+
+describe('Multishot: was ein lokaler Lauf schickt', () => {
+ const run = { prompt: 'one', shots: ['two'], mode: 'video', intent: 'video', onMlxHost: false, modelType: 'ltx25' }
+ const composed = composeShots('one', ['two'])
+
+ it('Text-zu-Video auf LTX 2.5 schickt die Shots', async () => {
+ const { scenePromptFor } = await import('../ltx-multishot')
+ expect(scenePromptFor(run)).toBe(composed)
+ })
+
+ it('jedes andere Modell, jede andere Spur und der Mac schicken den Prompt wie getippt', async () => {
+ const { scenePromptFor } = await import('../ltx-multishot')
+ expect(scenePromptFor({ ...run, modelType: 'wan22' })).toBe('one')
+ expect(scenePromptFor({ ...run, intent: 'animate' })).toBe('one')
+ expect(scenePromptFor({ ...run, intent: 'image', mode: 'image' })).toBe('one')
+ expect(scenePromptFor({ ...run, onMlxHost: true })).toBe('one')
+ expect(scenePromptFor({ ...run, shots: [] })).toBe('one')
+ })
+})
diff --git a/src/lib/ltx-multishot.ts b/src/lib/ltx-multishot.ts
new file mode 100644
index 00000000..1ad10121
--- /dev/null
+++ b/src/lib/ltx-multishot.ts
@@ -0,0 +1,70 @@
+// LTX 2.5 multishot: several shots with the same figure in one run.
+//
+// How the model takes it, read off the vendor's own docs on 2026-10-02:
+// docs.ltx.io, Open Source Model, Usage Guides, Prompting Guide, section
+// "Multi-Shot Prompts". There is no separate input and no tag syntax. The
+// scene is ONE chronological paragraph in which every cut is written out in
+// plain words ("A hard cut transitions to ..."), each new shot says its own
+// framing, and a recurring person is described the same way again. The guide
+// says to prefer two to four shots and NOT to use a shot list, numbered beats
+// or sluglines unless the cut is also described in prose. ComfyUI's LTX-2.5
+// templates list "Native multishot" the same way: it is a property of the
+// prompt, not of a node.
+//
+// So the shot list in the advanced settings is a form for that paragraph. The
+// prompt field is shot 1, every further shot is one more sentence block, and
+// each cut is named in prose. There is no per shot length: the guide has no
+// syntax for one, the clip length stays the one length slider.
+
+/** The model reads two to four shots well. */
+export const MAX_SHOTS = 4
+
+/** Longest text of one further shot, so a pasted essay cannot fill the prompt. */
+export const MAX_SHOT_CHARS = 400
+
+/** The named cut between two shots, written the way the guide's examples are. */
+const CUT = 'A hard cut transitions to the next shot, with the same characters.'
+
+function sentence(text: string): string {
+ const t = text.trim().replace(/\s+/g, ' ')
+ return /[.!?…"”')]$/.test(t) ? t : `${t}.`
+}
+
+/** Does this model take a shot list? LTX 2.5 only. LTX 2.0 and 2.3 are not
+ * named by the guide. */
+export function supportsMultishot(modelType: string | undefined | null): boolean {
+ return modelType === 'ltx25'
+}
+
+/** The prompt of a multishot run. The prompt field is shot 1, `further` are the
+ * shots after it. Empty ones are dropped, and with none left the prompt goes
+ * through as the user wrote it. */
+export function composeShots(first: string, further: readonly string[]): string {
+ const rest = further.map((s) => s.trim()).filter(Boolean)
+ // Shot 1 is the prompt. Without it there is no scene, and the empty prompt
+ // must still be refused as such.
+ if (rest.length === 0 || !first.trim()) return first
+ return [sentence(first), ...rest.map((s) => `${CUT} ${sentence(s)}`)].join(' ')
+}
+
+/** How many shots a run really has: the prompt plus every further shot that has
+ * text. Used for the line under the list. */
+export function shotCount(first: string, further: readonly string[]): number {
+ return (first.trim() ? 1 : 0) + further.filter((s) => s.trim()).length
+}
+
+/** The prompt a local run sends. Only plain text-to-video on LTX 2.5 through
+ * ComfyUI takes the shot list: animate starts from one opening picture and the
+ * guide advises a single take there, and every other model or lane never saw
+ * the shots. Everything else keeps the prompt as typed. */
+export function scenePromptFor(run: {
+ prompt: string
+ shots: readonly string[]
+ mode: string
+ intent: string
+ onMlxHost: boolean
+ modelType: string | undefined | null
+}): string {
+ const applies = run.mode === 'video' && run.intent === 'video' && !run.onMlxHost && supportsMultishot(run.modelType)
+ return applies ? composeShots(run.prompt, run.shots) : run.prompt
+}
diff --git a/src/lib/render/__tests__/improve-prompt.test.ts b/src/lib/render/__tests__/improve-prompt.test.ts
index 73e52efd..8e98cc65 100644
--- a/src/lib/render/__tests__/improve-prompt.test.ts
+++ b/src/lib/render/__tests__/improve-prompt.test.ts
@@ -37,6 +37,12 @@ describe('Improve my prompt: was das Chatmodell gesagt bekommt', () => {
expect(new Set([image, tags, video, music]).size).toBe(4)
})
+ it('ein Video mit mehreren Schnitten behaelt jeden Schnitt', () => {
+ const s = buildImproveMessages({ kind: 'video' }, 'x')[0].content
+ expect(s).toContain('keep every shot in order')
+ expect(s).toContain('each cut written out in words')
+ })
+
it('die Regeln: nicht zensieren, nichts hinzuerfinden, Englisch, nur der Prompt', () => {
const s = buildImproveMessages({ kind: 'video', modelLabel: 'Wan 2.2' }, 'x')[0].content
expect(s).toContain('Never censor')
diff --git a/src/lib/render/improve-prompt.ts b/src/lib/render/improve-prompt.ts
index 65178852..6c866ba2 100644
--- a/src/lib/render/improve-prompt.ts
+++ b/src/lib/render/improve-prompt.ts
@@ -50,7 +50,7 @@ export interface ImproveMessage {
const RULES = [
'Keep every subject, person, creature, object, action and setting the user wrote, exactly as meant.',
- 'Never censor, soften, moralize, refuse or add warnings. Adult or violent wording stays as it is.',
+ 'Never censor, soften, moralize, refuse or add warnings. Strong or mature wording stays as it is.',
'Do not add subjects, people, objects, actions or story the user did not ask for.',
'You may add what a good prompt has: framing, lighting, lens or camera, style, texture, mood. It must serve the same idea.',
'If the prompt is not in English, translate it to English.',
@@ -65,7 +65,7 @@ function kindBrief(target: ImproveTarget): string {
? 'You rewrite prompts for an image model trained on tags. Write one line of comma separated tags and short phrases: subject first, then details, setting, lighting, style. Up to about 60 words.'
: 'You rewrite prompts for an image model that reads natural language. Write one flowing description of the picture in plain sentences: subject, details, setting, light, composition, style. 40 to 120 words.'
case 'video':
- return 'You rewrite prompts for a video model. Write one flowing paragraph in the present tense, in the order things happen: the subject, what moves and how, the camera (shot size and movement), the light and the setting. If sound is part of the idea, say it. 60 to 160 words.'
+ return 'You rewrite prompts for a video model. Write one flowing paragraph in the present tense, in the order things happen: the subject, what moves and how, the camera (shot size and movement), the light and the setting. If sound is part of the idea, say it. If the prompt already describes several shots joined by cuts, keep every shot in order and keep each cut written out in words. 60 to 160 words.'
case 'music':
return 'You rewrite prompts for a music model. Write a short description of the track: genre and sub genre, mood, tempo, main instruments, voice type if there is one, and how the track builds. One or two lines, 20 to 60 words. Do not write lyrics.'
}
@@ -89,7 +89,7 @@ export function buildImproveMessages(target: ImproveTarget, prompt: string): Imp
const THINK_BLOCK = /<think(?:ing)?>[\s\S]*?<\/think(?:ing)?>/gi
const OPEN_THINK = /<think(?:ing)?>[\s\S]*$/i
const REFUSAL = /^(i['’]m sorry|i am sorry|sorry[,.]|i can['’]?t|i cannot|i['’]m unable|i am unable|as an ai)/i
-const LABEL = /^(rewritten prompt|improved prompt|enhanced prompt|prompt|output|result)\s*[:\-]\s*/i
+const LABEL = /^(rewritten prompt|improved prompt|enhanced prompt|prompt|output|result)\s*[:-]\s*/i
/** The chat model's raw answer, made into a prompt. Null when it is unusable:
* empty, cut off inside a thinking block, a refusal, or longer than a render
diff --git a/src/stores/createStore.ts b/src/stores/createStore.ts
index 35b9e223..f7615a4c 100644
--- a/src/stores/createStore.ts
+++ b/src/stores/createStore.ts
@@ -26,8 +26,11 @@ const RUNTIME_ONLY_KEYS: readonly string[] = [
// own fields since this bugfix. Session-scratch like source/mask, not a
// preference worth remembering across restarts.
'cloudFrames', 'cloudFps',
+ // A scene from yesterday must not ride along into today's run.
+ 'videoShots',
]
import type { ModelType, ClassifiedModel } from '../api/comfyui'
+import { MAX_SHOTS, MAX_SHOT_CHARS } from '../lib/ltx-multishot'
import { classifyModel, hidreamSampling } from '../api/comfyui'
import type { HiresUpscaleMethod } from '../api/hires-fix'
import { releaseVideoBlobUrl } from '../api/mlx-video'
@@ -381,6 +384,12 @@ interface CreateState {
cloudStudioCredits: number | null
/** Runtime-only: images per cloud run, 1 to 4 (Image and Edit). */
cloudImageCount: number
+ /** LTX 2.5 multishot (lib/ltx-multishot.ts): the shots AFTER the prompt, which
+ * is shot 1. Empty means a single shot. Runtime-only like the prompt itself:
+ * a scene from yesterday must not ride along into today's run. */
+ videoShots: string[]
+ setVideoShotCount: (count: number) => void
+ setVideoShot: (index: number, text: string) => void
/** Local Qwen-Image 2.1 only: write the picture with a transparent background
* (lib/transparent-image.ts). A preference like the HiRes switch, so it is
* remembered. */
@@ -706,6 +715,7 @@ export const useCreateStore = create<CreateState>()(
cloudImageCount: 1,
improvePrompt: false,
transparentBackground: false,
+ videoShots: [],
localOpModel: '',
charactersVersion: 0,
caps: { rmbg: false, 'inpaint-nodes': false, dwpose: false } as Record<'rmbg' | 'inpaint-nodes' | 'dwpose', boolean>,
@@ -958,6 +968,16 @@ export const useCreateStore = create<CreateState>()(
setCloudStudioCredits: (cloudStudioCredits) => set({ cloudStudioCredits }),
setCloudImageCount: (count) => set({ cloudImageCount: clampImageCount(count) }),
setImprovePrompt: (on) => set({ improvePrompt: on === true }),
+ setVideoShotCount: (count) => set((st) => {
+ const further = Math.max(1, Math.min(MAX_SHOTS, Math.floor(count) || 1)) - 1
+ return { videoShots: Array.from({ length: further }, (_, i) => st.videoShots[i] ?? '') }
+ }),
+ setVideoShot: (index, text) => set((st) => {
+ if (index < 0 || index >= st.videoShots.length) return {}
+ const next = [...st.videoShots]
+ next[index] = text.slice(0, MAX_SHOT_CHARS)
+ return { videoShots: next }
+ }),
setTransparentBackground: (on) => set({ transparentBackground: on === true }),
// Picking a lane model adopts its architecture defaults (like
// setVideoModel does) — an inherited 1024×1024 from the Image tab would