The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Originals O6: review fixes for Fuobe Cinema (edits, Soul finishing, prices, limits)
Claude9bd6016c540a
diff --git a/docs/research/fuobe-originals-recipes-5.json b/docs/research/fuobe-originals-recipes-5.jsonindex 8b9b489d..27e78740 100644--- a/docs/research/fuobe-originals-recipes-5.json+++ b/docs/research/fuobe-originals-recipes-5.json@@ -16804,12 +16804,14 @@"source": "Fuobe's own recipe for Cinema Studio 4.0's Original, from the hosted LTX-2.3 22B LoRA endpoints' schemas above (§3.1) and the official LTX-2 ComfyUI templates (sizes in multiples of 32; 1280x704 at 720p). Unmeasured until the evaluation harness (O8) runs the cinema suite on a GPU and on fal.","cloud": {"endpoints": {- "t2v": "fal-ai/ltx-2.3-22b/text-to-video/lora",- "i2v": "fal-ai/ltx-2.3-22b/image-to-video/lora",- "flf2v": "fal-ai/ltx-2.3-22b/image-to-video/lora (end_image_url)",- "extend": "fal-ai/ltx-2.3-22b/extend-video/lora",- "v2v": "fal-ai/ltx-2.3-22b/video-to-video/lora"+ "t2v": "fal-ai/ltx-2.3-22b/text-to-video",+ "i2v": "fal-ai/ltx-2.3-22b/image-to-video",+ "flf2v": "fal-ai/ltx-2.3-22b/image-to-video (end_image_url)",+ "extend": "fal-ai/ltx-2.3-22b/extend-video",+ "v2v": "fal-ai/ltx-2.3-22b/video-to-video"},+ "loraEndpoints": "the /lora variant of each (fal-ai/ltx-2.3-22b/{text-to-video,image-to-video,extend-video,video-to-video}/lora) only when a LoRA rides along: $0.001805 per megapixel of video against the plain endpoints' $0.001605",+ "price": "per megapixel of video made (width x height x frames, rounded up): Cinema prices a take on its tier and shape's size from the table below and its 24n+1 frames","fixed": {"enable_prompt_expansion": false},@@ -16818,6 +16820,8 @@"longerThanMax": "one extend-video call adds the rest (a 30 s take is 20 s + 10 s)","audio": "generate_audio follows the Director's sound toggle","prequel": "extend-video with extend_direction backward (unverified: whether the result holds the source clip)",+ "edit": "video-to-video with the take's own scene and the change in one prompt (the endpoint renders a scene, not an instruction), video_strength 0.5 (fal's default 0.01 all but re-renders the clip; Fuobe's guess, between build plan O13's low and medium change), audio_strength 1 (the take's sound stays); a take longer than 20 s is edited for its first 481 frames (match_video_length false); a take made on Seedance 2.5, Kling 3.0 or Veo 3.1 is edited with Kling O3 instead",+ "civitai": "a move whose Wan 2.2 LoRA downloads from civitai runs on Fuobe DoP only with the user's civitai key; without one it runs on its words","sizes": {"480p tier (~0.4 MP)": {"21:9": "1120x480",@@ -16844,7 +16848,7 @@"9:16": "1088x1920"}},- "referenceClips": "none yet: fal-ai/ltx-2.3-22b/reference-video-to-video/lora takes one clip, but its inputs are not read here; Seedance 2.5 stays the choice for reference clips"+ "referenceClips": "none yet: fal-ai/ltx-2.3-22b/reference-video-to-video/lora takes one clip, but its inputs are not read here, and it is an IC-LoRA control (depth, pose, canny from the clip) rather than a reference; a take with reference clips runs on Seedance 2.5 unless Fuobe Cinema is picked from the menu (then the clips are left out, with a note)"},"open": {"video": "Wan 2.2 14B Lightning (wan22-t2v-14b-lightx2v / wan22-i2v-14b-lightx2v), wan22-flf2v-14b for start and end frame; 3 or 5 s at 16 fps",@@ -16892,8 +16896,8 @@"helicopter-shot": null}},- "stills": "fuobe-soul-cinema (Fuobe Soul Cinema: filmstill 0.7 + moviewide 0.5, cine tail) with the Director's camera and lens words",- "soulCast": "fuobe-soul with the Realistic look (v1-realistic) and the 17-field casting compiler; the Soul Cast sheet graph (soul-cast-sheet-zimage) stays an open alternative",+ "stills": "fuobe-soul-cinema (Fuobe Soul Cinema: filmstill 0.7 + moviewide 0.5, cine tail) with the Director's camera and lens words; Soul Cinema's 21:9 crop and grade, and Soul Location's Movie grade, are applied in the browser by Cinema's feed and builders",+ "soulCast": "fuobe-soul with the Realistic look (v1-realistic) and the 17-field casting compiler in the cloud; on the GPU the Soul Cast sheet graph (soul-cast-sheet-zimage, the same Z-Image Turbo) with the Realistic look's LoRAs and words, which also cuts the sheet's four views (Fuobe Soul alone when the graph is missing)","soulLocation": "fuobe-soul with the Movie look (v1-movie), 16:9, no people; other views by the Multiple-Angles LoRA (open: Qwen-Image-Edit 2511 + the LoRA; cloud: fal-ai/qwen-image-edit-2511-multiple-angles)","partners": "Seedance 2.5, Kling 3.0 and Veo 3.1 stay pickable with the Director compiled into the prompt; Kling O3 edits takes made on a partner model","licences": "LTX-2.x Community (free under US$10M annual revenue; shown in About & licences), Wan 2.2 Apache-2.0, Z-Image Turbo Apache-2.0, Qwen-Image-Edit 2511 Apache-2.0"diff --git a/docs/research/fuobe-originals-recipes-5.md b/docs/research/fuobe-originals-recipes-5.mdindex 685295cd..558b7e80 100644--- a/docs/research/fuobe-originals-recipes-5.md+++ b/docs/research/fuobe-originals-recipes-5.md@@ -648,11 +648,11 @@ Also new and worth a later look: Lightricks LTX-2.5 **Cinemagraph** (2026-09-10,- **Note:** Cinema Studio's 3D scene (Gaussian splat → recomposition) is covered by round-4 cinema-3d work.- **Licences:** Wan Apache-2.0; LTX-2.x Community (free under US$10M revenue)- **Fuobe Cinema recipe (added 2026-10-26 for O6; JSON: `studios[cinema-studio].original`).** Fuobe's own choices, unmeasured until the evaluation harness runs the `cinema` suite:- - Cloud: the LTX-2.3 22B `/lora` endpoints above with `enable_prompt_expansion: false` (the compiled Director prompt is kept), `generate_audio` from the sound toggle, 24 fps, at most 481 frames (20 s); a longer take adds the rest with one `extend-video` call. Sizes are a table in multiples of 32 (as LTX-2 wants; the official templates use 1280×704 at 720p): 480p 864×480, 720p 1280×704, 1080p 1920×1088 at 16:9, and 21:9, 4:3, 1:1, 3:4 and 9:16 in each tier. A prequel is `extend-video` with `extend_direction: backward` (unverified: whether the result also holds the source clip).- - Camera moves → `camera_lora` where one of its seven moves fits: Dolly In and Slow Zoom In → `dolly_in`; Dolly Out, Slow Zoom Out and Aerial Pullback → `dolly_out`; Truck and Slider Left / Right → `dolly_left` / `dolly_right`; Crane and Pedestal Up / Down → `jib_up` / `jib_down`; Static → `static`. Pans, tilts and the rest have no fit: with a start frame, a move with a Wan 2.2 LoRA (§7) runs it on `fal-ai/wan/v2.2-a14b/image-to-video/lora` (Fuobe DoP), Rack Focus runs LTX-2.5's `focus_shift`, and anything else runs on its words.+ - Cloud: the plain LTX-2.3 22B endpoints (`fal-ai/ltx-2.3-22b/{text-to-video,image-to-video,extend-video,video-to-video}`, $0.001605 per megapixel of video), moving to their `/lora` variants above ($0.001805) only when a LoRA rides along, with `enable_prompt_expansion: false` (the compiled Director prompt is kept), `generate_audio` from the sound toggle, 24 fps, at most 481 frames (20 s); a longer take adds the rest with one `extend-video` call. A take is priced on its tier and shape's size from the table below times its 24n+1 frames, rounded up to whole megapixels. Sizes are a table in multiples of 32 (as LTX-2 wants; the official templates use 1280×704 at 720p): 480p 864×480, 720p 1280×704, 1080p 1920×1088 at 16:9, and 21:9, 4:3, 1:1, 3:4 and 9:16 in each tier. A prequel is `extend-video` with `extend_direction: backward` (unverified: whether the result also holds the source clip); an extend or a prequel adds at most 20 s per run. An edit is `video-to-video` with the take's own scene and the change in one prompt (the endpoint renders a scene, not an instruction), `video_strength` 0.5 (fal's default of 0.01 all but re-renders the clip; Fuobe's guess between build plan O13's low and medium change), `audio_strength` 1 (the take's sound stays), and the first 481 frames of a longer take (`match_video_length: false`); a take made on Seedance 2.5, Kling 3.0 or Veo 3.1 is edited with Kling O3.+ - Camera moves → `camera_lora` where one of its seven moves fits: Dolly In and Slow Zoom In → `dolly_in`; Dolly Out, Slow Zoom Out and Aerial Pullback → `dolly_out`; Truck and Slider Left / Right → `dolly_left` / `dolly_right`; Crane and Pedestal Up / Down → `jib_up` / `jib_down`; Static → `static`. Pans, tilts and the rest have no fit: with a start frame, a move with a Wan 2.2 LoRA (§7) runs it on `fal-ai/wan/v2.2-a14b/image-to-video/lora` (Fuobe DoP; a LoRA that downloads from civitai only with the user's civitai key), Rack Focus runs LTX-2.5's `focus_shift`, and anything else runs on its words.- Open: Wan 2.2 14B Lightning with the move's Wan LoRA or a Fun Camera pose (both need a start frame), LTX-2.5 22B as the choice with sound, Wan 2.2 Fun VACE for extend and edit, the palette lock after the clip.- - Stills on Fuobe Soul Cinema; Soul Cast on Fuobe Soul with the Realistic look and the 17-field compiler (the Soul Cast sheet graph stays an open alternative); Soul Location on Fuobe Soul with the Movie look, other views by the Multiple-Angles LoRA on both engines. Seedance 2.5, Kling 3.0 and Veo 3.1 stay pickable with the Director in the prompt.- - Reference clips: none yet. `fal-ai/ltx-2.3-22b/reference-video-to-video/lora` takes one clip, but its inputs haven't been read, so Seedance 2.5 stays the model for reference clips.+ - Stills on Fuobe Soul Cinema (its 21:9 crop and grade, like Soul Location's Movie grade, applied in the browser by Cinema's feed and builders); Soul Cast with the Realistic look and the 17-field compiler, on Fuobe Soul in the cloud and on the GPU through the Soul Cast sheet graph (`soul-cast-sheet-zimage`, the same Z-Image Turbo with the look's LoRAs and words), which also cuts the sheet's four views; Soul Location on Fuobe Soul with the Movie look, other views by the Multiple-Angles LoRA on both engines. Seedance 2.5, Kling 3.0 and Veo 3.1 stay pickable with the Director in the prompt.+ - Reference clips: none yet. `fal-ai/ltx-2.3-22b/reference-video-to-video/lora` takes one clip, but its inputs haven't been read and it is an IC-LoRA control (depth, pose or canny from the clip) rather than a reference, so a take with reference clips runs on Seedance 2.5 unless Fuobe Cinema is picked from the menu (then the clips are left out, with a note).### upscalediff --git a/scripts/eval/cases/cinema.json b/scripts/eval/cases/cinema.jsonindex 47d90e4b..5553d6d2 100644--- a/scripts/eval/cases/cinema.json+++ b/scripts/eval/cases/cinema.json@@ -112,7 +112,7 @@"tags": ["director"],- "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-eval.test.ts checks it against planCinema)."+ "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-original.test.ts checks it against planCinema)."},{"id": "cinema/director-epic",@@ -126,7 +126,7 @@"tags": ["director"],- "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-eval.test.ts checks it against planCinema)."+ "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-original.test.ts checks it against planCinema)."},{"id": "cinema/director-comedy",@@ -140,7 +140,7 @@"tags": ["director"],- "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-eval.test.ts checks it against planCinema)."+ "note": "The prompt is what Cinema compiles from the Director's Panel for this scene (tests/cinema-original.test.ts checks it against planCinema)."},{"id": "cinema/move-dolly-in",diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.pyindex 45ac3e1e..a9443bab 100644--- a/scripts/gen-cloud-models.py+++ b/scripts/gen-cloud-models.py@@ -479,7 +479,8 @@ model("fuobe-dop-ltx", "Fuobe DoP · LTX", "Fuobe Original", "fuobe-dop", "video# studios[cinema-studio].original). Prompt expansion off so the compiled Director prompt is what runs; sound follows the# toggle; up to 481 frames at 24 fps (20 s; Cinema adds the rest with one extend); exact sizes per tier in multiples of# 32. A camera move LTX-2.3's camera LoRA makes goes as camera_lora (params.extra, set by src/lib/catalog/cinema.ts).-# An extend or an edit keeps its source clip's size. Priced per second from fal's per-megapixel-of-video price.+# An extend or an edit keeps its source clip's size. Priced on fal's per-megapixel-of-video price (Pricing.videoMegapixel:+# the tier and shape's size × the frames, rounded up); the per-second rates are the 16:9 ones, for display.CINEMA = next(s for s in ORIGINALS["studios"] if s["id"] == "cinema-studio")["original"]["cloud"]CINEMA_TIERS = {"480p": "480p tier", "720p": "720p tier", "1080p": "1080p tier"}CINEMA_SIZES = {tier: {a: [int(x) for x in wh.split("x")] for a, wh in next(v for k, v in CINEMA["sizes"].items() if k.startswith(prefix)).items()}@@ -509,7 +510,8 @@ model("fuobe-cinema", "Fuobe Cinema", "Fuobe Original", "fuobe-cinema", "video",original=True, sizes=CINEMA_SIZES, badges=["audio"],pricing=("second", CINEMA_PER_SECOND["720p"],f"${CINEMA_MP} per megapixel of video (width × height × frames): about ${round(CINEMA_PER_SECOND['720p'] * 5, 2)} for 5 s at 720p; ${CINEMA_MP_LORA} with LoRAs",- {"byResolution": CINEMA_PER_SECOND, "withLoras": CINEMA_PER_SECOND_LORA["720p"], "withLorasByResolution": CINEMA_PER_SECOND_LORA}),+ {"byResolution": CINEMA_PER_SECOND, "withLoras": CINEMA_PER_SECOND_LORA["720p"], "withLorasByResolution": CINEMA_PER_SECOND_LORA,+ "videoMegapixel": {"usd": CINEMA_MP, "withLoras": CINEMA_MP_LORA}}),defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"}, frame_step=8)model("ltx-2-5", "LTX 2.5 Pro", "Lightricks", "ltx", "video", "Fast 4K-capable video with audio",[("t2v", "lightricks/ltx-2.5/text-to-video/pro"), ("i2v", "lightricks/ltx-2.5/image-to-video/pro")],diff --git a/src/app/api/cinema/projects/[id]/route.ts b/src/app/api/cinema/projects/[id]/route.tsindex 9dbaa7c0..a364cea8 100644--- a/src/app/api/cinema/projects/[id]/route.ts+++ b/src/app/api/cinema/projects/[id]/route.ts@@ -3,15 +3,15 @@ import { CinemaError, deleteProject, getProject, listFolders, spentUsd, updatePrimport { ProjectPatch, body, handle } from "@/server/cinema-schemas";import { cinemaContext } from "@/server/cinema-generate";-/** The project with its folders, its estimated spend and what this install can run (cloud models allowed or not). */+/** The project with its folders, its estimated spend and what this install can run (cloud models allowed, a civitai key). */export async function GET(_req: Request, ctx: RouteContext<"/api/cinema/projects/[id]">) {await connection();return handle(async () => {const { id } = await ctx.params;const project = getProject(id);if (!project) throw new CinemaError("Project not found", 404);- const { cloudAllowed } = cinemaContext();- return Response.json({ project, folders: listFolders(id), spentUsd: spentUsd(id), context: { cloudAllowed } });+ const { cloudAllowed, civitai } = cinemaContext();+ return Response.json({ project, folders: listFolders(id), spentUsd: spentUsd(id), context: { cloudAllowed, civitai } });});}diff --git a/src/components/cinema/camera-moves.tsx b/src/components/cinema/camera-moves.tsxindex 27a3b754..99f4c77c 100644--- a/src/components/cinema/camera-moves.tsx+++ b/src/components/cinema/camera-moves.tsx@@ -23,14 +23,15 @@ function moveScore(value: string, search: string, keywords?: string[]): number {}/** How Fuobe Cinema drives a move on this engine, given a start frame (a small badge in the picker). */-function routeBadge(m: CameraMove, engine: Engine): string | null {- const r = cinemaMoveRoute(m.slug, engine, true);+function routeBadge(m: CameraMove, engine: Engine, civitai?: boolean): string | null {+ const r = cinemaMoveRoute(m.slug, engine, true, { civitai });return r.via === "camera-lora" ? "Camera LoRA" : r.via === "lora" ? "LoRA" : r.via === "fun-camera" ? "Fun Camera" : r.via === "hosted-move" ? "Focus move" : null;}export function MoveList({engine,badges = true,+ civitai,selected,onPick,defaultQuery,@@ -39,6 +40,8 @@ export function MoveList({engine: Engine;/** Say how Fuobe Cinema drives each move (off when a partner model gets the moves in words). */badges?: boolean;+ /** A civitai key is set (false: a cloud move whose LoRA downloads from civitai runs on its words, so no badge). */+ civitai?: boolean;selected: string[];onPick: (slug: string) => void;/** What was typed after "#" in the prompt (the list mounts fresh each time the picker opens). */@@ -72,7 +75,7 @@ export function MoveList({<CommandEmpty>No camera moves match your search</CommandEmpty><CommandGroup>{moves.map((m) => {- const badge = badges ? routeBadge(m, engine) : null;+ const badge = badges ? routeBadge(m, engine, civitai) : null;const n = selected.indexOf(m.slug);return (<CommandItem key={m.slug} value={m.name} keywords={[m.slug, m.hint]} onSelect={() => onPick(m.slug)} className="group/move items-start gap-2.5 py-2">@@ -102,6 +105,7 @@ export function MovePicker({onOpenChange,engine,badges,+ civitai,selected,onPick,initialQuery,@@ -110,6 +114,7 @@ export function MovePicker({onOpenChange: (o: boolean) => void;engine: Engine;badges?: boolean;+ civitai?: boolean;selected: string[];onPick: (slug: string) => void;initialQuery?: string;@@ -144,6 +149,7 @@ export function MovePicker({<MoveListengine={engine}badges={badges}+ civitai={civitai}selected={selected}defaultQuery={initialQuery}autoFocusdiff --git a/src/components/cinema/cinema-feed.tsx b/src/components/cinema/cinema-feed.tsxindex 61909744..6737dcc6 100644--- a/src/components/cinema/cinema-feed.tsx+++ b/src/components/cinema/cinema-feed.tsx@@ -48,6 +48,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popoverimport { Switch } from "@/components/ui/switch";import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";import { FailedTile, MediaThumb, PendingTile, downloadName, tileRatio } from "@/components/studio/feed";+import { useSoulFinish } from "@/components/studio/soul-finish";import { Viewer } from "@/components/studio/viewer";import { getModel } from "@/lib/catalog";import type { CinemaFolder } from "@/lib/catalog/cinema";@@ -73,6 +74,7 @@ interface Prefs {hideFailed: boolean;}+const CINEMA_KEY = ["cinema"] as const;const DEFAULT_PREFS: Prefs = { layout: "square", split: true, fit: false, type: "all", date: "all", status: "all", hideFailed: false };const PREFS_KEY = "fuobe.cinema.feed";const prefListeners = new Set<() => void>();@@ -556,6 +558,8 @@ export function CinemaFeed({const [prefs, setPrefs] = usePrefs();const actions = useItemActions(projectId);const qc = useQueryClient();+ // Stills on Fuobe Soul Cinema and Soul Location's Movie look finish in the browser (the 21:9 crop, the grade).+ useSoulFinish(items, CINEMA_KEY);const [selected, setSelected] = useState<Set<string>>(new Set());const [anchor, setAnchor] = useState<string | null>(null);const [open, setOpen] = useState<string | null>(null);diff --git a/src/components/cinema/director-panel.tsx b/src/components/cinema/director-panel.tsxindex 2ee6d1f1..5438f330 100644--- a/src/components/cinema/director-panel.tsx+++ b/src/components/cinema/director-panel.tsx@@ -179,6 +179,8 @@ export function CameraChip({moves,onMovesChange,required,+ badges,+ civitai,}: {settings: DirectorSettings;onChange: Patch;@@ -186,6 +188,9 @@ export function CameraChip({engine: Engine;moves: string[];onMovesChange: (m: string[]) => void;+ /** Badge how Fuobe Cinema drives each move (off when the picked model gets the moves in words), as the prompt bar's picker does. */+ badges?: boolean;+ civitai?: boolean;/** Cinematic stills: camera, lens and focal length must be set. */required?: boolean;}) {@@ -237,7 +242,7 @@ export function CameraChip({<div className="-mx-1"><PanelHeader title="Direct a camera move" subtitle="Adds to the prompt box, or type # there. Several per shot; order matters." /><MoveChips moves={moves} onChange={onMovesChange} />- <MoveList engine={engine} selected={moves} onPick={(slug) => onMovesChange([...moves, slug])} />+ <MoveList engine={engine} badges={badges} civitai={civitai} selected={moves} onPick={(slug) => onMovesChange([...moves, slug])} /></div>)}</div>diff --git a/src/components/cinema/draft.ts b/src/components/cinema/draft.tsindex afb2ade4..1df27744 100644--- a/src/components/cinema/draft.ts+++ b/src/components/cinema/draft.ts@@ -22,6 +22,12 @@ export interface TakeSource {url: string;kind: "image" | "video";label: string;+ /** What is known about the take (TakeFacts): its model, scene, size and, once the browser has read it, its length. */+ modelId?: string;+ prompt?: string;+ seconds?: number;+ resolution?: string;+ aspectRatio?: string;}export interface CinemaDraft {@@ -61,6 +67,20 @@ export const initialDraft = (): CinemaDraft => ({source: null,});+/** The selected take as the planner reads it: its file, and the facts the browser has about it. */+function takeFacts(t: TakeSource, firstFrame?: string): NonNullable<CinemaGenerateInput["source"]> {+ return {+ url: t.url,+ kind: t.kind,+ ...(firstFrame ? { firstFrame } : {}),+ ...(t.modelId ? { modelId: t.modelId } : {}),+ ...(t.prompt?.trim() ? { prompt: t.prompt.trim().slice(0, 4000) } : {}),+ ...(t.seconds !== undefined && Number.isFinite(t.seconds) && t.seconds > 0 ? { seconds: Math.round(t.seconds * 100) / 100 } : {}),+ ...(t.resolution ? { resolution: t.resolution } : {}),+ ...(t.aspectRatio ? { aspectRatio: t.aspectRatio } : {}),+ };+}+/** The request body for /generate (and the input planCinema prices live). */export function draftToInput(d: CinemaDraft, engine: Engine, settings: DirectorSettings, firstFrame?: string): Omit<CinemaGenerateInput, "brief"> {const ready = d.refs.filter((r) => r.ref && !r.uploading);@@ -82,7 +102,7 @@ export function draftToInput(d: CinemaDraft, engine: Engine, settings: DirectorSbatch: d.batch,audio: d.audio,multiShot: d.mode === "video" && d.multiShot.mode !== "off" ? d.multiShot : undefined,- source: d.source && action !== "generate" && action !== "grid" ? { url: d.source.url, kind: d.source.kind, ...(firstFrame ? { firstFrame } : {}) } : undefined,+ source: d.source && action !== "generate" && action !== "grid" ? takeFacts(d.source, firstFrame) : undefined,grid: action === "grid" ? d.grid : undefined,};}diff --git a/src/components/cinema/hooks.ts b/src/components/cinema/hooks.tsindex d75da4c7..d0ccb2dc 100644--- a/src/components/cinema/hooks.ts+++ b/src/components/cinema/hooks.ts@@ -16,7 +16,7 @@ export interface ProjectView {project: CinemaProject;folders: CinemaFolder[];spentUsd: number;- context: { cloudAllowed: boolean };+ context: { cloudAllowed: boolean; civitai?: boolean };}async function json<T>(res: Response): Promise<T> {diff --git a/src/components/cinema/prompt-bar.tsx b/src/components/cinema/prompt-bar.tsxindex a26c2d2d..aee2edd9 100644--- a/src/components/cinema/prompt-bar.tsx+++ b/src/components/cinema/prompt-bar.tsx@@ -326,7 +326,7 @@ export interface PromptBarProps {onSettings: (patch: Partial<DirectorSettings>) => void;palettes: { name: string; hex: string[] }[];onPalettes: (p: { name: string; hex: string[] }[]) => void;- context: { cloudAllowed: boolean };+ context: { cloudAllowed: boolean; civitai?: boolean };brief: string;spentUsd: number;costCapUsd: number | null;@@ -442,6 +442,8 @@ export function PromptBar(props: PromptBarProps) {// The model picked in the menu (a take may run on another: Fuobe DoP for a move's Wan camera LoRA, a references edit…).const chosen = draft.models[modelKey];const picked = chosen && modelList.includes(chosen) ? chosen : modelList[0];+ // The move pickers badge how Fuobe Cinema (or Wan 2.2 on the GPU) drives a move; a partner model gets the moves in words.+ const moveBadges = picked === CINEMA_MODEL || (engine === "open" && getModel(picked)?.family === "wan");const pickable = action === "generate" && !(draft.mode === "image" && draft.imageTool === "grid");const placeholder = video? action === "edit"@@ -544,6 +546,8 @@ export function PromptBar(props: PromptBarProps) {moves={draft.moves}onMovesChange={(moves) => setDraft({ moves })}required={draft.mode === "image" && draft.imageTool === "still"}+ badges={moveBadges}+ civitai={context.civitai}/><PaletteChip settings={settings} onChange={onSettings} engine={engine} saved={props.palettes} onSave={props.onPalettes} /><LightingChip settings={settings} onChange={onSettings} />@@ -799,7 +803,8 @@ export function PromptBar(props: PromptBarProps) {</Tooltip>{video && (<MovePicker- badges={picked === CINEMA_MODEL || (engine === "open" && getModel(picked)?.family === "wan")}+ badges={moveBadges}+ civitai={context.civitai}open={movesOpen}onOpenChange={(o) => {setMovesOpen(o);diff --git a/src/components/cinema/scene-actions.tsx b/src/components/cinema/scene-actions.tsxindex b281178b..a1d47d6b 100644--- a/src/components/cinema/scene-actions.tsx+++ b/src/components/cinema/scene-actions.tsx@@ -72,7 +72,7 @@ export function askSceneConfirmAgain() {export interface ScenePlanContext {engine: Engine;settings: DirectorSettings;- context: { cloudAllowed: boolean };+ context: { cloudAllowed: boolean; civitai?: boolean };brief: string;}diff --git a/src/components/cinema/scene-viewer.tsx b/src/components/cinema/scene-viewer.tsxindex 94aaf2af..0e83e462 100644--- a/src/components/cinema/scene-viewer.tsx+++ b/src/components/cinema/scene-viewer.tsx@@ -35,7 +35,7 @@ export interface SceneViewerProps {engine: Engine;onEngine: (e: Engine) => void;settings: DirectorSettings;- context: { cloudAllowed: boolean };+ context: { cloudAllowed: boolean; civitai?: boolean };brief: string;onClose: () => void;}diff --git a/src/components/cinema/soul-builders.tsx b/src/components/cinema/soul-builders.tsxindex 37cd1bea..ed68afd5 100644--- a/src/components/cinema/soul-builders.tsx+++ b/src/components/cinema/soul-builders.tsx@@ -9,9 +9,12 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } fimport { Input } from "@/components/ui/input";import { Slider } from "@/components/ui/slider";import { Textarea } from "@/components/ui/textarea";+import { useSoulFinish } from "@/components/studio/soul-finish";import { useSaveElement, useStatus } from "@/lib/api";+import { getModel } from "@/lib/catalog";import {CAST_LOOK,+ CAST_SHEET_MODEL,LOCATION_LOOK,LOCATION_VIEWS,SOUL_BUILDER_MODEL,@@ -29,6 +32,7 @@ import {type DirectorSettings,} from "@/lib/catalog/cinema";import { soulLook } from "@/lib/catalog/soul";+import { finishedUrl } from "@/lib/soul-post";import type { Engine, Generation } from "@/lib/catalog/types";import { formatCost } from "@/lib/format";import { cn } from "@/lib/utils";@@ -41,7 +45,7 @@ interface BuilderProps {folderId: string | null;engine: Engine;settings: DirectorSettings;- context: { cloudAllowed: boolean };+ context: { cloudAllowed: boolean; civitai?: boolean };brief: string;}@@ -161,9 +165,11 @@ function Results({ items, picked, onPick }: { items: Generation[]; picked: strin);}-/** "Fuobe Soul · Realistic look": the maker, and the Soul look it uses. */+/** "Fuobe Soul · Realistic look": the maker, and the Soul look it uses (on the open Soul Cast sheet graph too). */function builderLine(model: { id: string; name: string }, look: string): string {- return model.id === SOUL_BUILDER_MODEL ? `${model.name} · ${soulLook(look)?.name ?? look} look` : model.name;+ const name = soulLook(look)?.name ?? look;+ if (model.id === CAST_SHEET_MODEL) return `${getModel(SOUL_BUILDER_MODEL)?.name ?? "Fuobe Soul"} · ${name} look · the sheet, then its four views as their own pictures`;+ return model.id === SOUL_BUILDER_MODEL ? `${model.name} · ${name} look` : model.name;}/** "a marble perfume atelier at golden hour, …" → "Marble Perfume Atelier". */@@ -172,12 +178,18 @@ function locationName(prompt: string): string {return words.slice(0, 3).map((w) => w[0].toUpperCase() + w.slice(1)).join(" ") || "Location";}+const CINEMA_KEY = ["cinema"] as const;+function useBuilderRun(projectId: string) {const generate = useCinemaGenerate(projectId);const items = useCinemaItems(projectId).data;const [ids, setIds] = useState<string[]>([]);const results = useMemo(() => ids.map((id) => items?.find((g) => g.id === id)).filter((g): g is NonNullable<typeof g> => !!g), [ids, items]);- return { generate, results, setIds };+ // A Soul look's grade (Soul Location's Movie look) is applied here too, so a saved element holds the finished picture.+ useSoulFinish(results, CINEMA_KEY);+ // A variant picked before it was finished: its finished picture.+ const current = (url: string) => finishedUrl(results, url);+ return { generate, results, setIds, current };}function CostLabel({ plan, demoModel }: { plan: { costUsd: number | null }; demoModel: { routes: { provider: string }[] } }) {@@ -231,7 +243,8 @@ function SoulCast({ projectId, folderId, engine, context, brief, onOpenChange }:const [notes, setNotes] = useState("");const [batch, setBatch] = useState(2);const [picked, setPicked] = useState<string[]>([]);- const { generate, results, setIds } = useBuilderRun(projectId);+ const { generate, results, setIds, current } = useBuilderRun(projectId);+ const chosen = picked.map(current);const visible = visibleCast(values);const input = { engine, mode: "image" as const, action: "cast" as const, prompt: notes, settings: {}, cast: visible, batch };const plan = planCinema({ ...input, brief }, context);@@ -322,8 +335,8 @@ function SoulCast({ projectId, folderId, engine, context, brief, onOpenChange }:{results.length > 0 && (<div className="space-y-3 border-t pt-3"><p className="text-[12.5px] font-medium">Select an image variant for your cast</p>- <Results items={results} picked={picked} onPick={(u) => setPicked((p) => (p.includes(u) ? p.filter((x) => x !== u) : [u]))} />- <SaveElement kind="character" defaultName={castName(visible)} picked={picked} description={castPrompt(visible, notes)} onSaved={() => onOpenChange(false)} />+ <Results items={results} picked={chosen} onPick={(u) => setPicked((p) => (p.map(current).includes(u) ? [] : [u]))} />+ <SaveElement kind="character" defaultName={castName(visible)} picked={chosen} description={castPrompt(visible, notes)} onSaved={() => onOpenChange(false)} /></div>)}</>@@ -343,7 +356,8 @@ function SoulLocation({ projectId, folderId, engine, settings, context, brief, oconst [prompt, setPrompt] = useState("");const [batch, setBatch] = useState(2);const [picked, setPicked] = useState<string[]>([]);- const { generate, results, setIds } = useBuilderRun(projectId);+ const { generate, results, setIds, current } = useBuilderRun(projectId);+ const chosen = picked.map(current);const input = { engine, mode: "image" as const, action: "location" as const, prompt, settings, batch };const plan = planCinema({ ...input, brief }, context);const look = directorSummary({ ...settings, genre: undefined, era: undefined, tempo: undefined, lighting: settings.lighting });@@ -405,18 +419,18 @@ function SoulLocation({ projectId, folderId, engine, settings, context, brief, o{results.length > 0 && (<div className="space-y-3 border-t pt-3"><p className="text-[12.5px] font-medium">Pick the views to keep (several views make a stronger location)</p>- <Results items={results} picked={picked} onPick={(u) => setPicked((p) => (p.includes(u) ? p.filter((x) => x !== u) : [...p, u]))} />- {picked.length > 0 && (+ <Results items={results} picked={chosen} onPick={(u) => setPicked((p) => (p.map(current).includes(u) ? p.map(current).filter((x) => x !== u) : [...p.map(current), u]))} />+ {chosen.length > 0 && (<div className="flex flex-wrap items-center gap-1.5"><span className="text-[12px] text-muted-foreground">Show the same location from another view:</span>{LOCATION_VIEWS.map((v) => (- <button key={v.id} type="button" onClick={() => run({ view: v.id, url: picked[0] })} className="h-7 rounded-full bg-secondary px-2.5 text-[12px] font-medium hover:bg-accent">+ <button key={v.id} type="button" onClick={() => run({ view: v.id, url: chosen[0] })} className="h-7 rounded-full bg-secondary px-2.5 text-[12px] font-medium hover:bg-accent">{v.name}</button>))}</div>)}- <SaveElement kind="location" defaultName={locationName(prompt)} picked={picked} description={prompt} onSaved={() => onOpenChange(false)} />+ <SaveElement kind="location" defaultName={locationName(prompt)} picked={chosen} description={prompt} onSaved={() => onOpenChange(false)} /></div>)}</>diff --git a/src/components/cinema/workspace.tsx b/src/components/cinema/workspace.tsxindex a902cf06..d3406b29 100644--- a/src/components/cinema/workspace.tsx+++ b/src/components/cinema/workspace.tsx@@ -26,6 +26,7 @@ import { CinemaFeed, type FeedHandlers } from "./cinema-feed";import { initialDraft, type CinemaDraft } from "./draft";import { ElementsPanel } from "./elements-panel";import { FolderSidebar, subtree, viewKey, type CinemaView } from "./folder-sidebar";+import { mediaDuration } from "./media";import { formatUsd } from "./money";import { foreign, useAutosave, useCinemaGenerate, useCinemaItems, useCinemaProject, useItemActions, useStudioGenerations, useUpdateProject, type CinemaGeneration, type ProjectView } from "./hooks";import { cutGrid } from "./media";@@ -286,7 +287,26 @@ function Workspace({ data, items, loading }: { data: ProjectView; items: CinemaGfocusPrompt();},onUseTake: (g, o: OutputFile) => {- setDraft({ mode: "video", source: { generationId: g.id, url: o.url, kind: "video", label: g.take?.prompt || g.request.prompt || "Take" }, action: "extend-forward" });+ const p = g.request.params;+ setDraft({+ mode: "video",+ source: {+ generationId: g.id,+ url: o.url,+ kind: "video",+ label: g.take?.prompt || g.request.prompt || "Take",+ // What an edit needs to know: the take's model (a partner take goes to a partner editor), its scene, size and length.+ modelId: g.modelId,+ prompt: g.take?.prompt || g.request.prompt || undefined,+ resolution: p?.resolution,+ aspectRatio: p?.aspectRatio,+ },+ action: "extend-forward",+ });+ // Its length, read from the file's header (a 20 s take plus its extend is one file).+ void mediaDuration(o.url, "video").then((seconds) => {+ if (Number.isFinite(seconds) && seconds > 0) setDraft((d) => (d.source?.url === o.url ? { source: { ...d.source, seconds } } : {}));+ });focusPrompt();},onAnimate: (url) => {diff --git a/src/components/studio/soul-finish.ts b/src/components/studio/soul-finish.tsindex 2859771a..f9a2b0eb 100644--- a/src/components/studio/soul-finish.ts+++ b/src/components/studio/soul-finish.ts@@ -9,14 +9,16 @@ import { cropRect, finishSteps, outputsToFinish, overlayLayout, type FinishSteps/*** Fuobe Soul's post steps in the browser (research §4.4): when a result with a look arrives, Soul Cinema's 21:9* crop, its grade (the WebGL grade of the Color grading tool) and its overlay are applied once, and the finished picture is kept- * on the server in place of the raw one (the raw one stays as meta.original). Any open studio feed does it;- * the server takes the first and answers the others 409.+ * on the server in place of the raw one (the raw one stays as meta.original). Any open studio feed does it, and+ * Cinema's feed and builders (its stills on Soul Cinema, Soul Location's Movie look); the server takes the first and+ * answers the others 409.*/const started = new Set<string>();/** Outputs that failed to finish (no WebGL, a picture that won't load): tried again after a pause, a few times. */const failed = new Map<string, { tries: number; at: number }>();const MAX_TRIES = 3;+const GENERATIONS = ["generations"] as const;const RETRY_MS = 30_000;function load(url: string): Promise<HTMLImageElement> {@@ -75,9 +77,13 @@ async function finish(url: string, steps: FinishSteps, when: Date): Promise<Blobreturn await new Promise<Blob>((resolve, reject) => canvas.toBlob((b) => (b ? resolve(b) : reject(new Error("Couldn't encode the picture"))), "image/png"));}-/** Finish every Soul result in `items` that still needs it (once per output, in the background). */-export function useSoulFinish(items: Generation[]) {+/**+ * Finish every Soul result in `items` that still needs it (once per output, in the background). `queryKey`: the cache+ * that shows them, refetched once the finished picture is kept (Cinema keeps its takes under ["cinema"]).+ */+export function useSoulFinish(items: Generation[], queryKey: readonly unknown[] = GENERATIONS) {const qc = useQueryClient();+ const cacheKey = JSON.stringify(queryKey);useEffect(() => {if (typeof document === "undefined" || document.visibilityState === "hidden") return;for (const g of items) {@@ -98,7 +104,7 @@ export function useSoulFinish(items: Generation[]) {const res = await fetch(`/api/generations/${g.id}/finish`, { method: "POST", body: form });// The live stream brings the finished row; a feed without it refetches.failed.delete(key);- if (res.ok) void qc.invalidateQueries({ queryKey: ["generations"] });+ if (res.ok) void qc.invalidateQueries({ queryKey: JSON.parse(cacheKey) as unknown[] });} catch (e) {// The raw picture stays; a feed showing it later tries again (after a pause, at most three times).started.delete(key);@@ -108,5 +114,5 @@ export function useSoulFinish(items: Generation[]) {})();}}- }, [items, qc]);+ }, [items, qc, cacheKey]);}diff --git a/src/lib/catalog/cinema.ts b/src/lib/catalog/cinema.tsindex f70dc034..496cfd20 100644--- a/src/lib/catalog/cinema.ts+++ b/src/lib/catalog/cinema.ts@@ -2,8 +2,9 @@ import { APERTURE, LENS, anglesNote, poseWords, recomposePrompt, type ScenePoseimport { getModel, getPreset } from "./index";import { DOP_MODEL, LTX25_HOSTED } from "./dop";import { dualEngine, onEngine } from "./engines";-import { localOnly, triggerOf } from "./loras";+import { localOnly, needsToken, triggerOf } from "./loras";import { composeShots, estimateCost, planGeneration, routesFor } from "./plan";+import { soulRecipe } from "./soul";import type { Engine, GenerationRequest, GenParams, LoraRef, ModelDef, Operation } from "./types";/*@@ -219,7 +220,7 @@ export interface CinemaGenerateInput {audio?: boolean;multiShot?: { mode: "off" | "auto" | "manual"; shots?: { prompt: string; duration: number }[] };/** The selected take (extend, edit, another view of a location). */- source?: { url: string; kind: "image" | "video"; firstFrame?: string };+ source?: TakeFacts;grid?: { size: GridSize; type: GridType };cast?: CastValues;/** Soul Location: which extra view to render. */@@ -228,6 +229,22 @@ export interface CinemaGenerateInput {capture?: SceneCapture;}+/**+ * A take picked to extend, edit or re-angle, with what the browser knows about it: the model it was made on (a partner+ * take is edited by a partner editor), its scene (an LTX-2.3 edit re-renders the whole scene with the change), its length,+ * resolution and shape (what an edit costs; a take longer than 20 s is edited for its first 20 s).+ */+export interface TakeFacts {+ url: string;+ kind: "image" | "video";+ firstFrame?: string;+ modelId?: string;+ prompt?: string;+ seconds?: number;+ resolution?: string;+ aspectRatio?: string;+}+export interface SceneCapture {url: string;/** mm on a full-frame body. */@@ -242,6 +259,11 @@ export interface CinemaContext {cloudAllowed?: boolean;/** Models that exist in this build (open-engine adds the grid / Soul Cast / restyle workflows). */has?: (modelId: string) => boolean;+ /**+ * A civitai key is set, so a camera LoRA that downloads from civitai can reach fal. False: a cloud move whose LoRA+ * needs it is written into the prompt instead (unknown = assumed set).+ */+ civitai?: boolean;}export interface CinemaStep {@@ -548,6 +570,8 @@ export const SOUL_BUILDER_MODEL = "fuobe-soul";/** The Soul look a cast sheet is made in (natural, unretouched skin and fabric) and a location in (a widescreen film still). */export const CAST_LOOK = "v1-realistic";export const LOCATION_LOOK = "v1-movie";+/** The open Soul Cast sheet graph (soul-cast-sheet-zimage): the sheet, then its four views as their own pictures. */+export const CAST_SHEET_MODEL = "oss-zimage-soul-cast";/*** Models offered in the prompt bar, per mode and engine. The first is the default: the Original on both engines.@@ -1102,16 +1126,20 @@ export type CinemaMoveRoute =| { via: "fun-camera"; pose: string }/** Cloud: a hosted open model's own move (Rack Focus: LTX-2.5's focus_shift). */| { via: "hosted-move"; modelId: string; cameraMotion: string }- /** The move's words only; `frame`: a start frame would let a LoRA, pose or hosted move drive it. */- | { via: "prompt"; frame?: boolean };+ /**+ * The move's words only; `frame`: a start frame would let a LoRA, pose or hosted move drive it; `key`: its camera LoRA+ * downloads from civitai, and without a civitai key fal can't get it.+ */+ | { via: "prompt"; frame?: boolean; key?: boolean };/*** A camera move on Fuobe Cinema (research studios[cinema-studio].original.cameraLora). In the cloud: LTX-2.3's camera* LoRA where one fits, else (with a start frame) the move's Wan 2.2 LoRA on Fuobe DoP or a hosted model's own move, else* words. On the user's GPU: the move's Wan 2.2 LoRA or a Fun Camera pose (with a start frame), else words. A LoRA whose- * licence keeps it on the GPU never goes to the cloud.+ * licence keeps it on the GPU never goes to the cloud, and one that downloads from civitai goes only with a civitai key+ * (`civitai: false`: none is set; the cloud run would stop at the download, so the move runs on its words).*/-export function cinemaMoveRoute(slug: string, engine: Engine, hasStartFrame: boolean): CinemaMoveRoute {+export function cinemaMoveRoute(slug: string, engine: Engine, hasStartFrame: boolean, opts: { civitai?: boolean } = {}): CinemaMoveRoute {const move = moveBySlug(slug);if (!move) return { via: "prompt" };if (engine === "open") {@@ -1123,12 +1151,14 @@ export function cinemaMoveRoute(slug: string, engine: Engine, hasStartFrame: booconst cameraLora = CINEMA_CAMERA_LORA[slug];if (cameraLora) return { via: "camera-lora", cameraLora };const cloud = move.motionId ? getPreset(move.motionId)?.cloud : undefined;- const loras = (cloud?.modelId === DOP_MODEL ? (cloud.loras ?? []) : []).filter((l) => !localOnly(l));+ const hostable = (cloud?.modelId === DOP_MODEL ? (cloud.loras ?? []) : []).filter((l) => !localOnly(l));+ const key = opts.civitai === false && hostable.some((l) => !l.hostedUrl && needsToken(l.url));+ const loras = key ? [] : hostable;const motion = cloud?.modelId === LTX25_HOSTED ? cloud.params?.extra?.camera_motion : undefined;- if (!hasStartFrame) return { via: "prompt", frame: loras.length > 0 || typeof motion === "string" };+ if (!hasStartFrame) return { via: "prompt", frame: loras.length > 0 || typeof motion === "string", ...(key && { key }) };if (loras.length) return { via: "lora", modelId: DOP_MODEL, loras, trigger: triggerOf(loras) };if (typeof motion === "string") return { via: "hosted-move", modelId: LTX25_HOSTED, cameraMotion: motion };- return { via: "prompt" };+ return { via: "prompt", ...(key && { key }) };}/** The chain-slot placeholder a planned step uses for the palette swatch (the server swaps in the real PNG). */@@ -1308,11 +1338,27 @@ function label(steps: CinemaStep[], labels: Record<string, string>): CinemaStep[return steps.map((s, i) => ({ ...s, request: { ...s.request, step: { label: labels[s.key] ?? s.key, index: i, of: steps.length } } }));}-function planVideo(input: CinemaGenerateInput): CinemaPlan {+/**+ * Reference clips on the cloud default: Fuobe Cinema takes none yet (research studios[cinema-studio].original+ * .referenceClips), so a take that carries some runs on the first partner model in the menu that takes them all+ * (Seedance 2.5). A model picked from the menu stays, and clipInputs says what it leaves out.+ */+function clipModel(model: ModelDef, input: CinemaGenerateInput, notes: string[]): ModelDef {+ const kinds = (["videos", "audios"] as const).filter((k) => !!input[k]?.length);+ if (input.engine !== "cloud" || input.modelId || model.id !== CINEMA_MODEL || !kinds.length || kinds.every((k) => takesClips(model, "ref2v", k))) return model;+ const instead = CINEMA_MODELS.video.cloud+ .flatMap((id) => (id === CINEMA_MODEL ? [] : (modelOn(id, "cloud") ?? [])))+ .find((m) => kinds.every((k) => takesClips(m, "ref2v", k)));+ if (!instead) return model;+ notes.push(`${model.name} doesn't take reference clips yet, so this take runs on ${instead.name} (a partner model) with them — pick ${model.name} in the menu to leave them out`);+ return instead;+}++function planVideo(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {const notes: string[] = [];const engine = input.engine;const open = engine === "open";- let model = pickModel("video", input);+ let model = clipModel(pickModel("video", input), input, notes);const moves = (input.moves ?? []).filter((m) => moveBySlug(m));let images = [...(input.images ?? [])];let trigger: string | undefined;@@ -1322,7 +1368,7 @@ function planVideo(input: CinemaGenerateInput): CinemaPlan {// LoRAs and poses); a partner model gets it in words.if (moves.length && (model.id === CINEMA_MODEL || (open && model.family === "wan"))) {const name = moveBySlug(moves[0])!.name;- const r = cinemaMoveRoute(moves[0], engine, images.length > 0);+ const r = cinemaMoveRoute(moves[0], engine, images.length > 0, { civitai: ctx.civitai });if (r.via === "camera-lora") {extra.camera_lora = r.cameraLora;notes.push(`${name} drives LTX-2.3's ${r.cameraLora.replace(/_/g, " ")} camera LoRA`);@@ -1340,13 +1386,14 @@ function planVideo(input: CinemaGenerateInput): CinemaPlan {model = modelOn(r.modelId, engine) ?? model;extra.camera_motion = r.cameraMotion;notes.push(`${name} runs on ${model.name}'s own ${r.cameraMotion.replace(/_/g, " ")} move (open weights, hosted)`);- } else notes.push(`${name} is written into the prompt${r.frame ? ` — add a start frame to drive it with its camera LoRA${open ? " or Fun Camera" : ""}` : ""}`);+ } else if (r.key) notes.push(`${name} is written into the prompt — its camera LoRA downloads from civitai, which needs your free API key (Settings → LoRAs)`);+ else notes.push(`${name} is written into the prompt${r.frame ? ` — add a start frame to drive it with its camera LoRA${open ? " or Fun Camera" : ""}` : ""}`);}const compiled = compileDirector({ prompt: input.prompt, settings: input.settings, moves, brief: input.brief, mode: "video", target: "prompt" });let prompt = trigger ? `${trigger}. ${compiled.prompt}` : compiled.prompt;const params = fitParams(model, input, notes, "video");if (Object.keys(extra).length) params.extra = extra;- let seconds = Math.max(DURATION.min, Math.min(DURATION.max, Math.round(input.duration ?? DURATION.default)));+ let seconds = askedSeconds(input);const ms = input.multiShot;const shots = (ms?.shots ?? []).filter((s) => s.prompt.trim());@@ -1399,11 +1446,12 @@ function planVideo(input: CinemaGenerateInput): CinemaPlan {op: "extend",prompt,chain: [{ slot: "video" }],- // The extension keeps the take's size; its resolution prices it.+ // The extension keeps the take's size; its resolution and shape price it.params: {duration: rest,numOutputs: 1,...(params.resolution && { resolution: params.resolution }),+ ...(params.aspectRatio && { aspectRatio: params.aspectRatio }),...(params.generateAudio !== undefined && { generateAudio: params.generateAudio }),...(extra.camera_lora ? { extra: { camera_lora: extra.camera_lora } } : {}),},@@ -1505,8 +1553,12 @@ function planGrid(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {);}-/** Soul Cast's makers: Fuobe Soul (the Realistic look) on both engines; Nano Banana Pro, or the open Soul Cast sheet graph. */-export const CAST_MODELS: Record<Engine, string[]> = { cloud: [SOUL_BUILDER_MODEL, "nano-banana-pro"], open: [SOUL_BUILDER_MODEL, "oss-zimage-soul-cast"] };+/**+ * Soul Cast's makers, the first the default. In the cloud: Fuobe Soul (the Realistic look), else Nano Banana Pro. On the+ * user's GPU: the Soul Cast sheet graph with Fuobe Soul's Realistic look (the same Z-Image Turbo with the look's LoRAs and+ * words), which also cuts the sheet's four views, else Fuobe Soul alone.+ */+export const CAST_MODELS: Record<Engine, string[]> = { cloud: [SOUL_BUILDER_MODEL, "nano-banana-pro"], open: [CAST_SHEET_MODEL, SOUL_BUILDER_MODEL] };/** Soul Location's makers: Fuobe Soul (the Movie look) on both engines, partner and open alternatives after it. */export const LOCATION_MODELS: Record<Engine, string[]> = { cloud: [SOUL_BUILDER_MODEL, "nano-banana-pro", "seedream-5-pro"], open: [SOUL_BUILDER_MODEL, "oss-z-image-turbo", "oss-qwen-image"] };@@ -1523,8 +1575,20 @@ function planCast(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {const model = builderModel(CAST_MODELS[input.engine], input, ctx);const soul = model.id === SOUL_BUILDER_MODEL;const params = fitParams(model, { ...input, aspectRatio: "16:9", resolution: "2K" }, notes, "image");- const prompt = withBrief(input.brief, castPrompt(input.cast ?? {}, input.prompt));- return finish(model, [{ key: "main", request: { feature: "cinema-cast", modelId: model.id, engine: input.engine, ...(soul && { presetId: CAST_LOOK }), prompt, params } }], notes);+ let prompt = withBrief(input.brief, castPrompt(input.cast ?? {}, input.prompt));+ let loras: LoraRef[] | undefined;+ if (model.id === CAST_SHEET_MODEL) {+ // The sheet graph is Fuobe Soul's own base: the Realistic look's LoRAs and words go on it, as a Fuobe Soul run would.+ const recipe = soulRecipe("soul", prompt, { look: CAST_LOOK });+ prompt = recipe.prompt;+ loras = recipe.loras.length ? recipe.loras : undefined;+ notes.push(`Fuobe Soul's ${recipe.look?.name ?? "Realistic"} look on the Soul Cast sheet graph: the sheet, then its four views`);+ }+ return finish(+ model,+ [{ key: "main", request: { feature: "cinema-cast", modelId: model.id, engine: input.engine, ...(soul && { presetId: CAST_LOOK }), prompt, params, ...(loras && { loras }) } }],+ notes,+ );}/**@@ -1540,7 +1604,7 @@ function planLocationView(input: CinemaGenerateInput): CinemaPlan {let request: GenerationRequest;if (input.engine === "cloud") {model = getModel("qwen-multiple-angles")!;- const words = `${LOCATION_KEEP}${tidy(input.prompt) ? `. ${tidy(input.prompt)}` : ""}.`;+ const words = withBrief(input.brief, `${LOCATION_KEEP}${tidy(input.prompt) ? `. ${tidy(input.prompt)}` : ""}.`);request = {feature: "cinema-location",modelId: model.id,@@ -1556,7 +1620,8 @@ function planLocationView(input: CinemaGenerateInput): CinemaPlan {feature: "cinema-location",modelId: model.id,op: "edit",- prompt: `<sks> ${poseWords(view.pose)}. ${locationViewPrompt(view.id, input.prompt)}`,+ // The LoRA's own words lead; the brief keeps the project's look.+ prompt: `<sks> ${poseWords(view.pose)}. ${withBrief(input.brief, locationViewPrompt(view.id, input.prompt))}`,inputs,params: { numOutputs: 1 },...(loras?.length ? { loras } : {}),@@ -1600,17 +1665,25 @@ function cameraExtra(model: ModelDef, moves: string[] | undefined): Record<strinreturn fit ? { camera_lora: fit } : undefined;}+/** The seconds asked for on the duration chip (within Cinema's 4–30 s). */+const askedSeconds = (input: CinemaGenerateInput) => Math.max(DURATION.min, Math.min(DURATION.max, Math.round(input.duration ?? DURATION.default)));+function planExtend(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {const notes: string[] = [];const src = input.source?.kind === "video" ? input.source : undefined;const settings = input.settings;const moves = input.moves ?? [];+ // Fuobe Cinema in the cloud adds at most one LTX-2.3 call (20 s) per extend: say so rather than cut the length quietly.+ const capped = (m: ModelDef, what: string) => {+ if (anyLength(m) && askedSeconds(input) > CINEMA_MAX_SECONDS) notes.push(`${m.name} ${what} up to ${CINEMA_MAX_SECONDS}s at a time, so this one is ${CINEMA_MAX_SECONDS}s — run it again for more`);+ };if (input.action === "extend-forward") {const model = videoModelFor("extend", input, notes);const scene = input.prompt.trim() || "Continue the shot naturally: the same characters, location and camera language, picking up exactly where it ends";const compiled = compileDirector({ prompt: scene, settings, moves, brief: input.brief, mode: "video", target: "prompt" });const params = fitParams(model, input, notes, "video");params.numOutputs = 1;+ capped(model, "extends by");const camera = cameraExtra(model, moves);if (camera) params.extra = camera;const clips = clipInputs(model, "extend", input, notes);@@ -1630,6 +1703,7 @@ function planExtend(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlanconst params = fitParams(video, input, notes, "video");params.numOutputs = 1;params.extra = { ...cameraExtra(video, moves), extend_direction: "backward" };+ capped(video, "makes a prequel of");return finish(video,[{ key: "main", request: { feature: "cinema", modelId: video.id, engine: input.engine, op: "extend", prompt: compiled.prompt, inputs: src ? { video: src.url } : undefined, params, step: { label: "Extended · prequel", index: 0, of: 1 } } }],@@ -1687,25 +1761,74 @@ function planExtend(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlanreturn finish(video, steps, notes, blocker);}+/**+ * How strongly LTX-2.3's video-to-video holds the take when Fuobe Cinema edits it (fal's `video_strength`: lower lets the+ * model change more; fal's default of 0.01 all but re-renders the clip). Fuobe's guess, between the Evolution recipe's+ * low and medium change (build plan O13: denoise 0.45 / 0.65), until the cinema-edit eval suite measures it.+ */+export const CINEMA_EDIT_STRENGTH = 0.5;++/**+ * The prompt of an edit on LTX-2.3's video-to-video, which renders a whole scene rather than following an instruction: the+ * take's own scene with the change written into it, and what has to stay.+ */+export function editPrompt(change: string, scene?: string): string {+ const keep = "Everything else stays as it is: the same people, place, framing, camera move, light and sound";+ const c = tidy(change);+ const sc = tidy(scene);+ return `${sc ? `${sc}. The same shot with one change` : "The same shot with one change"}: ${c}. ${keep}.`;+}++/** A take made on a partner model in the menu (Seedance 2.5, Kling 3.0, Veo 3.1): a partner editor edits it. */+const partnerTake = (modelId: string) => modelId !== CINEMA_MODEL && CINEMA_MODELS.video.cloud.includes(modelId);+function planEdit(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {const notes: string[] = [];const has = ctx.has ?? ((id: string) => !!getModel(id));const src = input.source?.kind === "video" ? input.source : undefined;- const prompt = withBrief(input.brief, tidy(applyEmotions(input.prompt, input.settings.emotions)));+ const change = tidy(applyEmotions(input.prompt, input.settings.emotions));+ const prompt = withBrief(input.brief, change);let blocker = !src ? "Select a video take to edit" : !input.prompt.trim() ? "Describe the change" : undefined;if (input.engine === "cloud") {- // Fuobe Cinema edits with LTX-2.3's video-to-video; a partner pick edits through Kling O3 (Seedance 2.5 has no edit on fal).- const picked = pickModel("video", input);- const original = picked.id === CINEMA_MODEL;- const model = original ? picked : getModel("kling-o3")!;- if (!original) notes.push(`${picked.name}'s takes are edited with ${model.name}`);- const images = original ? [] : (input.images ?? []).slice(0, 4);- // Extra reference clips ride along when the edit model's routes take them.- const clips = clipInputs(model, "v2v", input, notes);- const params: GenParams = { numOutputs: 1, ...(model.options.audio === true && { generateAudio: input.audio !== false }) };+ // Which editor follows the take: one made on a partner model goes to Kling O3 (Seedance 2.5 has no edit on fal), any+ // other (Fuobe Cinema, Fuobe DoP, an open-engine take) to LTX-2.3's video-to-video. Without the take's model, the menu's.+ const origin = src?.modelId ?? pickModel("video", input).id;+ if (partnerTake(origin)) {+ const model = getModel("kling-o3")!;+ notes.push(`Takes made on ${getModel(origin)?.name ?? origin} are edited with ${model.name}`);+ const images = (input.images ?? []).slice(0, 4);+ // Extra reference clips ride along when the edit model's routes take them.+ const clips = clipInputs(model, "v2v", input, notes);+ const params: GenParams = { numOutputs: 1, ...(model.options.audio === true && { generateAudio: input.audio !== false }) };+ return finish(+ model,+ [{ key: "main", request: { feature: "cinema", modelId: model.id, engine: "cloud", op: "v2v", prompt, inputs: src ? { video: src.url, ...(images.length ? { images } : {}), ...clips } : undefined, params, step: { label: "Edited take", index: 0, of: 1 } } }],+ notes,+ blocker,+ );+ }+ const model = modelOn(CINEMA_MODEL, "cloud")!;+ const o = model.options;+ const seconds = src?.seconds && Number.isFinite(src.seconds) && src.seconds > 0 ? src.seconds : undefined;+ // LTX-2.3 renders up to 481 frames: a longer take (20 s + an extend) is edited for its first 20 s.+ const long = seconds !== undefined && seconds > CINEMA_MAX_SECONDS + 0.5;+ if (long) notes.push(`${model.name} edits up to ${CINEMA_MAX_SECONDS}s of a take (481 frames), so this edit is the take's first ${CINEMA_MAX_SECONDS}s`);+ const resolution = [src?.resolution, input.resolution].find((r) => r && o.resolutions?.includes(r));+ const aspectRatio = [src?.aspectRatio, input.aspectRatio].find((a) => a && o.aspectRatios?.includes(a));+ if (input.videos?.length || input.audios?.length) notes.push(`${model.name} edits from the take alone — reference videos and audio aren't used`);+ if (input.images?.length) notes.push(`${model.name} edits from the take alone — reference images aren't used`);+ // The take's length and size price it (the edit is as long as the take); the clip's own header sets the frames.+ const params: GenParams = {+ numOutputs: 1,+ duration: Math.min(seconds ?? DURATION.default, CINEMA_MAX_SECONDS),+ ...(resolution && { resolution }),+ ...(aspectRatio && { aspectRatio }),+ ...(o.audio === true && { generateAudio: input.audio !== false }),+ extra: { video_strength: CINEMA_EDIT_STRENGTH, audio_strength: 1, ...(long && { match_video_length: false }) },+ };return finish(model,- [{ key: "main", request: { feature: "cinema", modelId: model.id, engine: "cloud", op: "v2v", prompt, inputs: src ? { video: src.url, ...(images.length ? { images } : {}), ...clips } : undefined, params, step: { label: "Edited take", index: 0, of: 1 } } }],+ [{ key: "main", request: { feature: "cinema", modelId: model.id, engine: "cloud", op: "v2v", prompt: withBrief(input.brief, editPrompt(change, src?.prompt)), inputs: src ? { video: src.url } : undefined, params, step: { label: "Edited take", index: 0, of: 1 } } }],notes,blocker,);@@ -1821,7 +1944,7 @@ export function planCinema(input: CinemaGenerateInput, ctx: CinemaContext): Cinecase "recompose":return planRecompose(i);default:- return i.mode === "image" ? planStill(i) : planVideo(i);+ return i.mode === "image" ? planStill(i) : planVideo(i, ctx);}}diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.tsindex 7640fa3d..b0ec7bda 100644--- a/src/lib/catalog/cloud-models.generated.ts+++ b/src/lib/catalog/cloud-models.generated.ts@@ -17677,6 +17677,10 @@ export const ORIGINAL_CLOUD: ModelDef[] = ["480p": 0.018,"720p": 0.039,"1080p": 0.0905+ },+ "videoMegapixel": {+ "usd": 0.001605,+ "withLoras": 0.001805}}}diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.tsindex d1415a81..4af517ac 100644--- a/src/lib/catalog/plan.ts+++ b/src/lib/catalog/plan.ts@@ -13,6 +13,7 @@ import type {} from "./types";import { chainGapProblem, chainTiming, FIRST_AT_ZERO, frameTimes, keyframeChain, MAX_KEYFRAMES, spread } from "./keyframes";import { cloudPath, fitLoras, gated, localOnly, loraCapacity, needsToken, routeLoraField, triggerOf } from "./loras";+import { numFramesValue, sizeValue } from "./payload";import { CINEMA_CROP, soulKind, soulMegapixels, soulRecipe, soulSize, type SoulOverlay } from "./soul";/** Infer the operation from what the user attached. */@@ -589,6 +590,21 @@ export function routeLoras(route: Pick<ModelRoute, "provider" | "map" | "loraEndreturn { applied, dropped: loras.filter((l) => !applied.includes(l)).map((l) => ({ file: l.file, reason: why(l) })) };}+/**+ * The megapixels of video a frame-count model makes in `seconds` (Pricing.videoMegapixel: Fuobe Cinema's LTX-2.3): the+ * size its size table gives the tier and shape (an extend or an edit keeps its take's, priced the same), times the frames+ * its frame count renders. Undefined when no route has both.+ */+function videoMegapixels(model: ModelDef, params: GenParams, seconds: number): number | undefined {+ const sized = model.routes.find((r) => r.map?.size?.table && r.map.numFrames);+ const size = sized?.map?.size;+ const f = sized?.map?.numFrames;+ if (!size || !f) return undefined;+ const { width, height } = sizeValue(size, params.aspectRatio ?? model.defaults?.aspectRatio, params.resolution ?? model.defaults?.resolution);+ const frames = numFramesValue({ ...f, fromDuration: true }, { duration: seconds, fps: params.fps });+ return frames === undefined ? undefined : (width * height * frames) / 1e6;+}+/** Rough USD estimate for a plan (BYO-key cloud runs). Open-source runs are free. */export function estimateCost(model: ModelDef, params: GenParams, jobs = 1, op?: Operation, withLoras = false): number | null {if (model.engine === "open" || !model.pricing) return model.engine === "open" ? 0 : null;@@ -606,7 +622,12 @@ export function estimateCost(model: ModelDef, params: GenParams, jobs = 1, op?:const mp = soulKind(model) ? soulMegapixels(params.aspectRatio ?? model.defaults?.aspectRatio, params.resolution ?? model.defaults?.resolution) : 1;per = usd * (p.roundUp ? Math.ceil(mp - 1e-9) : mp) * n;}- if (p.unit === "second") per = usd * (clip ?? params.duration ?? model.defaults?.duration ?? 5) * (p.inputSeconds ? 2 : 1);+ if (p.unit === "second") {+ const seconds = clip ?? params.duration ?? model.defaults?.duration ?? 5;+ const mp = p.videoMegapixel ? videoMegapixels(model, params, seconds) : undefined;+ const rate = p.videoMegapixel && (withLoras && p.videoMegapixel.withLoras !== undefined ? p.videoMegapixel.withLoras : p.videoMegapixel.usd);+ per = mp !== undefined && rate ? Math.ceil(mp - 1e-9) * rate : usd * seconds * (p.inputSeconds ? 2 : 1);+ }if (p.unit === "minute") per = (usd * (params.duration ?? 60)) / 60;// Settings that change the price (60 fps, a Pro tier, a cheaper model).for (const f of p.factors ?? []) {diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex cd2a064a..340e22cc 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -578,6 +578,12 @@ export interface Pricing {withLoras?: number;/** withLoras at each resolution, when it differs (Fuobe Cinema's LTX-2.3 bills per megapixel of video). */withLorasByResolution?: Record<string, number>;+ /**+ * Billed per megapixel of video made, width × height × frames rounded up (fal's LTX-2.3): a per-second model whose+ * routes carry a size table and a frame count is priced on the clip's real size for its tier and shape and its frame+ * count, rather than on `usd` / `byResolution` (one shape's per-second rate). `withLoras`: the LoRA endpoint's rate.+ */+ videoMegapixel?: { usd: number; withLoras?: number };/** Per-megapixel prices billed on whole megapixels (fal's Qwen-Image 2512). */roundUp?: true;/** What an animation preset adds to a run (params.animation: Meshy rigging +$0.12). */diff --git a/src/lib/soul-post.ts b/src/lib/soul-post.tsindex 4c68f081..262cb7c5 100644--- a/src/lib/soul-post.ts+++ b/src/lib/soul-post.ts@@ -41,6 +41,15 @@ export function cropRect(width: number, height: number, aspect: string): { x: nureturn { x: 0, y: Math.round((height - h) / 2), width, height: h };}+/**+ * A picked output's URL now: the finished picture's when `url` was its raw one (meta.original: a pick made before the+ * grade and crop were applied), else `url`.+ */+export function finishedUrl(gens: Pick<Generation, "outputs">[], url: string): string {+ for (const g of gens) for (const o of g.outputs) if (o.url === url || o.meta?.original === url) return o.url;+ return url;+}+/** Which outputs of a finished job still need their post steps (indexes into outputs). */export function outputsToFinish(g: Pick<Generation, "status" | "outputs" | "provider">): number[] {if (g.status !== "succeeded") return [];diff --git a/src/server/cinema-generate.ts b/src/server/cinema-generate.tsindex 94a02a10..91d75f7d 100644--- a/src/server/cinema-generate.ts+++ b/src/server/cinema-generate.ts@@ -16,12 +16,15 @@ import type { Generation, GenerationRequest } from "@/lib/catalog/types";import { CinemaError, folderExists, getProject, recordTakes, spentUsd } from "./cinema";import { createGenerations, previewGeneration } from "./generations";import { encodePng } from "./png";-import { engineMode } from "./settings";+import { engineMode, getSetting } from "./settings";import { saveFile } from "./storage";-/** What this install can run right now (cloud fallbacks such as reading a take's first frame, the workflows it has). */+/**+ * What this install can run right now (cloud fallbacks such as reading a take's first frame, the workflows it has, a+ * camera LoRA that downloads from civitai, which fal gets only with the user's civitai key).+ */export function cinemaContext(): CinemaContext {- return { cloudAllowed: engineMode() !== "open", has: (id) => !!getModel(id) };+ return { cloudAllowed: engineMode() !== "open", has: (id) => !!getModel(id), civitai: !!getSetting("civitaiKey") };}declare global {diff --git a/src/server/cinema-schemas.ts b/src/server/cinema-schemas.tsindex 5861fbae..9c2f2005 100644--- a/src/server/cinema-schemas.ts+++ b/src/server/cinema-schemas.ts@@ -93,7 +93,19 @@ export const GenerateBody = z.object({batch: z.number().int().min(1).max(4).optional(),audio: z.boolean().optional(),multiShot: z.object({ mode: z.enum(["off", "auto", "manual"]), shots: z.array(Shot).max(12).optional() }).optional(),- source: z.object({ url: FileRef, kind: z.enum(["image", "video"]), firstFrame: FileRef.optional() }).optional(),+ source: z+ .object({+ url: FileRef,+ kind: z.enum(["image", "video"]),+ firstFrame: FileRef.optional(),+ // What the browser knows about the take (its model picks the editor; its scene, length and size shape an edit).+ modelId: z.string().max(80).optional(),+ prompt: z.string().max(4000).optional(),+ seconds: z.number().positive().max(600).optional(),+ resolution: z.string().max(10).optional(),+ aspectRatio: z.string().max(10).optional(),+ })+ .optional(),grid: z.object({ size: z.enum(["2x2", "3x3", "4x4"]), type: z.enum(["freeform", "zooms", "shots", "next_shots", "prev_shots"]) }).optional(),cast: z.record(z.string().max(40), z.union([z.string().max(300), z.number(), z.array(z.string().max(60)).max(10)])).optional(),view: z.string().max(20).optional(),