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
feat(create): five hosted categories - character studio, talking character, music, extend, motion
purple4ee8e938ed1a
diff --git a/src/api/cloud/catalog.ts b/src/api/cloud/catalog.tsindex a541c7e9..8d64f187 100644--- a/src/api/cloud/catalog.ts+++ b/src/api/cloud/catalog.ts@@ -26,6 +26,9 @@ export interface CloudCatalog {}export async function getCatalog(): Promise<CloudCatalog> {- const res = await cloudFetch('/api/jobs/catalog')+ // v=2: this build understands op-specialized models (trainers, lipsync,+ // voice, music, extend, motion) — without the flag the server serves only+ // the classic list so pre-2.5.8 clients never mis-list them.+ const res = await cloudFetch('/api/jobs/catalog?v=2')return jsonOrError<CloudCatalog>(res)}diff --git a/src/api/cloud/jobs.ts b/src/api/cloud/jobs.tsindex 196e93f3..7f2022ef 100644--- a/src/api/cloud/jobs.ts+++ b/src/api/cloud/jobs.ts@@ -20,8 +20,20 @@ export interface CloudJobParams {grow_mask_by?: numbersource_path?: stringmask_path?: string- source_url?: string // video enhance: URL of the clip to upscale+ source_url?: string // video enhance/extend: URL of the clip to re-processtarget_resolution?: string // upscale target (image 2k|4k|8k, video 720p|1080p)+ // ── 2.5.8 categories ──+ audio_path?: string // lipsync speech / voice-clone reference (staged upload)+ audio_url?: string // lipsync speech from a prior OWN render (tts/music result)+ video_path?: string // lipsync base clip / motion driving video (staged upload)+ image_paths?: string[] // character training set (4-30 staged uploads)+ duration?: number // music track seconds (billed per second)+ lyrics?: string // music: optional lyrics+ voice?: string // tts: named voice+ voice_description?: string // tts voice-design+ trigger_word?: string // character training+ name?: string // character shelf label+ loras?: { id: string; scale?: number }[] // OWN user_loras rows — server resolves to URLs}export interface CloudJobSubmit {@@ -58,12 +70,17 @@ export interface CloudMe {}}-/** Stage a source image or mask; returns the render-inputs storage path.+/** Stage an input; returns the render-inputs storage path. Roles: 'source' /+ * 'mask' (images), and since 2.5.8 'train' (one character-training image per+ * call), 'audio' (speech / voice reference) and 'video' (base/driving clip).* Sends the raw bytes (role in the query) rather than multipart/form-data:* WKWebView's fetch fails a cross-origin FormData(Blob) body with a bare* "Load failed", which broke every source-needing op (edit/removebg/eraser/* upscale/animate). An ArrayBuffer body serialises fine. */-export async function uploadInput(file: Blob, role: 'source' | 'mask'): Promise<string> {+export async function uploadInput(+ file: Blob,+ role: 'source' | 'mask' | 'train' | 'audio' | 'video',+): Promise<string> {const body = await file.arrayBuffer()const res = await cloudFetch(`/api/jobs/upload?role=${role}`, {method: 'POST',diff --git a/src/api/cloud/loras.ts b/src/api/cloud/loras.tsnew file mode 100644index 00000000..eb35097c--- /dev/null+++ b/src/api/cloud/loras.ts@@ -0,0 +1,26 @@+// Desktop client for the Character-Studio shelf (server: user_loras via+// /api/loras). Training happens through the normal render queue (op+// 'lora-train'); the worker persists each delivered training onto the shelf,+// and generation references shelf rows by id — URLs never travel client-side.++import { cloudFetch, jsonOrError } from './client'++export interface CloudLora {+ id: string+ name: string+ trigger_word: string+ /** Which generation endpoints accept it: 'flux' | 'z-image' | 'qwen-image' | 'ltx-2'. */+ base_family: string+ created_at: string+}++export async function listLoras(): Promise<CloudLora[]> {+ const res = await cloudFetch('/api/loras')+ const { loras } = await jsonOrError<{ loras: CloudLora[] }>(res)+ return loras+}++export async function deleteLora(id: string): Promise<void> {+ const res = await cloudFetch(`/api/loras/${encodeURIComponent(id)}`, { method: 'DELETE' })+ await jsonOrError<{ ok: boolean }>(res)+}diff --git a/src/components/create/experimental/Composer.tsx b/src/components/create/experimental/Composer.tsxindex e2ae8171..709967b0 100644--- a/src/components/create/experimental/Composer.tsx+++ b/src/components/create/experimental/Composer.tsx@@ -9,10 +9,12 @@ import {defaultCloudModel,defaultEditModel,isEditCapable,+ modelForOp,runCredits,} from '../../../stores/cloudCatalogStore'import { INTENT_MAP } from './intents'import { ModelChip } from './ModelChip'+import { SpecialControls } from './SpecialIntentControls'import { CreditsMeter } from './CreditsMeter'import { Button } from '../ui/Button'import { PromptField } from '../ui/PromptField'@@ -42,8 +44,18 @@ export function Composer({ onOpenAdvanced }: Props) {const setTargetResolution = useCreateStore((s) => s.setTargetResolution)const cloudImageModel = useCreateStore((s) => s.cloudImageModel)const cloudVideoModel = useCreateStore((s) => s.cloudVideoModel)+ const cloudOpModel = useCreateStore((s) => s.cloudOpModel)const frames = useCreateStore((s) => s.frames)const fps = useCreateStore((s) => s.fps)+ // 2.5.8 specialized-intent inputs (readiness for the Create button).+ const characterTab = useCreateStore((s) => s.characterTab)+ const trainImages = useCreateStore((s) => s.trainImages)+ const selectedCharacter = useCreateStore((s) => s.selectedCharacter)+ const audioInput = useCreateStore((s) => s.audioInput)+ const voiceFromJob = useCreateStore((s) => s.voiceFromJob)+ const videoInput = useCreateStore((s) => s.videoInput)+ const extendSource = useCreateStore((s) => s.extendSource)+ const musicDuration = useCreateStore((s) => s.musicDuration)const { generate, cancel, quota } = useCreateExp()// The Create button turns into Cancel in place — a double-click's second@@ -59,26 +71,45 @@ export function Composer({ onOpenAdvanced }: Props) {cancel()}, [cancel])- const needPrompt = meta.needsPrompt// Single-purpose endpoints (cutout/upscale/eraser): no prompt, no// generation knobs, no model choice — just the input (+ mask/resolution).const isUtility = meta.id === 'removebg' || meta.id === 'upscale' || meta.id === 'eraser'- const { kind: intentKind, op: intentOp } = intentToJob(intent)+ // 2.5.8 categories with their own composer surfaces + input contracts.+ const special =+ intent === 'character' || intent === 'lipsync' || intent === 'music' ||+ intent === 'extend' || intent === 'motion'+ const characterUse = intent === 'character' && characterTab === 'use'+ let { kind: intentKind, op: intentOp } = intentToJob(intent)+ if (characterUse) {+ // The use-surface is a plain image generate with the character attached.+ intentKind = 'image'+ intentOp = 'generate'+ }+ // The prompt field shows wherever the run consumes one — that's the meta+ // flag, plus Character-Studio's use-surface (train has no prompt).+ const needPrompt = meta.needsPrompt || characterUse// Gate on the exact run's cost (model + op + clip length), the same figure// the CreditsMeter shows — quota.costs[kind] is only the tier's// representative per-kind number and would mis-gate utility ops / pricier// models.- const pickedModel =- (intentKind === 'video' ? cloudVideoModel : cloudImageModel) || defaultCloudModel(intentKind).id+ const pickedModel = characterUse+ ? 'flux-schnell-lora'+ : special+ ? cloudOpModel+ : (intentKind === 'video' ? cloudVideoModel : cloudImageModel) ||+ defaultCloudModel(intentKind)?.id || ''const runSeconds =- intentKind === 'video' && (intentOp === 'generate' || intentOp === 'animate') && fps > 0- ? frames / fps- : undefined+ intentOp === 'music'+ ? musicDuration+ : intentKind === 'video' && (intentOp === 'generate' || intentOp === 'animate') && fps > 0+ ? frames / fps+ : undefined+ const costFallback = quota?.costs[intentKind === 'audio' ? 'image' : intentKind] ?? 0const creditsOk =backend !== 'cloud' ||(quota != null &"a.remaining.credits >=- runCredits(intentKind, intentOp, pickedModel, runSeconds, quota.costs[intentKind], targetResolution))+ runCredits(intentKind, intentOp, pickedModel, runSeconds, costFallback, targetResolution))// Match useCloudCreate's submit-time edit fallback so the Neg gate reflects// the model the run actually uses, not a t2i model still in the picker.const runModel =@@ -87,9 +118,25 @@ export function Composer({ onOpenAdvanced }: Props) {// hide the toggle (and the collapsed field) where it would be silently// dropped, like the other dead knobs on cloud.const negSupported = backend !== 'cloud' || cloudModelById(runModel)?.negative_prompt === true+ // Per-intent readiness for the 2.5.8 categories (mirrors useCloudCreate's+ // submit-time checks so the button never invites a doomed run).+ const lipsyncNeedsClip =+ intent === 'lipsync' &&+ cloudModelById(modelForOp('video', 'lipsync', cloudOpModel))?.lipsync_source === 'video'+ const specialReady =+ intent === 'character'+ ? (characterUse ? !!selectedCharacter : trainImages.length >= 4)+ : intent === 'lipsync'+ ? (!!audioInput || !!voiceFromJob) && (lipsyncNeedsClip ? !!videoInput : !!source)+ : intent === 'extend'+ ? !!extendSource+ : intent === 'motion'+ ? !!source && !!videoInput+ : trueconst canGenerate =(!needPrompt || prompt.trim().length > 0) &&(!meta.needsSource || !!source) &&+ specialReady &&creditsOkreturn (@@ -99,22 +146,23 @@ export function Composer({ onOpenAdvanced }: Props) {// exact SAME height across all tabs, not just within one.<div className="shrink-0 px-4 pb-4 pt-2 min-h-[192px] flex flex-col justify-end"><div className="mx-auto w-full max-w-[760px] space-y-2.5">- {!isUtility && <QuickControls />}+ {!isUtility && !special && <QuickControls />}+ {special && <SpecialControls intent={intent} />}<div className="rounded-[var(--radius-panel)] bg-white/[0.03] border border-white/[0.06] focus-within:border-white/15 transition-colors">- {meta.needsPrompt && (+ {needPrompt && (<div className="px-3.5 pt-3"><PromptFieldvalue={prompt}onChange={setPrompt}- placeholder={meta.placeholder}+ placeholder={characterUse ? 'Describe the scene for your character…' : meta.placeholder}onSubmit={() => canGenerate && !isGenerating && guardedGenerate()}/></div>)}<AnimatePresence>- {showNegative && meta.needsPrompt && negSupported && (+ {showNegative && needPrompt && negSupported && (<motion.divinitial={{ height: 0, opacity: 0 }}animate={{ height: 'auto', opacity: 1 }}@@ -133,7 +181,7 @@ export function Composer({ onOpenAdvanced }: Props) {)}</AnimatePresence>- {!meta.needsPrompt && (+ {!needPrompt && (<div className="px-3.5 py-3 t-body text-gray-500">{noPromptHint(meta.id)}</div>@@ -141,7 +189,7 @@ export function Composer({ onOpenAdvanced }: Props) {{/* Action bar */}<div className="flex items-center gap-1.5 px-2.5 py-2 border-t border-white/[0.05]">- {meta.needsPrompt && negSupported && (+ {needPrompt && negSupported && (<buttononClick={toggleNegative}className={cn('t-control px-2 h-[var(--control-h-sm)] rounded-md transition-colors', showNegative ? 'bg-white/10 text-gray-200' : 'text-gray-500 hover:text-gray-300 hover:bg-white/[0.05]')}@@ -150,7 +198,7 @@ export function Composer({ onOpenAdvanced }: Props) {Neg</button>)}- {meta.needsPrompt && <PromptHistory onPick={setPrompt} />}+ {needPrompt && <PromptHistory onPick={setPrompt} />}<div className="flex-1" />{/* The backend axis moved to the global header switch (2.5.7) —the Composer just reflects it via the CreditsMeter. */}@@ -197,6 +245,12 @@ function noPromptHint(id: CreateIntent): string {return 'No prompt needed — just hit Create to enhance the image.'case 'eraser':return 'No prompt needed — paint a mask over the object to remove, then hit Create.'+ case 'character':+ return 'Add 4-30 photos of one person or character above, pick a trigger word, then hit Create to train.'+ case 'lipsync':+ return 'Add the portrait (or clip) and a voice above, then hit Create to make it speak.'+ case 'motion':+ return 'Add a character image and a driving dance/pose video above, then hit Create.'default:return 'No prompt needed — just hit Create to remove the background.'}diff --git a/src/components/create/experimental/CreateContext.tsx b/src/components/create/experimental/CreateContext.tsxindex f9dbd37a..1d8d8a31 100644--- a/src/components/create/experimental/CreateContext.tsx+++ b/src/components/create/experimental/CreateContext.tsx@@ -21,6 +21,14 @@ interface CreateExpValue {cancel: () => void | Promise<void>/** Video super-resolution on a finished cloud render (Lightbox "Enhance"). */enhanceVideo: (item: GalleryItem, targetResolution?: '720p' | '1080p') => Promise<void>+ /** Talking-character voice maker (qwen3-tts) — lands an audio gallery item+ * and pre-selects it as the lipsync voice. Cloud-only. */+ makeVoice: (opts: {+ text: string+ mode: 'speak' | 'design'+ voice?: string+ description?: string+ }) => Promise<void>/** ComfyUI /object_info sampler + scheduler names (fallback lists until loaded). */samplerList: string[]schedulerList: string[]@@ -272,6 +280,7 @@ export function CreateExpProvider({ children }: { children: ReactNode }) {// run keeps going (a cloud job keeps billing; a local job keeps rendering).cancel: () => (hasActiveCloudRun() ? cloud.cancel() : cancel()),enhanceVideo: cloud.enhanceVideo,+ makeVoice: cloud.makeVoice,samplerList, schedulerList, loraList, vaeList,connected, modelsLoaded, modelLoadError, comfyOnCpu, installCapability, installModelBundle,cloudAvailable, quota, refreshQuota,diff --git a/src/components/create/experimental/CreatePanel.tsx b/src/components/create/experimental/CreatePanel.tsxindex 5bfba2de..d094aec5 100644--- a/src/components/create/experimental/CreatePanel.tsx+++ b/src/components/create/experimental/CreatePanel.tsx@@ -1,5 +1,5 @@import { motion, AnimatePresence } from 'framer-motion'-import { Images, Play, PanelRightClose, PanelRightOpen, Trash2, Download, MonitorOff } from 'lucide-react'+import { Images, Play, PanelRightClose, PanelRightOpen, Trash2, Download, MonitorOff, AudioLines } from 'lucide-react'import { downloadMediaUrl } from '../../../lib/download-media'import { useCreateStore, type GalleryItem } from '../../../stores/createStore'import { galleryItemUrl } from './galleryUrl'@@ -137,6 +137,16 @@ export function CreatePanel({ open, onOpenChange, activeId, onSelect }: Props) {// direct /view load, #75) — hooks can't run inside the gallery .map().function GalleryThumb({ g }: { g: GalleryItem }) {const { src, onError, onLoad } = useComfyMedia(g)+ if (g.type === 'audio') {+ // No visual to thumbnail — a labeled tile; the Stage viewer holds the+ // actual <audio> player.+ return (+ <span className="w-full h-full flex flex-col items-center justify-center gap-1 bg-white/[0.03] text-gray-400 p-1">+ <AudioLines size={16} />+ <span className="t-label truncate max-w-full px-1">{g.prompt || 'Audio'}</span>+ </span>+ )+ }return g.type === 'video' ? (<><video src={src} muted playsInline onError={onError} onLoadedData={onLoad} className="w-full h-full object-cover" />diff --git a/src/components/create/experimental/Lightbox.tsx b/src/components/create/experimental/Lightbox.tsxindex 6eda8c4d..241c0536 100644--- a/src/components/create/experimental/Lightbox.tsx+++ b/src/components/create/experimental/Lightbox.tsx@@ -68,7 +68,18 @@ export function Lightbox({ item, onClose }: { item: GalleryItem | null; onClose:<Sparkles size={13} /> Enhance</button>)}- {item.type === 'video' ? (+ {item.type === 'audio' ? (+ <motion.div+ initial={{ scale: 0.95 }}+ animate={{ scale: 1 }}+ exit={{ scale: 0.95 }}+ onClick={(e) => e.stopPropagation()}+ className="w-[480px] max-w-[90vw] flex flex-col items-center gap-4 p-8 rounded-lg bg-white/[0.04] border border-white/[0.08]"+ >+ {item.prompt && <p className="t-body text-gray-300 text-center">{item.prompt}</p>}+ <audio src={mediaUrl} controls autoPlay onError={onMediaError} className="w-full" />+ </motion.div>+ ) : item.type === 'video' ? (<motion.videoinitial={{ scale: 0.95 }}animate={{ scale: 1 }}diff --git a/src/components/create/experimental/ModelChip.tsx b/src/components/create/experimental/ModelChip.tsxindex 85b3e4c2..195b407c 100644--- a/src/components/create/experimental/ModelChip.tsx+++ b/src/components/create/experimental/ModelChip.tsx@@ -1,11 +1,19 @@import { useCreateStore } from '../../../stores/createStore'import { useCloudCatalogStore, defaultCloudModel } from '../../../stores/cloudCatalogStore'+import { useSettingsStore } from '../../../stores/settingsStore'+import { useUIStore } from '../../../stores/uiStore'import { Select, type SelectOption } from '../ui/Select'import { TYPE_BADGE } from './badges'import { isI2VModel, isT2VCapable } from '../../../api/comfyui'const CLOUD_BADGE = { label: 'Cloud', color: 'bg-violet-500/15 text-violet-300' }+// Local-mode discovery (2.5.8): hosted models ride at the bottom of the local+// picker as teaser rows — picking one opens the Cloud sheet instead of+// changing the selection. Value prefix keeps them apart from real checkpoints.+const TEASER_PREFIX = 'lu-cloud-teaser:'+const TEASER_ROWS = 4+// Badge-aware model picker (replaces the raw <select>). Local backend lists// the installed checkpoints; the cloud backend lists the hosted catalog// (server-driven via cloudCatalogStore) and writes the cloud model slugs.@@ -19,12 +27,19 @@ function CloudModelChip() {const intent = useCreateStore((s) => s.intent())const cloudImageModel = useCreateStore((s) => s.cloudImageModel)const cloudVideoModel = useCreateStore((s) => s.cloudVideoModel)+ const cloudOpModel = useCreateStore((s) => s.cloudOpModel)const setCloudImageModel = useCreateStore((s) => s.setCloudImageModel)const setCloudVideoModel = useCreateStore((s) => s.setCloudVideoModel)+ const setCloudOpModel = useCreateStore((s) => s.setCloudOpModel)const models = useCloudCatalogStore((s) => s.models)const isVideo = mode === 'video'const kind = isVideo ? 'video' : 'image'+ // The 2.5.8 specialized intents pick from their op's own family (both+ // trainer kinds together for Character-Studio) and store into cloudOpModel.+ const special =+ intent === 'character' || intent === 'lipsync' || intent === 'music' ||+ intent === 'extend' || intent === 'motion'// List only the models that can run the current op — otherwise the picker// offers checkpoints that useCloudCreate silently swaps out at submit, so the// user's choice was a lie. Edit needs masked-img2img (flux-dev); Animate needs@@ -34,8 +49,15 @@ function CloudModelChip() {intent === 'edit' ? models.filter((m) => m.kind === 'image' && m.edit): intent === 'animate' ? models.filter((m) => m.kind === 'video' && m.i2v !== false): intent === 'video' ? models.filter((m) => m.kind === 'video' && m.t2v !== false)- : models.filter((m) => m.kind === kind)- const current = (isVideo ? cloudVideoModel : cloudImageModel) || defaultCloudModel(kind)?.id || ''+ : intent === 'character' ? models.filter((m) => m.ops?.includes('lora-train'))+ : intent === 'lipsync' ? models.filter((m) => m.ops?.includes('lipsync'))+ : intent === 'music' ? models.filter((m) => m.ops?.includes('music'))+ : intent === 'extend' ? models.filter((m) => m.ops?.includes('extend'))+ : intent === 'motion' ? models.filter((m) => m.ops?.includes('motion'))+ : models.filter((m) => m.kind === kind && !m.ops)+ const current = special+ ? cloudOpModel+ : (isVideo ? cloudVideoModel : cloudImageModel) || defaultCloudModel(kind)?.id || ''// Reflect the model the run will really use, so a leftover pick the current op// can't perform doesn't show as "selected".const value = list.some((m) => m.id === current) ? current : (list[0]?.id ?? current)@@ -54,7 +76,9 @@ function CloudModelChip() {className="min-w-[150px] max-w-[230px]"options={options}value={value}- onChange={(v) => (isVideo ? setCloudVideoModel(v) : setCloudImageModel(v))}+ onChange={(v) =>+ special ? setCloudOpModel(v) : isVideo ? setCloudVideoModel(v) : setCloudImageModel(v)+ }/>)}@@ -68,6 +92,9 @@ function LocalModelChip() {const videoModelList = useCreateStore((s) => s.videoModelList)const setImageModel = useCreateStore((s) => s.setImageModel)const setVideoModel = useCreateStore((s) => s.setVideoModel)+ const teasersEnabled = useSettingsStore((s) => s.settings.cloudTeasersEnabled)+ const setCloudTeaser = useUIStore((s) => s.setCloudTeaser)+ const catalogModels = useCloudCatalogStore((s) => s.models)const isVideo = mode === 'video'@@ -90,6 +117,14 @@ function LocalModelChip() {label: prettyName(m.name),badge: TYPE_BADGE[m.type],}))+ // Discovery rows: a few hosted models of this kind at the list's tail.+ // Picking one opens the Cloud sheet; the local selection stays untouched.+ if (teasersEnabled) {+ const kind = isVideo ? 'video' : 'image'+ for (const m of catalogModels.filter((c) => c.kind === kind && !c.ops).slice(0, TEASER_ROWS)) {+ options.push({ value: `${TEASER_PREFIX}${m.id}`, label: m.label, badge: CLOUD_BADGE })+ }+ }return (<Select@@ -100,6 +135,14 @@ function LocalModelChip() {options={options}value={value}onChange={(v) => {+ if (v.startsWith(TEASER_PREFIX)) {+ setCloudTeaser({+ surface: 'create-model',+ kind: isVideo ? 'video' : 'image',+ modelId: v.slice(TEASER_PREFIX.length),+ })+ return+ }if (isVideo) setVideoModel(v)else {const m = list.find((x) => x.name === v)diff --git a/src/components/create/experimental/OutputView.tsx b/src/components/create/experimental/OutputView.tsxindex 521919d3..d553565f 100644--- a/src/components/create/experimental/OutputView.tsx+++ b/src/components/create/experimental/OutputView.tsx@@ -1,5 +1,5 @@import { motion } from 'framer-motion'-import { Cpu, Sparkles, ImageDown, Maximize2, Download, Wand2, MonitorOff } from 'lucide-react'+import { Cpu, Sparkles, ImageDown, Maximize2, Download, Wand2, MonitorOff, AudioLines } from 'lucide-react'import { useCreateStore, type GalleryItem, type ProgressPhase } from '../../../stores/createStore'import { downloadComfyFile, isTauri } from '../../../api/backend'import { refreshResultUrl } from '../../../api/cloud/jobs'@@ -63,13 +63,16 @@ interface ResultProps {onSendToEditor?: () => void}-function extFor(contentType: string, kind: 'image' | 'video'): string {+function extFor(contentType: string, kind: 'image' | 'video' | 'audio'): string {if (contentType.includes('png')) return 'png'if (contentType.includes('jpeg') || contentType.includes('jpg')) return 'jpg'if (contentType.includes('webp')) return 'webp'if (contentType.includes('mp4')) return 'mp4'if (contentType.includes('webm')) return 'webm'- return kind === 'video' ? 'mp4' : 'png'+ if (contentType.includes('mpeg') || contentType.includes('mp3')) return 'mp3'+ if (contentType.includes('wav')) return 'wav'+ if (contentType.includes('ogg')) return 'ogg'+ return kind === 'video' ? 'mp4' : kind === 'audio' ? 'mp3' : 'png'}// Save a gallery item. Local ComfyUI outputs (non-empty filename) go through@@ -143,11 +146,20 @@ export function ResultView({ item, onFullscreen, onSendToEditor }: ResultProps)const { src: url, onError } = useComfyMedia(item)const download = () => void downloadGalleryItem(item)const isVideo = item.type === 'video'+ const isAudio = item.type === 'audio'return (<div className="flex-1 min-h-0 overflow-y-auto scrollbar-thin flex flex-col"><div className="m-auto flex flex-col items-center p-6"><div className="relative group max-w-full max-h-full">- {isVideo ? (+ {isAudio ? (+ <div className="w-[420px] max-w-full flex flex-col items-center gap-3 p-6 rounded-[var(--radius-panel)] border border-white/[0.06] bg-white/[0.02]">+ <AudioLines size={26} className="text-gray-400" strokeWidth={1.5} />+ {item.prompt && (+ <p className="t-body text-gray-400 text-center line-clamp-2">{item.prompt}</p>+ )}+ <audio src={url} controls onError={onError} className="w-full" onLoadedData={() => markGalleryItemAvailable(item)} />+ </div>+ ) : isVideo ? (<videosrc={url}controls@@ -174,7 +186,7 @@ export function ResultView({ item, onFullscreen, onSendToEditor }: ResultProps)</div>)}<div className="absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity">- {onSendToEditor && !isVideo && !item.unavailable && (+ {onSendToEditor && item.type === 'image' && !item.unavailable && (<IconBtn title="Edit with mask" onClick={onSendToEditor}><Wand2 size={14} /></IconBtn>)}<IconBtn@@ -184,14 +196,20 @@ export function ResultView({ item, onFullscreen, onSendToEditor }: ResultProps)><Download size={14} /></IconBtn>- <IconBtn title="Fullscreen" onClick={onFullscreen}><Maximize2 size={14} /></IconBtn>+ {!isAudio && (+ <IconBtn title="Fullscreen" onClick={onFullscreen}><Maximize2 size={14} /></IconBtn>+ )}</div></div><div className="flex items-center gap-3 mt-3 t-mono text-gray-600">- <span>{item.width}×{item.height}</span>- <span>·</span>- <span>seed {item.seed}</span>- <span>·</span>+ {!isAudio && (+ <>+ <span>{item.width}×{item.height}</span>+ <span>·</span>+ <span>seed {item.seed}</span>+ <span>·</span>+ </>+ )}<span className="truncate max-w-[280px]">{prettyModel(item.model)}</span></div></div>diff --git a/src/components/create/experimental/SpecialIntentControls.tsx b/src/components/create/experimental/SpecialIntentControls.tsxnew file mode 100644index 00000000..f6544379--- /dev/null+++ b/src/components/create/experimental/SpecialIntentControls.tsx@@ -0,0 +1,567 @@+// Composer surfaces for the 2.5.8 hosted Create categories (Character-Studio,+// talking character, music, extend, motion). Each intent owns exactly the+// inputs its endpoint consumes; everything stages into createStore slots and+// useCloudCreate submits them. Cloud-only by construction — the IntentBar only+// offers these intents on the cloud backend.++import { useEffect, useRef, useState } from 'react'+import { AnimatePresence, motion } from 'framer-motion'+import {+ AudioLines, Film, ImagePlus, Mic, Music2, Trash2, Upload, Wand2, X,+} from 'lucide-react'+import { useCreateStore, type CreateIntent, type MediaRef } from '../../../stores/createStore'+import { useCloudCatalogStore, cloudModelById, modelForOp } from '../../../stores/cloudCatalogStore'+import { listLoras, deleteLora, type CloudLora } from '../../../api/cloud/loras'+import { useCreateExp } from './CreateContext'+import { loadImageRef } from './loadImage'+import { Button } from '../ui/Button'+import { Segmented } from '../ui/Segmented'+import { Slider } from '../ui/Slider'+import { cn } from '../ui/cn'+import { useClickAway } from '../ui/useClickAway'++export function SpecialControls({ intent }: { intent: CreateIntent }) {+ switch (intent) {+ case 'character': return <CharacterPanel />+ case 'lipsync': return <LipsyncControls />+ case 'music': return <MusicControls />+ case 'extend': return <ExtendControls />+ case 'motion': return <MotionControls />+ default: return null+ }+}++// ── shared chip: a small labeled file slot (audio/video/image) ──────────────++function mediaRefFrom(file: File): MediaRef {+ return { name: file.name, url: URL.createObjectURL(file), blob: file }+}++function FileChip({+ icon: Icon,+ empty,+ value,+ accept,+ onFile,+ onClear,+}: {+ icon: typeof Upload+ empty: string+ value: string | null+ accept: string+ onFile: (f: File) => void+ onClear: () => void+}) {+ const inputRef = useRef<HTMLInputElement>(null)+ return (+ <div className="flex items-center">+ <input+ ref={inputRef}+ type="file"+ accept={accept}+ className="hidden"+ onChange={(e) => {+ const f = e.target.files?.[0]+ if (f) onFile(f)+ e.target.value = ''+ }}+ />+ <button+ onClick={() => inputRef.current?.click()}+ className={cn(+ 't-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',+ value+ ? '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 hover:border-white/15',+ )}+ >+ <Icon size={12} />+ <span className="max-w-[140px] truncate">{value ?? empty}</span>+ </button>+ {value && (+ <button onClick={onClear} className="p-1 text-gray-500 hover:text-gray-300" title="Remove" aria-label="Remove">+ <X size={11} />+ </button>+ )}+ </div>+ )+}++// The character-image slot writes the shared Stage source (an ImageRef with a+// data-URL preview — the cloud upload path re-encodes from it).+function PortraitChip({ empty }: { empty: string }) {+ const source = useCreateStore((s) => s.source)+ const setSource = useCreateStore((s) => s.setSource)+ return (+ <FileChip+ icon={ImagePlus}+ empty={empty}+ value={source ? 'Image ready' : null}+ accept="image/*"+ onFile={(f) => { void loadImageRef(f).then(setSource) }}+ onClear={() => setSource(null)}+ />+ )+}++function DrivingVideoChip({ empty }: { empty: string }) {+ const videoInput = useCreateStore((s) => s.videoInput)+ const setVideoInput = useCreateStore((s) => s.setVideoInput)+ return (+ <FileChip+ icon={Film}+ empty={empty}+ value={videoInput?.name ?? null}+ accept="video/mp4,video/webm,video/quicktime"+ onFile={(f) => setVideoInput(mediaRefFrom(f))}+ onClear={() => setVideoInput(null)}+ />+ )+}++// ── Character-Studio ────────────────────────────────────────────────────────++const FAMILY_LABEL: Record<string, string> = {+ flux: 'Flux',+ 'z-image': 'Z-Image',+ 'qwen-image': 'Qwen',+ 'ltx-2': 'LTX video',+}++function CharacterPanel() {+ const characterTab = useCreateStore((s) => s.characterTab)+ const setCharacterTab = useCreateStore((s) => s.setCharacterTab)+ const triggerWord = useCreateStore((s) => s.triggerWord)+ const setTriggerWord = useCreateStore((s) => s.setTriggerWord)+ const trainImages = useCreateStore((s) => s.trainImages)+ const selectedCharacter = useCreateStore((s) => s.selectedCharacter)+ const setSelectedCharacter = useCreateStore((s) => s.setSelectedCharacter)+ const charactersVersion = useCreateStore((s) => s.charactersVersion)+ const [shelf, setShelf] = useState<CloudLora[] | null>(null)++ useEffect(() => {+ let live = true+ listLoras()+ .then((l) => { if (live) setShelf(l) })+ .catch(() => { if (live) setShelf([]) })+ return () => { live = false }+ }, [charactersVersion])++ return (+ <div className="space-y-2">+ <div className="flex items-center justify-center">+ <Segmented+ size="sm"+ layoutId="character-tab"+ value={characterTab}+ onChange={(v) => setCharacterTab(v as 'train' | 'use')}+ options={[+ { value: 'train', label: 'Train new' },+ { value: 'use', label: 'Use character' },+ ]}+ />+ </div>+ {characterTab === 'train' ? (+ <div className="flex items-center justify-center gap-2 flex-wrap">+ <input+ value={triggerWord}+ onChange={(e) => setTriggerWord(e.target.value)}+ placeholder="Trigger word, e.g. davechar"+ className="t-control w-44 px-2.5 h-[var(--control-h-sm)] rounded-md bg-white/[0.03] border border-white/[0.06] text-gray-200 placeholder-gray-600 focus:outline-none focus:border-white/15"+ />+ <span className="t-label text-gray-600">+ {trainImages.length}/30 photos added{trainImages.length < 4 ? ' — need at least 4' : ''}+ </span>+ </div>+ ) : (+ <div className="flex items-center justify-center gap-1.5 flex-wrap">+ {shelf === null && <span className="t-label text-gray-600">Loading your characters…</span>}+ {shelf?.length === 0 && (+ <span className="t-label text-gray-600">No characters yet — train one first.</span>+ )}+ {shelf?.map((c) => {+ const active = selectedCharacter?.id === c.id+ return (+ <div key={c.id} className="flex items-center">+ <button+ onClick={() =>+ setSelectedCharacter(+ active+ ? null+ : { id: c.id, name: c.name, triggerWord: c.trigger_word, family: c.base_family },+ )+ }+ className={cn(+ 't-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',+ active+ ? 'bg-white/10 border-white/20 text-white'+ : 'bg-white/[0.03] border-white/[0.06] text-gray-400 hover:text-gray-200',+ )}+ title={`Trigger word: ${c.trigger_word}`}+ >+ <span className="max-w-[110px] truncate">{c.name}</span>+ <span className="t-label text-gray-500">{FAMILY_LABEL[c.base_family] ?? c.base_family}</span>+ </button>+ <button+ onClick={() => {+ void deleteLora(c.id)+ .then(() => {+ if (selectedCharacter?.id === c.id) setSelectedCharacter(null)+ useCreateStore.getState().bumpCharactersVersion()+ })+ .catch(() => {})+ }}+ className="p-1 text-gray-600 hover:text-red-400"+ title="Delete character"+ aria-label="Delete character"+ >+ <Trash2 size={11} />+ </button>+ </div>+ )+ })}+ {selectedCharacter && (+ <span className="t-label text-gray-500 w-full text-center">+ Put “{selectedCharacter.triggerWord}” in your prompt to summon the character.+ </span>+ )}+ </div>+ )}+ </div>+ )+}++// ── Talking character (lipsync) ─────────────────────────────────────────────++function LipsyncControls() {+ const cloudOpModel = useCreateStore((s) => s.cloudOpModel)+ const audioInput = useCreateStore((s) => s.audioInput)+ const setAudioInput = useCreateStore((s) => s.setAudioInput)+ const voiceFromJob = useCreateStore((s) => s.voiceFromJob)+ const setVoiceFromJob = useCreateStore((s) => s.setVoiceFromJob)+ // Catalog subscription so the chip row re-renders when the live catalog+ // arrives and flips the picked model's source type.+ useCloudCatalogStore((s) => s.fetchedAt)+ const model = cloudModelById(modelForOp('video', 'lipsync', cloudOpModel))+ const needsClip = model?.lipsync_source === 'video'++ return (+ <div className="flex items-center justify-center gap-2 flex-wrap">+ {needsClip ? (+ <DrivingVideoChip empty="Add video to re-sync" />+ ) : (+ <PortraitChip empty="Add portrait" />+ )}+ <VoiceChip+ audioName={audioInput?.name ?? null}+ voiceLabel={voiceFromJob?.label ?? null}+ onAudioFile={(f) => setAudioInput(mediaRefFrom(f))}+ onPickVoice={(jobId, label) => setVoiceFromJob({ jobId, label })}+ onClear={() => { setAudioInput(null); setVoiceFromJob(null) }}+ />+ </div>+ )+}++const TTS_VOICES = ['cherry', 'serena', 'ethan', 'chelsie'] as const++function VoiceChip({+ audioName,+ voiceLabel,+ onAudioFile,+ onPickVoice,+ onClear,+}: {+ audioName: string | null+ voiceLabel: string | null+ onAudioFile: (f: File) => void+ onPickVoice: (jobId: string, label: string) => void+ onClear: () => void+}) {+ const [open, setOpen] = useState(false)+ const [makerOpen, setMakerOpen] = useState(false)+ const [text, setText] = useState('')+ const [mode, setMode] = useState<'speak' | 'design'>('speak')+ const [voice, setVoice] = useState<string>(TTS_VOICES[0])+ const [description, setDescription] = useState('')+ const inputRef = useRef<HTMLInputElement>(null)+ const ref = useRef<HTMLDivElement>(null)+ useClickAway(ref, () => { setOpen(false); setMakerOpen(false) }, open || makerOpen)+ const { makeVoice } = useCreateExp()+ const isGenerating = useCreateStore((s) => s.isGenerating)+ const audioItems = useCreateStore((s) => s.gallery).filter((g) => g.type === 'audio' && g.jobId)++ const value = audioName ?? voiceLabel+ return (+ <div ref={ref} className="relative flex items-center">+ <input+ ref={inputRef}+ type="file"+ accept="audio/*"+ className="hidden"+ onChange={(e) => {+ const f = e.target.files?.[0]+ if (f) { onAudioFile(f); setOpen(false) }+ e.target.value = ''+ }}+ />+ <button+ onClick={() => setOpen((o) => !o)}+ className={cn(+ 't-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',+ value+ ? '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 hover:border-white/15',+ )}+ >+ <Mic size={12} />+ <span className="max-w-[150px] truncate">{value ?? 'Add voice'}</span>+ </button>+ {value && (+ <button onClick={onClear} className="p-1 text-gray-500 hover:text-gray-300" title="Remove voice" aria-label="Remove voice">+ <X size={11} />+ </button>+ )}+ <AnimatePresence>+ {open && (+ <motion.div+ initial={{ opacity: 0, y: 4 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: 4 }}+ transition={{ duration: 0.12 }}+ className="lu-elevated absolute bottom-full mb-1.5 left-0 z-50 w-72 rounded-lg p-1.5 space-y-1"+ >+ {!makerOpen ? (+ <>+ <button+ onClick={() => { inputRef.current?.click() }}+ className="w-full flex items-center gap-2 t-control text-gray-300 px-2.5 py-1.5 rounded-md hover:bg-white/[0.06]"+ >+ <Upload size={12} /> Upload an audio file+ </button>+ <button+ onClick={() => setMakerOpen(true)}+ className="w-full flex items-center gap-2 t-control text-gray-300 px-2.5 py-1.5 rounded-md hover:bg-white/[0.06]"+ >+ <Wand2 size={12} /> Generate a voice (AI)+ </button>+ {audioItems.length > 0 && (+ <div className="pt-1 border-t border-white/[0.06]">+ <div className="t-label text-gray-600 px-2.5 py-1">Your generated audio</div>+ <div className="max-h-36 overflow-y-auto scrollbar-thin">+ {audioItems.map((g) => (+ <button+ key={g.id}+ onClick={() => {+ onPickVoice(g.jobId as string, g.prompt.slice(0, 40) || 'Generated audio')+ setOpen(false)+ }}+ className="w-full flex items-center gap-2 t-control text-gray-300 px-2.5 py-1.5 rounded-md hover:bg-white/[0.06]"+ >+ <AudioLines size={12} />+ <span className="truncate">{g.prompt || 'Generated audio'}</span>+ </button>+ ))}+ </div>+ </div>+ )}+ </>+ ) : (+ <div className="p-1.5 space-y-2">+ <textarea+ value={text}+ onChange={(e) => setText(e.target.value)}+ placeholder="What should the character say?"+ rows={2}+ 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"+ />+ <div className="flex items-center gap-2">+ <Segmented+ size="sm"+ layoutId="tts-mode"+ value={mode}+ onChange={(v) => setMode(v as 'speak' | 'design')}+ options={[+ { value: 'speak', label: 'Voice' },+ { value: 'design', label: 'Describe' },+ ]}+ />+ {mode === 'speak' ? (+ <select+ value={voice}+ onChange={(e) => setVoice(e.target.value)}+ className="t-control flex-1 px-2 h-[var(--control-h-sm)] rounded-md bg-white/[0.03] border border-white/[0.06] text-gray-200 focus:outline-none"+ >+ {TTS_VOICES.map((v) => (+ <option key={v} value={v}>{v}</option>+ ))}+ </select>+ ) : (+ <input+ value={description}+ onChange={(e) => setDescription(e.target.value)}+ placeholder="warm narrator, slight rasp…"+ className="t-control flex-1 px-2 h-[var(--control-h-sm)] rounded-md bg-white/[0.03] border border-white/[0.06] text-gray-200 placeholder-gray-600 focus:outline-none"+ />+ )}+ </div>+ <Button+ variant="primary"+ size="sm"+ icon={Wand2}+ disabled={isGenerating || !text.trim()}+ onClick={() => {+ void makeVoice({ text, mode, voice, description })+ setOpen(false)+ setMakerOpen(false)+ }}+ >+ Make voice+ </Button>+ </div>+ )}+ </motion.div>+ )}+ </AnimatePresence>+ </div>+ )+}++// ── Music ───────────────────────────────────────────────────────────────────++function MusicControls() {+ const musicDuration = useCreateStore((s) => s.musicDuration)+ const setMusicDuration = useCreateStore((s) => s.setMusicDuration)+ const musicLyrics = useCreateStore((s) => s.musicLyrics)+ const setMusicLyrics = useCreateStore((s) => s.setMusicLyrics)+ const [lyricsOpen, setLyricsOpen] = useState(musicLyrics.length > 0)++ 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>+ <button+ onClick={() => setLyricsOpen((o) => !o)}+ className={cn(+ 't-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',+ lyricsOpen+ ? '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+ </button>+ </div>+ <AnimatePresence>+ {lyricsOpen && (+ <motion.div+ initial={{ height: 0, opacity: 0 }}+ animate={{ height: 'auto', opacity: 1 }}+ exit={{ height: 0, opacity: 0 }}+ className="overflow-hidden"+ >+ <textarea+ value={musicLyrics}+ onChange={(e) => setMusicLyrics(e.target.value)}+ placeholder="Optional lyrics — models that sing will use them…"+ rows={3}+ 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>+ )}+ </AnimatePresence>+ </div>+ )+}++// ── Extend ──────────────────────────────────────────────────────────────────++function ExtendControls() {+ const extendSource = useCreateStore((s) => s.extendSource)+ const setExtendSource = useCreateStore((s) => s.setExtendSource)+ const clips = useCreateStore((s) => s.gallery).filter((g) => g.type === 'video' && g.jobId)+ const [open, setOpen] = useState(false)+ const ref = useRef<HTMLDivElement>(null)+ useClickAway(ref, () => setOpen(false), open)++ return (+ <div className="flex items-center justify-center">+ <div ref={ref} className="relative flex items-center">+ <button+ onClick={() => setOpen((o) => !o)}+ className={cn(+ 't-control flex items-center gap-1.5 px-2.5 h-[var(--control-h-sm)] rounded-md border transition-colors',+ extendSource+ ? '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 hover:border-white/15',+ )}+ >+ <Film size={12} />+ <span className="max-w-[200px] truncate">+ {extendSource ? extendSource.label : 'Pick one of your cloud videos'}+ </span>+ </button>+ {extendSource && (+ <button onClick={() => setExtendSource(null)} className="p-1 text-gray-500 hover:text-gray-300" title="Clear" aria-label="Clear">+ <X size={11} />+ </button>+ )}+ <AnimatePresence>+ {open && (+ <motion.div+ initial={{ opacity: 0, y: 4 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: 4 }}+ transition={{ duration: 0.12 }}+ className="lu-elevated absolute bottom-full mb-1.5 left-1/2 -translate-x-1/2 z-50 w-72 rounded-lg p-1 max-h-64 overflow-y-auto scrollbar-thin"+ >+ {clips.length === 0 && (+ <div className="t-control text-gray-500 px-2.5 py-2">+ No cloud videos yet — render one on the Video tab first.+ </div>+ )}+ {clips.map((g) => (+ <button+ key={g.id}+ onClick={() => {+ setExtendSource({+ jobId: g.jobId as string,+ url: g.remoteUrl ?? '',+ label: g.prompt.slice(0, 40) || 'Cloud video',+ })+ setOpen(false)+ }}+ className="w-full flex items-center gap-2 t-control text-gray-300 px-2.5 py-1.5 rounded-md hover:bg-white/[0.06]"+ >+ <Film size={12} />+ <span className="truncate">{g.prompt || 'Cloud video'}</span>+ </button>+ ))}+ </motion.div>+ )}+ </AnimatePresence>+ </div>+ </div>+ )+}++// ── Motion control ──────────────────────────────────────────────────────────++function MotionControls() {+ return (+ <div className="flex items-center justify-center gap-2 flex-wrap">+ <PortraitChip empty="Add character image" />+ <DrivingVideoChip empty="Add driving video (dance/pose)" />+ </div>+ )+}diff --git a/src/components/create/experimental/Stage.tsx b/src/components/create/experimental/Stage.tsxindex 198a21d2..505f10aa 100644--- a/src/components/create/experimental/Stage.tsx+++ b/src/components/create/experimental/Stage.tsx@@ -52,6 +52,9 @@ export function Stage({ displayed, onOpenMaskEditor, onEditResult, onFullscreen// source was loaded — otherwise an older gallery item would hijack the stage.const freshResult = displayed && displayed.createdAt >= sourceSetAt+ const characterTab = useCreateStore((s) => s.characterTab)+ const characterTrain = intent === 'character' && characterTab === 'train'+let body: React.ReactNodeif (isGenerating) {body = <GeneratingView />@@ -59,6 +62,10 @@ export function Stage({ displayed, onOpenMaskEditor, onEditResult, onFullscreenbody = <ModelInstallCard kind={meta.requiresModels!} />} else if (meta.capability && !capReady) {body = <CapabilityCard cap={meta.capability} />+ } else if (characterTrain) {+ // Character-Studio training board: the image SET lives here (4-30 photos);+ // trigger word + train button sit in the composer below.+ body = <TrainSetBoard />} else if (meta.needsSource && !source) {body = <InputSlot />} else if (meta.needsSource && source && !freshResult) {@@ -412,3 +419,80 @@ function ModelInstallCard({ kind }: { kind: 'image' | 'video' }) {</EmptyState>)}++// ── Character-Studio training board (2.5.8): the 4-30 photo set. Trigger word+// and the Create (train) button live in the composer; this is the visual home+// of the image set with add/remove + drag&drop. ──+function TrainSetBoard() {+ const trainImages = useCreateStore((s) => s.trainImages)+ const addTrainImages = useCreateStore((s) => s.addTrainImages)+ const removeTrainImage = useCreateStore((s) => s.removeTrainImage)+ const inputRef = useRef<HTMLInputElement>(null)++ const addFiles = (files: FileList | File[]) => {+ const imgs = Array.from(files)+ .filter((f) => f.type.startsWith('image/'))+ .map((f) => ({ name: f.name, url: URL.createObjectURL(f), blob: f as Blob }))+ if (imgs.length > 0) addTrainImages(imgs)+ }++ return (+ <div+ className="flex-1 min-h-0 flex flex-col p-4 gap-3"+ onDragOver={(e) => e.preventDefault()}+ onDrop={(e) => { e.preventDefault(); addFiles(e.dataTransfer.files) }}+ >+ <input+ ref={inputRef}+ type="file"+ accept="image/*"+ multiple+ className="hidden"+ onChange={(e) => { if (e.target.files) addFiles(e.target.files); e.target.value = '' }}+ />+ {trainImages.length === 0 ? (+ <button+ onClick={() => inputRef.current?.click()}+ className="flex-1 rounded-xl border-2 border-dashed border-white/10 hover:border-white/25 transition-colors flex flex-col items-center justify-center gap-2 text-gray-500 hover:text-gray-300"+ >+ <UploadCloud size={28} />+ <div className="t-body">Drop 4-30 photos of your character here</div>+ <div className="t-label text-gray-600">+ One person or character, varied angles and lighting works best+ </div>+ </button>+ ) : (+ <>+ <div className="flex-1 min-h-0 overflow-y-auto scrollbar-thin">+ <div className="grid grid-cols-4 sm:grid-cols-6 gap-2">+ {trainImages.map((img) => (+ <div key={img.name} className="relative group aspect-square rounded-lg overflow-hidden bg-white/[0.03] border border-white/[0.06]">+ <img src={img.url} alt="" className="w-full h-full object-cover" />+ <button+ onClick={() => removeTrainImage(img.name)}+ className="absolute top-1 right-1 p-1 rounded-md bg-black/60 text-gray-300 opacity-0 group-hover:opacity-100 hover:text-white transition-opacity"+ title="Remove"+ aria-label="Remove"+ >+ <X size={11} />+ </button>+ </div>+ ))}+ <button+ onClick={() => inputRef.current?.click()}+ className="aspect-square rounded-lg border-2 border-dashed border-white/10 hover:border-white/25 flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors"+ title="Add photos"+ aria-label="Add photos"+ >+ <ImagePlus size={18} />+ </button>+ </div>+ </div>+ <div className="t-label text-gray-500 text-center shrink-0">+ {trainImages.length}/30 photos — training runs in the cloud and lands the character on your shelf.+ </div>+ </>+ )}+ </div>+ )+}diff --git a/src/components/create/experimental/intents.ts b/src/components/create/experimental/intents.tsindex ae92ac57..b755d7e0 100644--- a/src/components/create/experimental/intents.ts+++ b/src/components/create/experimental/intents.ts@@ -1,4 +1,7 @@-import { Image as ImageIcon, Wand2, Scissors, Video, Film, Maximize2, Eraser } from 'lucide-react'+import {+ Image as ImageIcon, Wand2, Scissors, Video, Film, Maximize2, Eraser,+ UserRound, Mic, Music, FastForward, PersonStanding,+} from 'lucide-react'import type { LucideIcon } from 'lucide-react'import type { CreateIntent } from '../../../stores/createStore'@@ -83,6 +86,54 @@ export const INTENTS: IntentMeta[] = [requiresModels: 'video',examples: ['slow zoom in, subtle parallax', 'hair and clothes moving in the wind'],},++ // ── 2.5.8 hosted categories (WaveSpeed, 2026-07-17 David). All cloudOnly;+ // their composer surfaces own the extra inputs (training set, audio, driving+ // video, extend pick), so needsSource/needsPrompt describe only what the+ // shared composer scaffolding should render. ────────────────────────────────+ {+ id: 'character', label: 'Character Studio', short: 'Character', icon: UserRound,+ placeholder: 'Describe the scene for your character…',+ needsSource: false, needsPrompt: false, allowsMask: false, isVideo: false,+ cloudOnly: true,+ examples: [],+ },+ {+ // Inputs (portrait or base clip + speech audio) are composer chips, not+ // the Stage source slot — which input the model needs depends on the+ // picked endpoint (photo-avatar vs re-sync).+ id: 'lipsync', label: 'Talking Character', short: 'Lipsync', icon: Mic,+ placeholder: '',+ needsSource: false, needsPrompt: false, allowsMask: false, isVideo: true,+ cloudOnly: true,+ examples: [],+ },+ {+ id: 'music', label: 'Music', short: 'Music', icon: Music,+ placeholder: 'Describe the track — genre, mood, tempo, instruments…',+ needsSource: false, needsPrompt: true, allowsMask: false, isVideo: false,+ cloudOnly: true,+ examples: [+ 'dreamy lo-fi hip hop, vinyl crackle, mellow keys',+ 'epic orchestral trailer, driving percussion',+ 'upbeat synthwave, retro 80s arps',+ ],+ },+ {+ id: 'extend', label: 'Extend Video', short: 'Extend', icon: FastForward,+ placeholder: 'Describe how the clip should continue…',+ needsSource: false, needsPrompt: true, allowsMask: false, isVideo: true,+ cloudOnly: true,+ examples: [],+ },+ {+ // Character image + driving video are composer chips (see lipsync note).+ id: 'motion', label: 'Motion Control', short: 'Motion', icon: PersonStanding,+ placeholder: 'Optional: extra style/scene hints…',+ needsSource: false, needsPrompt: false, allowsMask: false, isVideo: true,+ cloudOnly: true,+ examples: [],+ },]export const INTENT_MAP: Record<CreateIntent, IntentMeta> =diff --git a/src/hooks/useCloudCreate.ts b/src/hooks/useCloudCreate.tsindex d700b1c3..ab958640 100644--- a/src/hooks/useCloudCreate.ts+++ b/src/hooks/useCloudCreate.ts@@ -25,10 +25,32 @@ import {import {defaultCloudModel,modelForOp,+ cloudModelById,cloudMediaLive,} from '../stores/cloudCatalogStore'import { checkPromptSafety, SAFETY_BLOCK_MESSAGE } from '../lib/render/safety'+// Character-Studio generation endpoint per trained-LoRA family (fast default;+// mirrors uselu's LORA_GEN_FAMILY — ltx-2 video characters have no image-gen+// lane and qwen has no -lora generation endpoint yet).+const CHARACTER_GEN_DEFAULT: Record<string, string> = {+ flux: 'flux-schnell-lora',+ 'z-image': 'z-image-turbo-lora',+}++// Per-op progress verb — "Rendering" reads wrong for a training run or a song.+function opProgressVerb(op: string): string {+ switch (op) {+ case 'lora-train': return 'Training your character…'+ case 'music': return 'Composing…'+ case 'tts': return 'Generating the voice…'+ case 'lipsync': return 'Syncing the performance…'+ case 'extend': return 'Extending the clip…'+ case 'motion': return 'Transferring the motion…'+ default: return 'Rendering in the cloud…'+ }+}+// Decoded by hand instead of fetch(dataUrl): the webview CSP's connect-src// (rightly) has no data: entry, so fetching a data URL throws "Load failed"// and killed every source-needing op before the upload even started.@@ -73,11 +95,31 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {const s = useCreateStore.getState()if (s.isGenerating) returnconst intent = s.intent()- const { kind, op } = intentToJob(intent)- const picked =- (kind === 'video' ? s.cloudVideoModel : s.cloudImageModel) || defaultCloudModel(kind).id+ let { kind, op } = intentToJob(intent)+ // Character-Studio 'use' surface: a plain image generate with the trained+ // character attached; 'train' (the intentToJob default) books the trainer.+ const characterUse = intent === 'character' && s.characterTab === 'use'+ if (characterUse) {+ kind = 'image'+ op = 'generate'+ }+ const specialOp =+ op === 'lipsync' || op === 'extend' || op === 'motion' ||+ op === 'music' || op === 'tts' || op === 'lora-train'+ let picked: string+ if (characterUse) {+ picked = CHARACTER_GEN_DEFAULT[s.selectedCharacter?.family ?? ''] ?? 'flux-schnell-lora'+ } else if (specialOp) {+ picked = s.cloudOpModel+ } else {+ picked = (kind === 'video' ? s.cloudVideoModel : s.cloudImageModel) || defaultCloudModel(kind).id+ }+ // lora-train: the picked trainer decides the kind (LTX trains video+ // characters) BEFORE coercion, so the video trainer isn't coerced away.+ if (op === 'lora-train' && cloudModelById(picked)?.kind === 'video') kind = 'video'// Coerce a leftover/incapable pick onto a model that can run this op- // (edit→i2i, animate→i2v, video→t2v) so the submit never 400s.+ // (edit→i2i, animate→i2v, video→t2v, specialized ops→their family) so the+ // submit never 400s.const model = modelForOp(kind, op, picked)s.setError(null)@@ -87,17 +129,46 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {s.setError('Cloud rendering is coming soon — the GPU fleet is not live yet.')return}- if (op === 'generate' && s.prompt.trim().length === 0) {+ if ((op === 'generate' || op === 'music' || op === 'tts') && s.prompt.trim().length === 0) {s.setError('Please enter a prompt.')return}- // Client-side CSAM gate (UX). The server additionally enforces its- // SFW-cloud policy — its 422 message lands in setError below.- if (checkPromptSafety(`${s.prompt} ${s.negativePrompt}`).blocked) {+ // Client-side CSAM gate (UX) over every free-text field this run sends.+ // The server additionally enforces its SFW-cloud policy — its 422 message+ // lands in setError below.+ if (checkPromptSafety(`${s.prompt} ${s.negativePrompt} ${s.musicLyrics} ${s.triggerWord}`).blocked) {s.setError(SAFETY_BLOCK_MESSAGE)return}- if (op !== 'generate' && !s.source) {+ // Per-intent input contracts (client UX; the server re-checks all of it).+ if (characterUse && !s.selectedCharacter) {+ s.setError('Pick a character from your shelf first — or train one.')+ return+ }+ if (op === 'lora-train' && s.trainImages.length < 4) {+ s.setError('Add at least 4 photos of your character (more is better, up to 30).')+ return+ }+ if (op === 'lipsync') {+ if (!s.audioInput && !s.voiceFromJob) {+ s.setError('Add a voice first — upload an audio file or pick a generated one.')+ return+ }+ const needsClip = cloudModelById(model)?.lipsync_source === 'video'+ if (needsClip ? !s.videoInput : !s.source) {+ s.setError(needsClip ? 'Add the video clip to re-sync.' : 'Add a portrait image for your character.')+ return+ }+ }+ if (op === 'extend' && !s.extendSource) {+ s.setError('Pick one of your cloud videos to extend.')+ return+ }+ if (op === 'motion' && (!s.source || !s.videoInput)) {+ s.setError('Motion control needs a character image and a driving video.')+ return+ }+ if (!specialOp && op !== 'generate' && !s.source) {s.setError('Add a source image first.')return}@@ -112,10 +183,12 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {activeAbort = actry {- // Utility endpoints (removebg/upscale/eraser) take no generation knobs —- // send only what the op consumes so the submit schema stays honest.+ // Utility endpoints (removebg/upscale/eraser) and the 2.5.8 specialized+ // ops take no generation knobs — send only what the op consumes so the+ // submit schema stays honest.const isUtility = op === 'removebg' || op === 'upscale' || op === 'eraser'- const params: CloudJobParams = isUtility+ const bare = isUtility || specialOp+ const params: CloudJobParams = bare? { op }: {op,@@ -126,10 +199,21 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {cfg: s.cfgScale,seed: s.seed === -1 ? undefined : s.seed,}- if (kind === 'video' && !isUtility) {+ if (kind === 'video' && !bare) {params.frames = s.framesparams.fps = s.fps}+ if (op === 'music') {+ params.duration = s.musicDuration+ if (s.musicLyrics.trim()) params.lyrics = s.musicLyrics.trim()+ }+ if (op === 'lora-train') {+ params.trigger_word = s.triggerWord || 'oxlu'+ if (s.triggerWord) params.name = s.triggerWord+ }+ if (characterUse && s.selectedCharacter) {+ params.loras = [{ id: s.selectedCharacter.id }]+ }if (op === 'edit') {params.denoise = s.denoiseparams.grow_mask_by = s.growMaskBy@@ -162,6 +246,36 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {}params.mask_path = await uploadInput(dataUrlToBlob(s.mask.url), 'mask')}+ // ── 2.5.8 specialized inputs ──+ if ((op === 'lipsync' || op === 'motion') && s.videoInput) {+ s.setProgress(6, 'Uploading video…')+ params.video_path = await uploadInput(s.videoInput.blob, 'video')+ }+ if (op === 'lipsync') {+ if (s.audioInput) {+ s.setProgress(8, 'Uploading audio…')+ params.audio_path = await uploadInput(s.audioInput.blob, 'audio')+ } else if (s.voiceFromJob) {+ // A prior own render (tts/music) — fresh signed URL, zero re-upload.+ const vj = await getJob(s.voiceFromJob.jobId)+ if (!vj.result_url) throw new Error('That voice has expired — generate it again first.')+ params.audio_url = vj.result_url+ }+ }+ if (op === 'lora-train') {+ const paths: string[] = []+ for (const [i, img] of s.trainImages.entries()) {+ if (ac.signal.aborted) return+ s.setProgress(5, `Uploading training photos… ${i + 1}/${s.trainImages.length}`)+ paths.push(await uploadInput(img.blob, 'train'))+ }+ params.image_paths = paths+ }+ if (op === 'extend' && s.extendSource) {+ const src = await getJob(s.extendSource.jobId)+ if (!src.result_url) throw new Error('The source clip has expired — re-render it first.')+ params.source_url = src.result_url+ }// Bail before the (credit-claiming) submit if the user cancelled while// we were uploading inputs.@@ -182,11 +296,12 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {if (s.prompt.trim()) s.addToPromptHistory(s.prompt.trim())const startedAt = Date.now()- // Video renders routinely run several minutes and can queue behind- // other jobs on the shared fleet — give them a much longer client- // deadline than images.+ // Video renders and character training routinely run several minutes+ // and can queue behind other jobs on the shared fleet — give them a+ // much longer client deadline than images.+ const verb = opProgressVerb(op)const job = await pollJob(id, {- timeoutMs: kind === 'video' ? 45 * 60_000 : 15 * 60_000,+ timeoutMs: kind === 'video' || op === 'lora-train' ? 45 * 60_000 : 15 * 60_000,signal: ac.signal,onTick: (j) => {const st = useCreateStore.getState()@@ -196,13 +311,21 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {st.setProgress(15, `Waiting for a cloud GPU… ${elapsed}s`)} else if (j.status === 'running') {st.setProgressPhase('sampling')- st.setProgress(Math.min(90, 20 + elapsed), `Rendering in the cloud… ${elapsed}s`)+ st.setProgress(Math.min(90, 20 + elapsed), `${verb} ${elapsed}s`)}},})const st = useCreateStore.getState()- if (job.status === 'succeeded' && job.result_url) {+ if (job.status === 'succeeded' && op === 'lora-train') {+ // Training output is a LoRA on the user's shelf, not a media item —+ // flip Character-Studio to the use-surface with a fresh shelf.+ st.setProgressPhase('complete')+ st.setProgress(100, 'Character trained!')+ st.clearTrainImages()+ st.setCharacterTab('use')+ st.bumpCharactersVersion()+ } else if (job.status === 'succeeded' && job.result_url) {st.setProgressPhase('complete')st.setProgress(100, 'Complete!')st.addToGallery({@@ -269,6 +392,107 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {}}, [onQuotaChange])+ // Talking-character voice maker (qwen3-tts speak/design): a small tts run+ // whose result lands as an audio gallery item AND as the lipsync voice pick+ // (voiceFromJob → audio_url at submit, no client-side byte shuffling).+ const makeVoice = useCallback(+ async (opts: { text: string; mode: 'speak' | 'design'; voice?: string; description?: string }) => {+ const s = useCreateStore.getState()+ if (s.isGenerating) return+ const text = opts.text.trim()+ if (!text) {+ s.setError('Type what the character should say.')+ return+ }+ if (checkPromptSafety(`${text} ${opts.description ?? ''}`).blocked) {+ s.setError(SAFETY_BLOCK_MESSAGE)+ return+ }+ s.setError(null)+ s.setIsGenerating(true)+ s.setProgressPhase('queued')+ s.setProgress(10, 'Submitting to the render queue…')+ const ac = new AbortController()+ activeAbort = ac+ try {+ const model = opts.mode === 'design' ? 'qwen3-tts-design' : 'qwen3-tts'+ const params: CloudJobParams = { op: 'tts' }+ if (opts.mode === 'speak' && opts.voice) params.voice = opts.voice+ if (opts.mode === 'design' && opts.description) params.voice_description = opts.description+ const { id } = await submitCloudJob({ kind: 'audio', model, prompt: text, params })+ if (ac.signal.aborted) {+ cancelJob(id).then(() => onQuotaChange?.()).catch(() => {})+ return+ }+ activeJobId = id+ onQuotaChange?.()++ const startedAt = Date.now()+ const job = await pollJob(id, {+ timeoutMs: 15 * 60_000,+ signal: ac.signal,+ onTick: (j) => {+ const st = useCreateStore.getState()+ const elapsed = Math.round((Date.now() - startedAt) / 1000)+ if (j.status === 'running') {+ st.setProgressPhase('sampling')+ st.setProgress(Math.min(90, 20 + elapsed), `Generating the voice… ${elapsed}s`)+ }+ },+ })++ const st = useCreateStore.getState()+ if (job.status === 'succeeded' && job.result_url) {+ st.setProgressPhase('complete')+ st.setProgress(100, 'Voice ready!')+ const label = text.length > 40 ? `${text.slice(0, 40)}…` : text+ st.addToGallery({+ id: job.id,+ type: 'audio',+ filename: '',+ subfolder: '',+ prompt: text,+ negativePrompt: '',+ model,+ modelType: 'unknown',+ seed: 0,+ steps: 0,+ cfgScale: 0,+ sampler: '',+ scheduler: '',+ width: 0,+ height: 0,+ batchSize: 1,+ createdAt: Date.now(),+ remoteUrl: job.result_url,+ attestation: job.attestation,+ jobId: job.id,+ intent: 'lipsync',+ })+ st.setVoiceFromJob({ jobId: job.id, label })+ } else if (job.status !== 'canceled') {+ st.setError(job.error ?? 'Voice generation failed.')+ onQuotaChange?.()+ }+ } catch (err) {+ const st = useCreateStore.getState()+ if (err instanceof CloudJobError && err.status === 429) {+ st.setError('Monthly credit budget exhausted — upgrade your plan or wait for the next period.')+ } else if (!(err instanceof CloudJobError && err.message === 'polling aborted')) {+ st.setError(err instanceof Error ? err.message : String(err))+ }+ onQuotaChange?.()+ } finally {+ activeJobId = null+ activeAbort = null+ const st = useCreateStore.getState()+ st.setIsGenerating(false)+ st.setProgress(0)+ }+ },+ [onQuotaChange],+ )+// Video super-resolution on a finished cloud render ("Enhance" in the// Lightbox). Re-signs the item's result URL, submits a video:upscale job// against the user's own storage clip, polls, and lands the enhanced clip@@ -361,5 +585,5 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {[onQuotaChange],)- return { generate, cancel, enhanceVideo }+ return { generate, cancel, enhanceVideo, makeVoice }}diff --git a/src/lib/render/cloud-jobs.ts b/src/lib/render/cloud-jobs.tsindex bd441707..a77621b2 100644--- a/src/lib/render/cloud-jobs.ts+++ b/src/lib/render/cloud-jobs.ts@@ -3,10 +3,15 @@import type { CreateIntent } from '../../stores/createStore'-export type RenderKind = 'image' | 'video'+export type RenderKind = 'image' | 'video' | 'audio'// 'upscale'/'eraser' are WaveSpeed utility endpoints (super-resolution /// masked object removal) — cloud-only intents in the Create UI since 2.5.7.-export type RenderOp = 'generate' | 'edit' | 'removebg' | 'animate' | 'upscale' | 'eraser'+// 2.5.8 adds the specialized ops behind the new Create categories: 'lipsync'+// (talking character), 'extend' (continue a clip), 'motion' (motion transfer,+// NOT face-swap — banned), 'music', 'tts' and 'lora-train' (Character-Studio).+export type RenderOp =+ | 'generate' | 'edit' | 'removebg' | 'animate' | 'upscale' | 'eraser'+ | 'lipsync' | 'extend' | 'motion' | 'music' | 'tts' | 'lora-train'// One shared compute-credit wallet — text + media draw from the same budget// (server shape: uselu /api/jobs/quota).@@ -19,7 +24,10 @@ export interface CloudQuota {remaining: { credits: number }}-/** Which queue kind + workflow op a Create intent renders as. */+/** Which queue kind + workflow op a Create intent renders as.+ * 'character' maps per characterTab (train vs use) — see useCloudCreate; the+ * default here is the training op, the use-surface submits a plain image+ * generate with a `loras` reference. */export function intentToJob(intent: CreateIntent): { kind: RenderKind; op: RenderOp } {switch (intent) {case 'edit':@@ -34,6 +42,16 @@ export function intentToJob(intent: CreateIntent): { kind: RenderKind; op: Rendereturn { kind: 'video', op: 'generate' }case 'animate':return { kind: 'video', op: 'animate' }+ case 'character':+ return { kind: 'image', op: 'lora-train' }+ case 'lipsync':+ return { kind: 'video', op: 'lipsync' }+ case 'music':+ return { kind: 'audio', op: 'music' }+ case 'extend':+ return { kind: 'video', op: 'extend' }+ case 'motion':+ return { kind: 'video', op: 'motion' }default:return { kind: 'image', op: 'generate' }}diff --git a/src/lib/render/cloud-models.ts b/src/lib/render/cloud-models.tsindex 552b26d8..345d4b10 100644--- a/src/lib/render/cloud-models.ts+++ b/src/lib/render/cloud-models.ts@@ -4,7 +4,7 @@// fleet/pricing changes without an app update. Keep the ids in sync with// uselu apps/web/lib/render/cloud-models.ts when touching this file.-import type { RenderKind } from './cloud-jobs'+import type { RenderKind, RenderOp } from './cloud-jobs'export interface CloudModel {id: string@@ -18,14 +18,23 @@ export interface CloudModel {/** Video: renders image-to-video (the "Animate Image" intent). Absent = yes;* set false on a t2v-only model to keep it out of the Animate picker. */i2v?: boolean+ /** 2.5.8 op-specialized models (trainers, lipsync, voice, music, extend,+ * motion, LoRA-gen): exactly the ops this model serves. Absent on classic+ * models — every classic picker filters on `!m.ops`. */+ ops?: RenderOp[]+ /** Character-Studio generation endpoint: accepts `params.loras`. */+ lora?: boolean+ /** Lipsync base input: still portrait ('image') or existing clip ('video'). */+ lipsync_source?: 'image' | 'video'/** Whether the hosted endpoint honours guidance_scale (CFG). */cfg?: boolean/** Whether the hosted endpoint honours negative_prompt. */negative_prompt?: boolean/** Video: clip lengths the model books (5s short / 8s long). */clip?: { short: number; long?: number }- /** Per-run credit cost (base = image or 5s clip, long = 8s clip). */- credits?: { base: number; long?: number }+ /** Per-run credit cost (base = image or 5s clip, long = 8s clip; music+ * models additionally quote per_s for the duration slider). */+ credits?: { base: number; long?: number; per_s?: number }}const CLIP = { short: 5, long: 8 }@@ -50,4 +59,33 @@ export const CLOUD_MODEL_SEED: CloudModel[] = [{ id: 'ltx-2', label: 'LTX-2 (with audio)', kind: 'video', t2v: true, i2v: true, clip: CLIP },{ id: 'hunyuan-video', label: 'HunyuanVideo 1.5', kind: 'video', t2v: true, i2v: true, negative_prompt: true, clip: CLIP },{ id: 'ltx-2.3', label: 'LTX 2.3', kind: 'video', t2v: true, i2v: true, clip: CLIP },++ // ── 2.5.8 op-specialized fleet (Character-Studio / lipsync / voice / music /+ // extend / motion). `ops` keeps them out of every classic picker; the live+ // catalog (?v=2) is the pricing truth. Face-swap is banned from this list. ──+ { id: 'flux-lora-trainer', label: 'Flux Character Training', kind: 'image', ops: ['lora-train'] },+ { id: 'z-image-lora-trainer', label: 'Z-Image Character Training', kind: 'image', ops: ['lora-train'] },+ { id: 'qwen-image-lora-trainer', label: 'Qwen Character Training', kind: 'image', ops: ['lora-train'] },+ { id: 'ltx-2-video-lora-trainer', label: 'LTX-2 Video Character Training', kind: 'video', ops: ['lora-train'], t2v: false, i2v: false },+ { id: 'flux-schnell-lora', label: 'Flux Schnell + Character', kind: 'image', ops: ['generate'], lora: true, cfg: true },+ { id: 'flux-dev-lora-ultra-fast', label: 'Flux Dev Fast + Character', kind: 'image', ops: ['generate'], lora: true, cfg: true },+ { id: 'z-image-turbo-lora', label: 'Z-Image Turbo + Character', kind: 'image', ops: ['generate'], lora: true },+ { id: 'z-image-base-lora', label: 'Z-Image + Character', kind: 'image', ops: ['generate'], lora: true },+ { id: 'infinitetalk-fast', label: 'InfiniteTalk (photo avatar)', kind: 'video', ops: ['lipsync'], lipsync_source: 'image', t2v: false, i2v: false },+ { id: 'p-video-avatar', label: 'P-Video Avatar (photo, fast)', kind: 'video', ops: ['lipsync'], lipsync_source: 'image', t2v: false, i2v: false },+ { id: 'latentsync', label: 'LatentSync (re-sync a clip)', kind: 'video', ops: ['lipsync'], lipsync_source: 'video', t2v: false, i2v: false },+ { id: 'lipsync-2', label: 'Lipsync-2 (re-sync a clip)', kind: 'video', ops: ['lipsync'], lipsync_source: 'video', t2v: false, i2v: false },+ { id: 'qwen3-tts', label: 'Qwen3 TTS (voices)', kind: 'audio', ops: ['tts'] },+ { id: 'qwen3-tts-clone', label: 'Qwen3 TTS Voice Clone', kind: 'audio', ops: ['tts'] },+ { id: 'qwen3-tts-design', label: 'Qwen3 TTS Voice Design', kind: 'audio', ops: ['tts'] },+ { id: 'ace-step', label: 'ACE-Step (fast)', kind: 'audio', ops: ['music'], credits: { base: 1200, per_s: 20 } },+ { id: 'ace-step-1.5', label: 'ACE-Step 1.5', kind: 'audio', ops: ['music'], credits: { base: 1800, per_s: 30 } },+ { id: 'sonilo-music', label: 'Sonilo Music', kind: 'audio', ops: ['music'], credits: { base: 15000, per_s: 250 } },+ { id: 'wan-2.2-spicy-extend', label: 'Wan 2.2 Spicy Extend', kind: 'video', ops: ['extend'], t2v: false, i2v: false },+ { id: 'ltx-2-extend', label: 'LTX-2 Extend', kind: 'video', ops: ['extend'], t2v: false, i2v: false },+ { id: 'pixverse-extend', label: 'Pixverse Extend (fast)', kind: 'video', ops: ['extend'], t2v: false, i2v: false },+ { id: 'wan-2.2-animate', label: 'Wan 2.2 Animate', kind: 'video', ops: ['motion'], t2v: false, i2v: false },+ { id: 'steady-dancer', label: 'SteadyDancer', kind: 'video', ops: ['motion'], t2v: false, i2v: false },+ { id: 'p-video-animate', label: 'P-Video Animate (fast)', kind: 'video', ops: ['motion'], t2v: false, i2v: false },+ { id: 'dreamactor-v2', label: 'DreamActor v2', kind: 'video', ops: ['motion'], t2v: false, i2v: false },]diff --git a/src/stores/__tests__/cloudCatalogStore.test.ts b/src/stores/__tests__/cloudCatalogStore.test.tsindex 23626289..dc0b91e1 100644--- a/src/stores/__tests__/cloudCatalogStore.test.ts+++ b/src/stores/__tests__/cloudCatalogStore.test.ts@@ -144,10 +144,21 @@ describe('cloudCatalogStore', () => {],}- it('every seed clip model does both t2v and i2v', () => {- const vids = CLOUD_MODEL_SEED.filter((m) => m.kind === 'video')+ it('every classic seed clip model does both t2v and i2v', () => {+ // Op-specialized 2.5.8 entries (lipsync/extend/motion/trainer) are not+ // clip-generation models and are hard-false on both flags.+ const vids = CLOUD_MODEL_SEED.filter((m) => m.kind === 'video' && !m.ops)expect(vids.length).toBeGreaterThan(0)expect(vids.every((m) => m.t2v !== false && m.i2v !== false)).toBe(true)+ const specialized = CLOUD_MODEL_SEED.filter((m) => m.kind === 'video' && m.ops)+ expect(specialized.length).toBeGreaterThan(0)+ expect(specialized.every((m) => m.t2v === false && m.i2v === false)).toBe(true)+ })++ it('op-specialized seed models never reach the classic pickers', () => {+ useCloudCatalogStore.setState({ models: CLOUD_MODEL_SEED })+ for (const m of t2vModels()) expect(m.ops).toBeUndefined()+ for (const m of i2vModels()) expect(m.ops).toBeUndefined()})it('i2vModels excludes an i2v:false model; an absent flag stays capable', () => {diff --git a/src/stores/cloudCatalogStore.ts b/src/stores/cloudCatalogStore.tsindex 7a8d15cd..fc4e17cf 100644--- a/src/stores/cloudCatalogStore.ts+++ b/src/stores/cloudCatalogStore.ts@@ -53,8 +53,34 @@ export async function refreshCatalog(): Promise<void> {}}+// Classic per-kind list (the Image / Video pickers): op-specialized 2.5.8+// models (`ops` set) are excluded — they live behind their own intents via+// modelsForOp below.export function cloudModelsFor(kind: RenderKind): CloudModel[] {- return useCloudCatalogStore.getState().models.filter((m) => m.kind === kind)+ return useCloudCatalogStore.getState().models.filter((m) => m.kind === kind && !m.ops)+}++// Does this catalog entry serve this op? Classic models (no `ops`) keep their+// flag contract: generate always, edit per flag, animate = video i2v.+export function cloudModelSupportsOp(m: CloudModel, op: RenderOp): boolean {+ if (m.ops) return m.ops.includes(op)+ if (op === 'generate') return m.kind !== 'video' || m.t2v !== false+ if (op === 'edit') return m.edit === true+ if (op === 'animate') return m.kind === 'video' && m.i2v !== false+ return false+}++/** The pickers behind the 2.5.8 intents; 'generate' + kind image restricted to+ * LoRA-capable models yields the Character-Studio generation list. */+export function modelsForOp(kind: RenderKind, op: RenderOp): CloudModel[] {+ return useCloudCatalogStore.getState().models.filter(+ (m) => m.kind === kind && cloudModelSupportsOp(m, op),+ )+}++/** Character-Studio generation endpoints (accept `params.loras`). */+export function loraGenModels(): CloudModel[] {+ return useCloudCatalogStore.getState().models.filter((m) => m.lora === true)}export function defaultCloudModel(kind: RenderKind): CloudModel {@@ -80,11 +106,11 @@ export function defaultEditModel(): CloudModel | undefined {// cached before this field existed still lists every clip model; only an// explicit false hides a capability-restricted model from that picker.export function t2vModels(): CloudModel[] {- return useCloudCatalogStore.getState().models.filter((m) => m.kind === 'video' && m.t2v !== false)+ return useCloudCatalogStore.getState().models.filter((m) => m.kind === 'video' && !m.ops && m.t2v !== false)}export function i2vModels(): CloudModel[] {- return useCloudCatalogStore.getState().models.filter((m) => m.kind === 'video' && m.i2v !== false)+ return useCloudCatalogStore.getState().models.filter((m) => m.kind === 'video' && !m.ops && m.i2v !== false)}/** The model a run will really use for this op — coerces a leftover/incapable@@ -96,6 +122,12 @@ export function modelForOp(kind: RenderKind, op: RenderOp, pickedId: string): stconst list = op === 'animate' ? i2vModels() : t2vModels()return list.some((m) => m.id === pickedId) ? pickedId : (list[0]?.id ?? pickedId)}+ // 2.5.8 op-specialized intents: coerce a stale pick onto a model that+ // actually serves the op (same rule the pickers apply).+ if (op === 'lipsync' || op === 'extend' || op === 'motion' || op === 'music' || op === 'tts' || op === 'lora-train') {+ const list = modelsForOp(kind, op)+ return list.some((m) => m.id === pickedId) ? pickedId : (list[0]?.id ?? pickedId)+ }return pickedId}@@ -115,6 +147,14 @@ export function runCredits(resolution?: string,): number {const { ops } = useCloudCatalogStore.getState()+ // Music bills per second: catalog per_s × the requested duration (60 s+ // default, mirroring the server's MUSIC_SECONDS fallback).+ if (op === 'music') {+ const m = cloudModelById(modelForOp(kind, op, pickedModel))+ const perS = m?.credits?.per_s+ if (perS === undefined) return m?.credits?.base ?? fallback+ return Math.ceil(perS * (seconds && seconds > 0 ? seconds : 60))+ }if (op === 'removebg' || op === 'eraser' || op === 'upscale') {// Video upscale is per-second with a floor; the server defaults to 8 s// when the submit carries no clip length (mirrors mediaCredits).diff --git a/src/stores/createStore.ts b/src/stores/createStore.tsindex 10613cdc..3e5e3e42 100644--- a/src/stores/createStore.ts+++ b/src/stores/createStore.ts@@ -20,13 +20,29 @@ export type CreateBackend = 'local' | 'cloud'* mode / image sub-mode / video sub-mode / removebg. The `mode` + sub-mode* enums stay the load-bearing state; `intent` is a derived view over them.*/-export type CreateIntent = 'image' | 'edit' | 'removebg' | 'video' | 'animate' | 'upscale' | 'eraser'+export type CreateIntent =+ | 'image' | 'edit' | 'removebg' | 'video' | 'animate' | 'upscale' | 'eraser'+ | CloudOp/** Cloud-only single-purpose WaveSpeed endpoints (2.5.7): super-resolution* and masked object removal. Local backends have no lane for them, so the* IntentBar only offers these while the cloud backend is active. */export type UtilityOp = 'upscale' | 'eraser'+/** 2.5.8 cloud-only Create categories (WaveSpeed, 2026-07-17 David):+ * Character-Studio (LoRA training + generation), talking character (lipsync),+ * music, video extend and motion control. Like `utilityOp`, an escape hatch+ * over the image/video mode axis: when set it wins the intent derivation. */+export type CloudOp = 'character' | 'lipsync' | 'music' | 'extend' | 'motion'++/** An audio/video file (or training image) staged in the composer before+ * upload. `blob` carries the bytes for the cloud upload; `url` is a local+ * object URL for preview. Runtime-only — blobs can never persist. */+export interface MediaRef { name: string; url: string; blob: Blob }++/** A trained character on the user's cloud shelf (server: user_loras). */+export interface CharacterRef { id: string; name: string; triggerWord: string; family: string }+/*** A source or mask image loaded into the Stage input slot. `filename` is the* backend handle (a ComfyUI /upload/image name on the local path, or a@@ -35,17 +51,19 @@ export type UtilityOp = 'upscale' | 'eraser'*/export interface ImageRef { filename: string; url: string; width: number; height: number }-/** Flatten mode / sub-mode / removebg / utilityOp into the single intent the- * UI drives. */+/** Flatten mode / sub-mode / removebg / utilityOp / cloudOp into the single+ * intent the UI drives. */export function deriveIntent(s: {removebg: booleanutilityOp: UtilityOp | null+ cloudOp: CloudOp | nullmode: 'image' | 'video'imageSubMode: 'text2img' | 'img2img'videoSubMode: 't2v' | 'i2v'}): CreateIntent {if (s.removebg) return 'removebg'if (s.utilityOp) return s.utilityOp+ if (s.cloudOp) return s.cloudOpif (s.mode === 'video') return s.videoSubMode === 'i2v' ? 'animate' : 'video'return s.imageSubMode === 'img2img' ? 'edit' : 'image'}@@ -91,7 +109,7 @@ export const MODEL_TYPE_DEFAULTS: Record<ModelType, {export interface GalleryItem {id: string- type: 'image' | 'video'+ type: 'image' | 'video' | 'audio'filename: stringsubfolder: stringprompt: string@@ -162,6 +180,31 @@ interface CreateState {removebg: boolean/** Cloud-only utility intents (upscale/eraser); null = normal generate axis. */utilityOp: UtilityOp | null+ /** 2.5.8 cloud-only categories (character/lipsync/music/extend/motion);+ * null = normal generate axis. Runtime-only like utilityOp. */+ cloudOp: CloudOp | null+ /** Character-Studio sub-surface: train a new character vs generate with one. */+ characterTab: 'train' | 'use'+ /** Character-Studio training set (4-30 images). Runtime-only (blobs). */+ trainImages: MediaRef[]+ /** Character-Studio trigger word — the token that summons the character. */+ triggerWord: string+ /** The shelf character selected for use-mode generation. Runtime-only. */+ selectedCharacter: CharacterRef | null+ /** Lipsync speech / voice-clone reference audio. Runtime-only (blob). */+ audioInput: MediaRef | null+ /** Lipsync speech from a prior cloud voice/music render instead of an+ * upload ({jobId} → fresh signed audio_url at submit). Runtime-only. */+ voiceFromJob: { jobId: string; label: string } | null+ /** Lipsync base clip / motion driving video. Runtime-only (blob). */+ videoInput: MediaRef | null+ /** Extend: the prior cloud render to continue ({jobId} → fresh signed URL+ * at submit). Runtime-only. */+ extendSource: { jobId: string; url: string; label: string } | null+ /** Music track length in seconds (billed per second on the cloud). */+ musicDuration: number+ /** Music: optional lyrics passed to models that take them. Runtime-only. */+ musicLyrics: string/** Upscale target for the cloud super-resolution endpoint. */targetResolution: '2k' | '4k' | '8k'showNegative: boolean@@ -180,6 +223,13 @@ interface CreateState {* backend — separate from the persisted local checkpoint names. */cloudImageModel: stringcloudVideoModel: string+ /** Runtime-only: the model picked inside a 2.5.8 specialized intent+ * (trainer/lipsync/music/extend/motion). One slot for all — modelForOp+ * coerces a stale cross-intent pick onto the op's own list. */+ cloudOpModel: string+ /** Bumped when the character shelf changed (training delivered / deleted)+ * so the Character-Studio surface refetches /api/loras. */+ charactersVersion: number/** Runtime-only: which local custom-node capabilities are installed. */caps: Record<'rmbg' | 'inpaint-nodes', boolean>@@ -243,6 +293,20 @@ interface CreateState {setClipSkip: (n: number) => voidsetGrowMaskBy: (n: number) => voidsetTargetResolution: (r: '2k' | '4k' | '8k') => void+ setCharacterTab: (tab: 'train' | 'use') => void+ addTrainImages: (imgs: MediaRef[]) => void+ removeTrainImage: (name: string) => void+ clearTrainImages: () => void+ setTriggerWord: (w: string) => void+ setSelectedCharacter: (c: CharacterRef | null) => void+ setAudioInput: (m: MediaRef | null) => void+ setVoiceFromJob: (v: { jobId: string; label: string } | null) => void+ setVideoInput: (m: MediaRef | null) => void+ bumpCharactersVersion: () => void+ setCloudOpModel: (id: string) => void+ setExtendSource: (s: { jobId: string; url: string; label: string } | null) => void+ setMusicDuration: (s: number) => void+ setMusicLyrics: (l: string) => voidsetSource: (img: ImageRef | null) => voidsetMask: (img: ImageRef | null) => voidsetBackend: (backend: CreateBackend) => void@@ -310,6 +374,17 @@ export const useCreateStore = create<CreateState>()(videoSubMode: 't2v' as 't2v' | 'i2v',removebg: false,utilityOp: null as UtilityOp | null,+ cloudOp: null as CloudOp | null,+ characterTab: 'train' as 'train' | 'use',+ trainImages: [] as MediaRef[],+ triggerWord: '',+ selectedCharacter: null as CharacterRef | null,+ audioInput: null as MediaRef | null,+ voiceFromJob: null as { jobId: string; label: string } | null,+ videoInput: null as MediaRef | null,+ extendSource: null as { jobId: string; url: string; label: string } | null,+ musicDuration: 60,+ musicLyrics: '',targetResolution: '4k' as '2k' | '4k' | '8k',showNegative: false,selectedLoras: [] as { name: string; strength: number }[],@@ -322,6 +397,8 @@ export const useCreateStore = create<CreateState>()(backend: 'local' as CreateBackend,cloudImageModel: '',cloudVideoModel: '',+ cloudOpModel: '',+ charactersVersion: 0,caps: { rmbg: false, 'inpaint-nodes': false } as Record<'rmbg' | 'inpaint-nodes', boolean>,isGenerating: false,@@ -418,8 +495,23 @@ 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 }- const base = { removebg: false, utilityOp: null, error: null }+ const base = { removebg: false, utilityOp: null, cloudOp: null, error: null }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+ // only read by their own intent — no cross-intent bleed to clear.+ case 'character':+ return { ...base, cloudOp: 'character' as const, mode: 'image' as const, imageSubMode: 'text2img' as const, ...dropAll }+ case 'lipsync':+ // Keeps the source slot (the portrait a photo-avatar model speaks).+ return { ...base, cloudOp: 'lipsync' as const, mode: 'video' as const, videoSubMode: 'i2v' as const, mask: null }+ case 'music':+ return { ...base, cloudOp: 'music' as const, ...dropAll }+ case 'extend':+ return { ...base, cloudOp: 'extend' as const, mode: 'video' as const, videoSubMode: 't2v' as const, ...dropAll }+ case 'motion':+ // Keeps the source slot (the character image the video drives).+ return { ...base, cloudOp: 'motion' as const, mode: 'video' as const, videoSubMode: 'i2v' as const, mask: null }case 'image': return { ...base, mode: 'image' as const, imageSubMode: 'text2img' as const, ...dropAll }case 'edit': return { ...base, mode: 'image' as const, imageSubMode: 'img2img' as const }case 'removebg': return { ...base, removebg: true, mode: 'image' as const, imageSubMode: 'img2img' as const, mask: null }@@ -449,6 +541,26 @@ export const useCreateStore = create<CreateState>()(setClipSkip: (n) => set({ clipSkip: Math.max(0, Math.min(12, Math.floor(n))) }),setGrowMaskBy: (n) => set({ growMaskBy: Math.max(0, Math.min(64, Math.floor(n))) }),setTargetResolution: (targetResolution) => set({ targetResolution }),+ setCharacterTab: (characterTab) => set({ characterTab }),+ // Cap at 30 (the server's image_paths limit) and de-dupe by filename so+ // a re-drop of the same files doesn't double the set.+ addTrainImages: (imgs) => set((s) => {+ const have = new Set(s.trainImages.map((i) => i.name))+ return { trainImages: [...s.trainImages, ...imgs.filter((i) => !have.has(i.name))].slice(0, 30) }+ }),+ removeTrainImage: (name) => set((s) => ({ trainImages: s.trainImages.filter((i) => i.name !== name) })),+ clearTrainImages: () => set({ trainImages: [] }),+ setTriggerWord: (w) => set({ triggerWord: w.replace(/\s+/g, '').slice(0, 30) }),+ setSelectedCharacter: (selectedCharacter) => set({ selectedCharacter }),+ // Upload and voice-pick are mutually exclusive speech sources.+ setAudioInput: (audioInput) => set({ audioInput, ...(audioInput ? { voiceFromJob: null } : {}) }),+ setVoiceFromJob: (voiceFromJob) => set({ voiceFromJob, ...(voiceFromJob ? { audioInput: null } : {}) }),+ setVideoInput: (videoInput) => set({ videoInput }),+ bumpCharactersVersion: () => set((s) => ({ charactersVersion: s.charactersVersion + 1 })),+ setCloudOpModel: (cloudOpModel) => set({ cloudOpModel }),+ setExtendSource: (extendSource) => set({ extendSource }),+ setMusicDuration: (s2) => set({ musicDuration: Math.max(5, Math.min(240, Math.floor(s2))) }),+ setMusicLyrics: (musicLyrics) => set({ musicLyrics: musicLyrics.slice(0, 2000) }),setSource: (source) => set({ source, sourceSetAt: source ? Date.now() : 0, ...(source ? {} : { mask: null }) }),setMask: (mask) => set({ mask }),// Flipping to local clears the intents that STILL have no local lane@@ -462,6 +574,8 @@ export const useCreateStore = create<CreateState>()(if (backend !== 'local') return { backend }const patch: Record<string, unknown> = { backend }if (s.utilityOp) Object.assign(patch, { utilityOp: null, mask: null, error: null })+ // The 2.5.8 categories are hosted-only too — never strand on one.+ if (s.cloudOp) Object.assign(patch, { cloudOp: null, error: null })return patch}),setCloudImageModel: (cloudImageModel) => set({ cloudImageModel }),@@ -529,6 +643,10 @@ export const useCreateStore = create<CreateState>()(selectedVae: state.selectedVae,clipSkip: state.clipSkip,growMaskBy: state.growMaskBy,+ // 2.5.8 cloud categories: only the cheap scalar prefs persist — the+ // staged media (blobs / object URLs) and cloudOp are runtime-only.+ musicDuration: state.musicDuration,+ triggerWord: state.triggerWord,}),// Future schema bumps hook into migrate. NOTE: zustand only invokes it// when the stored blob carries a NUMERIC version that differs — legacy