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 O13: Popcorn in the cloud on hosted open weights, Nano Banana Pro a partner choice; a 21:9 look board's film stays 21:9
Claude4ce53e12d871
diff --git a/docs/research/fuobe-originals-recipes-5.json b/docs/research/fuobe-originals-recipes-5.jsonindex 06c273ed..265babd0 100644--- a/docs/research/fuobe-originals-recipes-5.json+++ b/docs/research/fuobe-originals-recipes-5.json@@ -18010,8 +18010,10 @@"original": {"added": "2026-10-29 (build plan O13)","looks": "a board can take one of Fuobe Soul's 139 looks: frame 1 is made on Fuobe Soul with the look (its LoRAs, words and grade) on either engine, the next frames continue from it with the look's words, and every frame gets the look's grade and overlay after it is made (the browser's Soul finish); each next frame is made from the previous frame as it came out, before its finish, so the grade is applied once",- "references": "with references, frame 1 stays on the reference model (Nano Banana Pro in the cloud, Qwen-Image-Edit on the GPU) with the look's words, and the look's grade",- "next": "unchanged: Nano Banana Pro edits in the cloud, Qwen-Image-Edit 2509 + next-scene LoRA on the GPU; the hosted next-scene route (fal-ai/qwen-image-edit-plus-lora-gallery/next-scene) is not schema-read yet"+ "references": "with references, frame 1 stays on the reference model (Qwen-Image-Edit 2511 on either engine, or the partner model when it is picked) with the look's words, and the look's grade",+ "next": "Fuobe's recipe on both engines (corrected 2026-10-29): the next frames are Qwen-Image-Edit 2509 + the next-scene LoRA (adapterLoras next-scene-qwen-edit-2509, MIT, at 0.75), on your GPU (storyboard-qwen-edit-2509-next-scene) and in the cloud on fal-ai/qwen-image-edit-plus-lora (hostedBaseEndpoints, schema read; the LoRA rides along as a URL), the previous frame as image 1 and the first reference as image 2. The gallery route fal-ai/qwen-image-edit-plus-lora-gallery/next-scene isn't needed.",+ "first": "frame 1 without a look: Z-Image Turbo (oss-z-image-turbo on the GPU, z-image-turbo-cloud = fal-ai/z-image/turbo in the cloud); with references: Qwen-Image-Edit 2511 (oss-qwen-edit, qwen-image-edit-2511-cloud); with a look and no references: Fuobe Soul",+ "partner": "Nano Banana Pro stays a separate choice in the cloud (the Storyboard's Frames chip; API partner: \"nano-banana-pro\"): every frame on it, each next frame from the last one with the references, as boards ran before"}},{@@ -22589,6 +22591,30 @@],"hostedEndpoint": "fal-ai/flux-2/klein/4b/edit/lora","notes": "Rank-32 edit LoRA trained by xocialize with ai-toolkit on FLUX.2-klein-base-4B (Apache-2.0); card licence apache-2.0, so fal may host it (build plan O10's check). Three ordered inputs: person, top (or a dress / whole outfit), bottom; trigger TRYON. Trained on clothing-agnostic people: the open graph greys the old outfit out first (ClothesSegment), the hosted route sends the photo as it is (quality unmeasured until the eval harness runs the fashion suite)."+ },+ {+ "key": "next-scene-qwen-edit-2509",+ "name": "Next Scene for Qwen-Image-Edit 2509 (lovis93)",+ "url": "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509/resolve/main/next-scene_lora-v2-3000.safetensors",+ "page": "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509",+ "file": "next-scene_lora-v2-3000.safetensors",+ "trigger": "Next Scene:",+ "strength": 0.75,+ "base": "qwen-image-edit-2509",+ "licence": "MIT",+ "commercial": true,+ "hostedOk": true,+ "download": "direct",+ "released": "2025-10-21",+ "revision": "9b9da698b8a5370efd875f18b1727cc1119f3863",+ "sha256": "8abf2306649a62282f89968515097650acaf7b040687c9b6c56e37558e6df9e1",+ "sizeBytes": 295146176,+ "checked": "2026-10-29",+ "usedBy": [+ "storyboard (Popcorn) next frames in the cloud"+ ],+ "hostedEndpoint": "fal-ai/qwen-image-edit-plus-lora",+ "notes": "The v2 next-scene LoRA the GPU's storyboard-qwen-edit-2509-next-scene graph loads (at 0.75), so a cloud board's next frames run the same recipe on fal's hosted Qwen-Image-Edit 2509 (loras: [{path, scale}], up to 3; $0.035 per megapixel). Card licence MIT, base Qwen/Qwen-Image-Edit-2509 (Apache-2.0); a prompt starting \"Next Scene:\" continues the previous panel (image 1) with a new shot. Pinned 2026-10-29 from the Hugging Face API (repo head, the file's LFS SHA256 and size)."}]}diff --git a/docs/research/fuobe-originals-recipes-5.md b/docs/research/fuobe-originals-recipes-5.mdindex 4503a5bb..68e256dc 100644--- a/docs/research/fuobe-originals-recipes-5.md+++ b/docs/research/fuobe-originals-recipes-5.md@@ -706,7 +706,7 @@ Also new and worth a later look: Lightricks LTX-2.5 **Cinemagraph** (2026-09-10,- **Hosted:** fal-ai/qwen-image-edit-plus-lora-gallery/next-scene ($0.035/MP)- **Hosted:** fal-ai/qwen-image-edit-2511/lora with a next-scene LoRA- **Licences:** Apache-2.0-- **Fuobe Popcorn looks (added 2026-10-29 for O13; JSON: `studios[popcorn].original`).** A board can take one of Fuobe Soul's 139 looks: frame 1 is made on Fuobe Soul with the look (its LoRAs, words and grade) on either engine; the next frames continue from the frame before with the look's words; every frame gets the look's grade and overlay after it is made (the browser's Soul finish), and each next frame is made from the previous frame as it came out, before its finish, so the grade is applied once. With references, frame 1 stays on the reference model (Nano Banana Pro in the cloud, Qwen-Image-Edit on the GPU) with the look's words. Fuobe Soul has no 21:9: a 21:9 board in a look is made at 16:9 and cropped. The next-frame models are unchanged; the hosted next-scene route (`fal-ai/qwen-image-edit-plus-lora-gallery/next-scene`) still has no schema read.+- **Fuobe Popcorn looks (added 2026-10-29 for O13; JSON: `studios[popcorn].original`).** A board can take one of Fuobe Soul's 139 looks: frame 1 is made on Fuobe Soul with the look (its LoRAs, words and grade) on either engine; the next frames continue from the frame before with the look's words; every frame gets the look's grade and overlay after it is made (the browser's Soul finish), and each next frame is made from the previous frame as it came out, before its finish, so the grade is applied once. With references, frame 1 stays on the reference model (Qwen-Image-Edit 2511 on either engine) with the look's words. Fuobe Soul has no 21:9: a 21:9 board in a look is made at 16:9 and cropped, and its film is 21:9 too, made once the browser has finished the frames. *Corrected 2026-10-29:* the board is open weights on both engines. The next frames are Qwen-Image-Edit 2509 + the next-scene LoRA (`adapterLoras` `next-scene-qwen-edit-2509`, MIT, at 0.75): the GPU graph loads it, and in the cloud it rides along as a URL on `fal-ai/qwen-image-edit-plus-lora` (schema read; $0.035 per megapixel). Frame 1 is Z-Image Turbo without references (hosted `fal-ai/z-image/turbo` in the cloud). The gallery route (`fal-ai/qwen-image-edit-plus-lora-gallery/next-scene`) isn't needed. Nano Banana Pro stays a separate partner choice in the cloud for the whole board (API `partner: "nano-banana-pro"`).### evolutiondiff --git a/scripts/eval/cases/popcorn.json b/scripts/eval/cases/popcorn.jsonindex 689336bf..17354c10 100644--- a/scripts/eval/cases/popcorn.json+++ b/scripts/eval/cases/popcorn.json@@ -2,7 +2,7 @@"$schema": "./case.schema.json","suite": "popcorn","title": "Popcorn · storyboards in Fuobe Soul's looks",- "description": "Runs the Storyboard (POST /api/storyboards, priced by /api/storyboards/estimate) with a Fuobe Soul look (build plan O13): frame 1 on Fuobe Soul with the look's LoRAs and words, the next frames from the frame before (Nano Banana Pro edits in the cloud, Qwen-Image-Edit 2509 + the next-scene LoRA on your GPU) with the look's words; the look's grade and overlay are applied in the browser after, so scores are of the raw frames. Continuity is how well the frames hold together; the no-look case is the board as it was before.",+ "description": "Runs the Storyboard (POST /api/storyboards, priced by /api/storyboards/estimate) with a Fuobe Soul look (build plan O13): frame 1 on Fuobe Soul with the look's LoRAs and words, the next frames from the frame before (Qwen-Image-Edit 2509 + the next-scene LoRA on both engines: your GPU's graph, or fal's hosted Qwen-Image-Edit 2509 with the LoRA sent as a URL) with the look's words; the look's grade and overlay are applied in the browser after, so scores are of the raw frames. Continuity is how well the frames hold together; the no-look case is the board as it was before.","original": ["fuobe-soul"],diff --git a/src/app/(studio)/storyboard/page.tsx b/src/app/(studio)/storyboard/page.tsxindex 42c70bc5..846ff318 100644--- a/src/app/(studio)/storyboard/page.tsx+++ b/src/app/(studio)/storyboard/page.tsx@@ -1,13 +1,13 @@import type { Metadata } from "next";import { StoryboardView } from "@/components/storyboard-view";import { getModel } from "@/lib/catalog";-import { STORYBOARD_LOOK_MODEL, STORYBOARD_MODELS } from "@/lib/catalog/storyboard";+import { STORYBOARD_LOOK_MODEL, STORYBOARD_MODELS, STORYBOARD_PARTNERS } from "@/lib/catalog/storyboard";export const metadata: Metadata = { title: "Storyboard" };/** Display names for the few models a storyboard uses, so the view needs no catalog in the browser. */const MODEL_NAMES = Object.fromEntries(- Object.values(STORYBOARD_MODELS)+ [...Object.values(STORYBOARD_MODELS), ...Object.values(STORYBOARD_PARTNERS)].flatMap((m) => [m.first, m.firstWithRefs, m.next]).concat(STORYBOARD_LOOK_MODEL).map((id) => [id, getModel(id)?.name ?? id]),diff --git a/src/components/storyboard-view.tsx b/src/components/storyboard-view.tsxindex 0382eb59..dd2c3bfb 100644--- a/src/components/storyboard-view.tsx+++ b/src/components/storyboard-view.tsx@@ -14,12 +14,12 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltipimport { useDebounced } from "@/components/faceless/hooks";import { costText } from "@/components/shorts/ui";import { EngineSwitch } from "@/components/studio/engine-switch";-import { useSoulFinish } from "@/components/studio/soul-finish";+import { finishGaveUp, useSoulFinish } from "@/components/studio/soul-finish";import { FailedTile, MediaThumb, PendingTile, tileRatio } from "@/components/studio/feed";import { fileToSlot, MediaSlot, type SlotValue } from "@/components/studio/media-slot";import { Viewer } from "@/components/studio/viewer";import { useCreateGeneration, useEngine, useGenerationActions, useGenerations } from "@/lib/api";-import { MAX_FRAMES, STORYBOARD_ASPECTS, STORYBOARD_LOOK_MODEL, STORYBOARD_MODELS } from "@/lib/catalog/storyboard";+import { MAX_FRAMES, STORYBOARD_ASPECTS, STORYBOARD_LOOK_MODEL, STORYBOARD_PARTNER_IDS, storyboardModels, type StoryboardPartner } from "@/lib/catalog/storyboard";import { lookCard } from "@/lib/catalog/soul-cards";import type { Engine, Generation } from "@/lib/catalog/types";import { timeAgo } from "@/lib/format";@@ -91,6 +91,31 @@ function RatioPill({ value, onChange }: { value: string; onChange: (v: string) =);}+/** What a cloud board's frames are made on: Fuobe's open recipe, or a partner model for every frame. */+function PartnerPill({ value, onChange, names }: { value?: StoryboardPartner; onChange: (v?: StoryboardPartner) => void; names: Record<string, string> }) {+ const options: { v?: StoryboardPartner; label: string; title: string }[] = [+ { label: "Fuobe", title: "Fuobe's open recipe: hosted Qwen-Image-Edit with the next-scene LoRA" },+ ...STORYBOARD_PARTNER_IDS.map((p) => ({ v: p, label: names[p] ?? p, title: `The frames on ${names[p] ?? p}, a partner model (frame 1 stays on Fuobe Soul in a look)` })),+ ];+ return (+ <div role="radiogroup" aria-label="Frames made on" className="flex flex-wrap gap-1 rounded-full bg-muted p-0.5">+ {options.map((o) => (+ <button+ key={o.v ?? "fuobe"}+ type="button"+ role="radio"+ aria-checked={value === o.v}+ title={o.title}+ onClick={() => onChange(o.v)}+ className={cn("h-7 rounded-full px-2.5 text-[12px] font-medium whitespace-nowrap text-muted-foreground transition", value === o.v && "bg-background text-foreground shadow-soft")}+ >+ {o.label}+ </button>+ ))}+ </div>+ );+}+/** The film made from a board: the joined video big, its shots small underneath. */function FilmStrip({ items, ratio, onOpen }: { items: Generation[]; ratio: number; onOpen: (g: Generation) => void }) {const create = useCreateGeneration();@@ -179,7 +204,8 @@ function Board({const qc = useQueryClient();const first = frames[0];const done = frames.filter((f) => f.status === "succeeded").length;- const ready = filmReady(frames);+ // A look board's frames are graded (and cropped) here first: the film starts from them as they look.+ const ready = filmReady(frames, finishGaveUp);const ratio = tileRatio(first);const makeFilm = useMutation({mutationFn: async () => {@@ -254,6 +280,8 @@ export function StoryboardView({ modelNames = {} }: { /** Display names of the sconst [refs, setRefs] = useState<SlotValue[]>([]);const [look, setLook] = useState<string | undefined>();const [lookStrength, setLookStrength] = useState(1);+ // Cloud only: a partner model for every frame instead of Fuobe's open recipe.+ const [partner, setPartner] = useState<StoryboardPartner | undefined>();const [open, setOpen] = useState<Generation | null>(null);const feed = useGenerations({ features: ["storyboard", "storyboard-film"], limit: 240 });const titles = useBoardTitles();@@ -280,11 +308,14 @@ export function StoryboardView({ modelNames = {} }: { /** Display names of the sconst flat = boards.flatMap((b) => [...b, ...(films.get(b[0].batchId ?? "") ?? [])].filter((g) => g.status === "succeeded" && g.outputs[0]));const pos = open ? flat.findIndex((g) => g.id === open.id) : -1;- const m = STORYBOARD_MODELS[engine as Engine];+ const boardPartner = engine === "cloud" ? partner : undefined;+ const m = storyboardModels(engine as Engine, boardPartner);+ const nextName = `${modelNames[m.next] ?? m.next}${m.nextLoras?.length ? " with the next-scene LoRA" : ""}`;const lookName = look ? lookCard(look)?.name : undefined;const filled = scenes.filter((s) => s.trim());const boardBody = {engine,+ ...(boardPartner && { partner: boardPartner }),...(mode === "auto" ? { story, frames: count } : { scenes: filled }),references: refs.filter((r) => r.ref && !r.uploading).map((r) => r.ref),style: style || undefined,@@ -353,11 +384,7 @@ export function StoryboardView({ modelNames = {} }: { /** Display names of the s<h2 className="font-heading text-display text-balance">Tell it frame by frame</h2><p className="mt-2 text-[13px] text-muted-foreground">Up to {MAX_FRAMES} consistent frames — each one is made from the previous frame, so faces, wardrobe and light carry through.- {lookName && !refs.length- ? ` Frame 1 on ${modelNames[STORYBOARD_LOOK_MODEL] ?? "Fuobe Soul"} in the ${lookName} look, then ${modelNames[m.next] ?? m.next}.`- : modelNames[m.next]- ? ` Runs on ${modelNames[m.next]}.`- : ""}+ {lookName && !refs.length ? ` Frame 1 on ${modelNames[STORYBOARD_LOOK_MODEL] ?? "Fuobe Soul"} in the ${lookName} look, then ${nextName}.` : ` Runs on ${nextName}.`}</p><div className="mt-6 rounded-[20px] border bg-background p-3 text-left shadow-soft focus-within:border-primary focus-within:ring-4 focus-within:ring-brand-faint sm:rounded-composer"><div role="radiogroup" aria-label="How to write it" className="mb-2 flex items-center gap-1 rounded-full bg-muted p-0.5 text-[13px] font-medium sm:w-fit">@@ -452,6 +479,7 @@ export function StoryboardView({ modelNames = {} }: { /** Display names of the s)}<LookChip value={look} strength={lookStrength} onChange={(id) => setLook(id)} onStrength={setLookStrength} none="No look" /><RatioPill value={aspect} onChange={setAspect} />+ {engine === "cloud" && <PartnerPill value={partner} onChange={setPartner} names={modelNames} />}<div className="ml-auto flex shrink-0 items-center gap-2"><span className="text-right text-[12px] leading-tight tabular-nums text-muted-foreground" aria-live="polite">{estimate.isError ? (diff --git a/src/components/studio/soul-finish.ts b/src/components/studio/soul-finish.tsindex f9a2b0eb..63e588d5 100644--- a/src/components/studio/soul-finish.ts+++ b/src/components/studio/soul-finish.ts@@ -77,6 +77,11 @@ 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"));}+/** The browser stopped trying to finish this result (no WebGL, a picture that won't load): it stays as it was made. */+export function finishGaveUp(g: Generation): boolean {+ return outputsToFinish(g).some((i) => (failed.get(`${g.id}:${i}`)?.tries ?? 0) >= MAX_TRIES);+}+/*** 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"]).diff --git a/src/lib/catalog/lora-library.generated.ts b/src/lib/catalog/lora-library.generated.tsindex 7a788e28..7a49485e 100644--- a/src/lib/catalog/lora-library.generated.ts+++ b/src/lib/catalog/lora-library.generated.ts@@ -3126,6 +3126,30 @@ export const LORA_LIBRARY: LoraEntry[] = ["released": "2026-07-15","hostedEndpoint": "fal-ai/flux-2/klein/4b/edit/lora","notes": "Rank-32 edit LoRA trained by xocialize with ai-toolkit on FLUX.2-klein-base-4B (Apache-2.0); card licence apache-2.0, so fal may host it (build plan O10's check). Three ordered inputs: person, top (or a dress / whole outfit), bottom; trigger TRYON. Trained on clothing-agnostic people: the open graph greys the old outfit out first (ClothesSegment), the hosted route sends the photo as it is (quality unmeasured until the eval harness runs the fashion suite)."+ },+ {+ "key": "next-scene-qwen-edit-2509",+ "name": "Next Scene for Qwen-Image-Edit 2509 (lovis93)",+ "file": "next-scene_lora-v2-3000.safetensors",+ "url": "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509/resolve/9b9da698b8a5370efd875f18b1727cc1119f3863/next-scene_lora-v2-3000.safetensors",+ "page": "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509",+ "strength": 0.75,+ "base": "qwen-image-edit-2509",+ "download": "direct",+ "group": "adapter",+ "trigger": "Next Scene:",+ "version": "9b9da698b8a5370efd875f18b1727cc1119f3863",+ "sha256": "8abf2306649a62282f89968515097650acaf7b040687c9b6c56e37558e6df9e1",+ "sizeBytes": 295146176,+ "licence": {+ "commercial": true,+ "hostedOk": true,+ "snapshotDate": "2026-10-29",+ "name": "MIT"+ },+ "released": "2025-10-21",+ "hostedEndpoint": "fal-ai/qwen-image-edit-plus-lora",+ "notes": "The v2 next-scene LoRA the GPU's storyboard-qwen-edit-2509-next-scene graph loads (at 0.75), so a cloud board's next frames run the same recipe on fal's hosted Qwen-Image-Edit 2509 (loras: [{path, scale}], up to 3; $0.035 per megapixel). Card licence MIT, base Qwen/Qwen-Image-Edit-2509 (Apache-2.0); a prompt starting \"Next Scene:\" continues the previous panel (image 1) with a new shot. Pinned 2026-10-29 from the Hugging Face API (repo head, the file's LFS SHA256 and size)."}];diff --git a/src/lib/catalog/storyboard.ts b/src/lib/catalog/storyboard.tsindex 3b39c407..e9a68b75 100644--- a/src/lib/catalog/storyboard.ts+++ b/src/lib/catalog/storyboard.ts@@ -8,18 +8,48 @@* model, with the look's words), the next frames carry the look's words, and every frame gets the* look's grade and overlay after it is made (each next frame is made from the previous one as it* came out, so the grade is applied once).+ *+ * The board is Fuobe's open recipe on both engines: Qwen-Image-Edit 2509 + the next-scene LoRA makes each next frame+ * on your GPU (a graph that loads it) and on fal's hosted Qwen-Image-Edit 2509 (the LoRA sent as a URL). Nano Banana+ * Pro stays a separate choice in the cloud (`partner`), every frame on it as boards ran before.*/-import type { ChainSlot, Engine, GenerationRequest } from "./types";+import { loraEntry, loraRef } from "./loras";+import type { ChainSlot, Engine, GenerationRequest, LoraRef } from "./types";export const MAX_FRAMES = 8;-/** Which models make the first frame and the follow-ups on each engine. */-export const STORYBOARD_MODELS: Record<Engine, { first: string; firstWithRefs: string; next: string; chainFrom: "first" | "last" }> = {- cloud: { first: "nano-banana-pro", firstWithRefs: "nano-banana-pro", next: "nano-banana-pro", chainFrom: "last" },+export interface StoryboardModels {+ first: string;+ firstWithRefs: string;+ next: string;+ chainFrom: "first" | "last";+ /** LoRAs each next frame carries (the cloud's next-scene LoRA; the GPU graph loads its own). */+ nextLoras?: LoraRef[];+}++/** The next-scene LoRA (research adapterLoras): the one the GPU graph loads, at its strength. */+const NEXT_SCENE = loraEntry("next-scene-qwen-edit-2509");++/** Which models make the first frame and the follow-ups on each engine (Fuobe's recipe). */+export const STORYBOARD_MODELS: Record<Engine, StoryboardModels> = {+ // Hosted open weights: Z-Image Turbo, Qwen-Image-Edit 2511 with references, then Qwen-Image-Edit 2509 + next-scene.+ cloud: { first: "z-image-turbo-cloud", firstWithRefs: "qwen-image-edit-2511-cloud", next: "qwen-image-edit-2509-cloud", chainFrom: "first", ...(NEXT_SCENE && { nextLoras: [loraRef(NEXT_SCENE)] }) },// Qwen-Image-Edit + the next-scene LoRA takes the previous panel as image 1 and the character as image 2.open: { first: "oss-z-image-turbo", firstWithRefs: "oss-qwen-edit", next: "oss-qwen-next-scene", chainFrom: "first" },};+/** Partner models a cloud board can run on instead (a separate choice): every frame on it, each from the last one. */+export const STORYBOARD_PARTNERS = {+ "nano-banana-pro": { first: "nano-banana-pro", firstWithRefs: "nano-banana-pro", next: "nano-banana-pro", chainFrom: "last" },+} as const satisfies Record<string, StoryboardModels>;+export type StoryboardPartner = keyof typeof STORYBOARD_PARTNERS;+export const STORYBOARD_PARTNER_IDS = Object.keys(STORYBOARD_PARTNERS) as [StoryboardPartner, ...StoryboardPartner[]];++/** The models a board runs on: the partner when one is picked in the cloud, else Fuobe's recipe for the engine. */+export function storyboardModels(engine: Engine, partner?: StoryboardPartner): StoryboardModels {+ return engine === "cloud" && partner ? STORYBOARD_PARTNERS[partner] : STORYBOARD_MODELS[engine];+}+/** The model a board with a Soul look makes its first frame on (no references): the look's LoRAs, words and grade. */export const STORYBOARD_LOOK_MODEL = "fuobe-soul";@@ -90,6 +120,8 @@ export interface StoryboardLook {export interface StoryboardPlanInput {engine: Engine;+ /** A partner model for the whole board (cloud only). */+ partner?: StoryboardPartner;scenes: string[];references?: string[];style?: string;@@ -106,7 +138,7 @@ export type FrameRequest = GenerationRequest & { batchTitle?: string };* picture as it came out (`raw`: before a look's grade, which every frame gets on its own).*/export function planStoryboard(input: StoryboardPlanInput): FrameRequest[] {- const m = STORYBOARD_MODELS[input.engine];+ const m = storyboardModels(input.engine, input.partner);const refs = (input.references ?? []).slice(0, 4);const look = input.look;const cropped = !!look && input.aspectRatio === LOOK_CROPPED;@@ -128,6 +160,7 @@ export function planStoryboard(input: StoryboardPlanInput): FrameRequest[] {prompt: framePrompt(scene, i, { refs: frameRefs.length, chainFrom: m.chainFrom, style: onSoul ? input.style : style }),inputs: frameRefs.length ? { images: frameRefs } : undefined,params,+ ...(!first && m.nextLoras?.length && { loras: m.nextLoras }),...(chain ? { chain } : !first && { chainFrom: m.chainFrom }),frame: { scene, index: i, of: input.scenes.length, ...(look && { look: look.id }), ...(cropped && { crop: LOOK_CROPPED }) },...(input.batchTitle && { batchTitle: input.batchTitle }),diff --git a/src/lib/storyboard-board.ts b/src/lib/storyboard-board.tsindex c3b9817d..d9f90335 100644--- a/src/lib/storyboard-board.ts+++ b/src/lib/storyboard-board.ts@@ -1,5 +1,6 @@/** Storyboard board helpers (pure): the title the user recognises and when a film can be made. */import type { Generation } from "./catalog/types";+import { finishSteps } from "./soul-post";/** Where the browser remembers the idea each board was made from (batchId → idea). */export const BOARD_TITLES_KEY = "fuobe:storyboard-titles";@@ -34,9 +35,13 @@ export function storyboardName(story: string | undefined, scenes: string[]): strreturn (story?.trim() || scenes.find((s) => s.trim()) || "Storyboard").trim().replace(/\s+/g, " ").slice(0, 200);}-/** A film needs every frame finished (and at least two of them). */-export function filmReady(frames: Generation[]): boolean {- return frames.length > 1 && frames.every((f) => f.status === "succeeded" && !!f.outputs[0]);+/**+ * A film needs every frame finished (and at least two of them), and a look board's frames finished in the browser too+ * (graded, cropped to 21:9): the film's shots start from the frames as they are then. `gaveUp`: a frame the browser+ * couldn't finish (no WebGL), which goes in as it was made rather than holding the film back for good.+ */+export function filmReady(frames: Generation[], gaveUp: (g: Generation) => boolean = () => false): boolean {+ return frames.length > 1 && frames.every((f) => f.status === "succeeded" && !!f.outputs[0] && (!finishSteps(f.outputs[0]) || gaveUp(f)));}/** Keep the newest `max` remembered titles. */diff --git a/src/server/assist/tools.ts b/src/server/assist/tools.tsindex 0a3e02ef..30e4c927 100644--- a/src/server/assist/tools.ts+++ b/src/server/assist/tools.ts@@ -13,13 +13,13 @@ import { loraFamily, runsSomewhere, TRAINING_FAMILIES } from "@/lib/catalog/traiimport type { ElementLora } from "@/lib/catalog/elements";import { createPipeline } from "../chains";import { listElements } from "../elements";-import { createGenerations, currentRequest, getGeneration, listGenerations, outputKind, previewChained, previewGeneration } from "../generations";+import { createGenerations, currentRequest, getGeneration, listGenerations, outputKind, previewChained } from "../generations";import { provider } from "../providers";import { llmBackends } from "../providers/llm";import { engineMode } from "../settings";import { readRef } from "../storage";import { katanaTool } from "../katana";-import { createStoryboard } from "../storyboard";+import { createStoryboard, estimateStoryboard } from "../storyboard";import { CONTEXT_TOOLS } from "./context-tools";import { defineTool, type JobPlace, type ResultContent, type ToolContext, type ToolDef, type ToolOutcome } from "./define";// Fills STUDIO_ROUTES with the studio modules (Layers, Shorts, dub, Faceless, Ads, Captions).@@ -500,10 +500,11 @@ const storyboard = defineTool({const engine = engineMode() === "both" ? ctx.engine : (engineMode() as "cloud" | "open");const m = STORYBOARD_MODELS[engine];const n = Math.max(1, Math.min(8, s.scenes?.length || s.frames || 4));- let one: ReturnType<typeof previewGeneration> | null = null;+ // Every frame priced on its own model (frame 1, then the next-frame model), as the Storyboard prices a board.+ let est: ReturnType<typeof estimateStoryboard> | null = null;let error: string | undefined;try {- one = previewGeneration({ feature: "storyboard", modelId: m.first, prompt: s.story || s.scenes?.[0] || "frame", params: { aspectRatio: s.aspect_ratio } });+ est = estimateStoryboard({ engine, story: s.story, scenes: s.scenes, frames: s.frames, references: s.references, style: s.style, aspectRatio: s.aspect_ratio });} catch (e) {error = (e as Error).message;}@@ -512,13 +513,13 @@ const storyboard = defineTool({{tool: "create_storyboard",modelId: m.first,- modelName: one?.model.name ?? m.first,+ modelName: est?.models.join(" + ") || m.first,kind: "image",op: "storyboard",prompt: s.story || (s.scenes ?? []).join(" / "),count: n,- costUsd: one?.costUsd === null || !one ? null : one.costUsd * n,- demo: one?.demo ?? false,+ costUsd: est ? est.costUsd : null,+ demo: est?.demo ?? false,error,},];diff --git a/src/server/storyboard.ts b/src/server/storyboard.tsindex dee82e57..054d7f12 100644--- a/src/server/storyboard.ts+++ b/src/server/storyboard.ts@@ -1,7 +1,7 @@import "server-only";import { nanoid } from "nanoid";import { z } from "zod";-import { heuristicScenes, MAX_FRAMES, parseScenes, planStoryboard, SPLIT_SYSTEM, type StoryboardLook } from "@/lib/catalog/storyboard";+import { heuristicScenes, MAX_FRAMES, parseScenes, planStoryboard, SPLIT_SYSTEM, STORYBOARD_PARTNER_IDS, type StoryboardLook, type StoryboardPartner } from "@/lib/catalog/storyboard";import { soulLook } from "@/lib/catalog/soul";import type { Engine, Generation, GenerationRequest } from "@/lib/catalog/types";import { storyboardName } from "@/lib/storyboard-board";@@ -13,6 +13,8 @@ import { createGenerations, listGenerations, previewChained } from "./generation/** The body of POST /api/storyboards and /api/storyboards/estimate. */export const StoryboardBodySchema = z.object({engine: z.enum(["cloud", "open"]),+ /** A partner model for every frame instead of Fuobe's open recipe (cloud only): "nano-banana-pro". */+ partner: z.enum(STORYBOARD_PARTNER_IDS).optional(),scenes: z.array(z.string().max(1000)).max(8).optional(),story: z.string().max(4000).optional(),frames: z.number().int().min(1).max(8).optional(),@@ -27,6 +29,8 @@ export const StoryboardBodySchema = z.object({export interface StoryboardRequest {engine: Engine;+ /** A partner model for the whole board (cloud only); unset: Fuobe's open recipe (Qwen-Image-Edit + next-scene). */+ partner?: StoryboardPartner;/** Manual: one prompt per frame. */scenes?: string[];/** Auto: one story, split into `frames`. */@@ -59,7 +63,7 @@ function boardLook(r: Pick<StoryboardRequest, "look" | "lookStrength">): Storyboexport function estimateStoryboard(r: StoryboardRequest): { costUsd: number | null; demo: boolean; frames: number; models: string[] } {const n = Math.max(1, Math.min(MAX_FRAMES, r.scenes?.filter((s) => s.trim()).length || r.frames || 4));const scenes = Array.from({ length: n }, (_, i) => r.scenes?.[i]?.trim() || `scene ${i + 1}`);- const frames = planStoryboard({ engine: r.engine, scenes, references: r.references, style: r.style, look: boardLook(r), aspectRatio: r.aspectRatio, resolution: r.resolution });+ const frames = planStoryboard({ engine: r.engine, partner: r.partner, scenes, references: r.references, style: r.style, look: boardLook(r), aspectRatio: r.aspectRatio, resolution: r.resolution });let cost: number | null = 0;let demo = false;const models: string[] = [];@@ -80,7 +84,7 @@ export async function createStoryboard(r: StoryboardRequest): Promise<{ batchId:const batchId = nanoid(10);// The board is named after the user's idea on every device (the Library's stack title too).const batchTitle = storyboardName(r.scenes?.length ? undefined : r.story, scenes);- const frames = planStoryboard({ engine: r.engine, scenes, references: r.references, style: r.style, look, aspectRatio: r.aspectRatio, resolution: r.resolution, batchTitle });+ const frames = planStoryboard({ engine: r.engine, partner: r.partner, scenes, references: r.references, style: r.style, look, aspectRatio: r.aspectRatio, resolution: r.resolution, batchTitle });const items: Generation[] = [];let previous: string | undefined;for (const request of frames) {@@ -106,7 +110,8 @@ export function createStoryboardFilm(batchId: string, opts: { modelId?: string }const filmBatch = `${batchId}-film`;// Boards made before the server stored a name fall back to the first scene.const batchTitle = (frames[0].request as { batchTitle?: string }).batchTitle?.trim() || frames[0].request.frame?.scene || "Storyboard film";- const aspectRatio = frames[0].request.params?.aspectRatio;+ // A 21:9 board in a look is made at 16:9 and cropped after (frame.crop): its film is 21:9, like its frames.+ const aspectRatio = frames[0].request.frame?.crop ?? frames[0].request.params?.aspectRatio;const n = frames.length;const clips = frames.map((f, i) => {const next = flf ? frames[i + 1] : undefined;diff --git a/tests/model-access-listings.test.ts b/tests/model-access-listings.test.tsindex dc55914d..d831d30e 100644--- a/tests/model-access-listings.test.ts+++ b/tests/model-access-listings.test.ts@@ -94,9 +94,11 @@ describe("Models & licences in listings and picks", () => {it("lists every model, LoRA and node pack with its licence, and flips switches through the settings API", async () => {const list = (await (await settingsRoute.GET()).json()) as import("@/lib/model-access").AccessList;expect(list.models.length).toBeGreaterThan(300);- // The library's 115 LoRAs (Fuobe Try-On's try-on LoRA among them), the preset LoRA map's files that aren't library- // files, and MiniMax H3's four (Akatz Labs' swap LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), each once.- expect(list.loras.length).toBe(171);+ // The library's 116 LoRAs (Fuobe Try-On's try-on LoRA and the Storyboard's next-scene LoRA among them), the preset+ // LoRA map's files that aren't library files, and MiniMax H3's four (Akatz Labs' swap LoRA V1.5 and V1 and Person+ // Remover V1, lightx2v's H3 Turbo), each once.+ expect(list.loras.length).toBe(172);+ expect(list.loras.find((l) => l.file === "next-scene_lora-v2-3000.safetensors")).toMatchObject({ group: "adapter", on: true, licence: { name: "MIT", class: "commercial" } });expect(list.loras.find((l) => l.file === "tryon-klein-4b.safetensors")).toMatchObject({ group: "adapter", on: true, licence: { name: "Apache-2.0", class: "commercial" } });expect(list.loras.find((l) => l.file === "h3_character_swap_v1.5.safetensors")).toMatchObject({ group: "adapter", base: "MiniMax H3", on: true, licence: { name: "MiniMax H3 Community License", class: "regions" } });expect(list.packs.find((p) => p.name === "h3_character_swap")).toMatchObject({ licence: { name: "GPL-3.0" }, on: true });diff --git a/tests/popcorn-looks.test.ts b/tests/popcorn-looks.test.tsindex 22cbfd66..bc8249c4 100644--- a/tests/popcorn-looks.test.ts+++ b/tests/popcorn-looks.test.ts@@ -3,6 +3,8 @@ import os from "node:os";import path from "node:path";import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";import { planStoryboard, STORYBOARD_LOOK_MODEL } from "@/lib/catalog/storyboard";+import { buildPayload } from "@/lib/catalog/payload";+import { filmReady } from "@/lib/storyboard-board";import { soulLook } from "@/lib/catalog/soul";import type { OutputFile } from "@/lib/catalog/types";@@ -16,7 +18,7 @@ process.env.OLLAMA_URL = "http://127.0.0.1:9";const { setSetting } = await import("@/server/settings");const gens = await import("@/server/generations");-const { createStoryboard, estimateStoryboard } = await import("@/server/storyboard");+const { createStoryboard, createStoryboardFilm, estimateStoryboard } = await import("@/server/storyboard");const estimateRoute = await import("@/app/api/storyboards/estimate/route");const { db } = await import("@/server/db");@@ -34,17 +36,49 @@ describe("Popcorn looks: the planner", () => {// The look's words come from Soul's recipe on frame 1, not twice.expect(frames[0].prompt).not.toContain(look.look.replace(/[.\s]+$/, ""));const next = frames[1];- expect(next.modelId).toBe(engine === "cloud" ? "nano-banana-pro" : "oss-qwen-next-scene");+ expect(next.modelId).toBe(engine === "cloud" ? "qwen-image-edit-2509-cloud" : "oss-qwen-next-scene");+ expect(next.prompt).toMatch(/^Next Scene: the bus arrives\./);expect(next.prompt).toContain(`Style: ${look.look.replace(/[.\s]+$/, "")}`);- expect(next.chain).toEqual([{ slot: "images", position: engine === "cloud" ? "last" : "first", raw: true }]);+ expect(next.chain).toEqual([{ slot: "images", position: "first", raw: true }]);expect(next.chainFrom).toBeUndefined();expect(next.frame).toMatchObject({ index: 1, of: 3, look: look.id });}});+ it("in the cloud the board is open weights end to end: hosted Z-Image Turbo, then Qwen-Image-Edit 2509 with the GPU graph's next-scene LoRA", () => {+ const frames = planStoryboard({ engine: "cloud", scenes, references: ["/api/files/hero.png", "/api/files/coat.png"] });+ expect(frames[0]).toMatchObject({ modelId: "qwen-image-edit-2511-cloud", inputs: { images: ["/api/files/hero.png", "/api/files/coat.png"] } });+ expect(planStoryboard({ engine: "cloud", scenes })[0].modelId).toBe("z-image-turbo-cloud");+ const next = frames[1];+ // The previous frame goes in first (chainFrom), the first reference after it, as on the GPU graph.+ expect(next).toMatchObject({ modelId: "qwen-image-edit-2509-cloud", chainFrom: "first", inputs: { images: ["/api/files/hero.png"] } });+ expect(next.prompt).toBe("Next Scene: the bus arrives.");+ expect(next.loras).toEqual([+ expect.objectContaining({+ file: "next-scene_lora-v2-3000.safetensors",+ strength: 0.75,+ url: "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509/resolve/9b9da698b8a5370efd875f18b1727cc1119f3863/next-scene_lora-v2-3000.safetensors",+ licence: expect.objectContaining({ name: "MIT", commercial: true }),+ }),+ ]);+ expect(frames[0].loras).toBeUndefined();+ // The GPU graph loads the LoRA itself.+ expect(planStoryboard({ engine: "open", scenes })[1].loras).toBeUndefined();+ });++ it("Nano Banana Pro stays a separate choice in the cloud: every frame on it, each from the last one, no LoRA", () => {+ const frames = planStoryboard({ engine: "cloud", partner: "nano-banana-pro", scenes, references: ["/api/files/hero.png"] });+ expect(frames.map((f) => f.modelId)).toEqual(["nano-banana-pro", "nano-banana-pro", "nano-banana-pro"]);+ expect(frames[1]).toMatchObject({ chainFrom: "last", inputs: { images: ["/api/files/hero.png"] } });+ expect(frames.every((f) => !f.loras)).toBe(true);+ // With a look, frame 1 is still the look's Fuobe Soul picture; the GPU has no partner.+ expect(planStoryboard({ engine: "cloud", partner: "nano-banana-pro", scenes, look: { id: look.id, words: look.look } })[0].modelId).toBe(STORYBOARD_LOOK_MODEL);+ expect(planStoryboard({ engine: "open", partner: "nano-banana-pro", scenes })[1].modelId).toBe("oss-qwen-next-scene");+ });+it("with references, frame 1 stays on the reference model with the look's words, and still gets the look's finish", () => {const [first] = planStoryboard({ engine: "cloud", scenes, references: ["/api/files/hero.png"], style: "35mm", look: { id: look.id, words: look.look } });- expect(first).toMatchObject({ modelId: "nano-banana-pro", inputs: { images: ["/api/files/hero.png"] }, frame: { look: look.id } });+ expect(first).toMatchObject({ modelId: "qwen-image-edit-2511-cloud", inputs: { images: ["/api/files/hero.png"] }, frame: { look: look.id } });expect(first.presetId).toBeUndefined();expect(first.prompt).toContain(`Style: 35mm. ${look.look.replace(/[.\s]+$/, "")}`);});@@ -72,7 +106,7 @@ describe("Popcorn looks: boards (demo)", () => {it("every frame carries the look's finish as meta; a next frame is made from the frame before as it came out", async () => {const board = await createStoryboard({ engine: "cloud", scenes, look: look.id, aspectRatio: "21:9" });- expect(board.items.map((g) => g.modelId)).toEqual(["fuobe-soul", "nano-banana-pro", "nano-banana-pro"]);+ expect(board.items.map((g) => g.modelId)).toEqual(["fuobe-soul", "qwen-image-edit-2509-cloud", "qwen-image-edit-2509-cloud"]);const first = await settle(board.items[0].id);expect(first.status).toBe("succeeded");expect(first.outputs[0].meta).toMatchObject({ look: look.id, overlay: "date-stamp", crop: "21:9", ...(look.grade && { grade: look.grade }) });@@ -81,9 +115,44 @@ describe("Popcorn looks: boards (demo)", () => {db().prepare("UPDATE generations SET outputs_json = ? WHERE id = ?").run(JSON.stringify(finished), first.id);const second = await settle(board.items[1].id);expect(second.status).toBe("succeeded");- expect(second.request.inputs?.images?.at(-1)).toBe(first.outputs[0].url);+ expect(second.request.inputs?.images?.[0]).toBe(first.outputs[0].url);+ expect(second.request.loras?.map((l) => l.file)).toEqual(["next-scene_lora-v2-3000.safetensors"]);expect(second.outputs[0].meta).toMatchObject({ look: look.id, overlay: "date-stamp", crop: "21:9" });- await settle(board.items[2].id);+ const third = await settle(board.items[2].id);++ // The film waits for the browser's finish, and a 21:9 look board's film is 21:9 like its frames.+ const frames = [gens.getGeneration(first.id)!, second, third];+ expect(filmReady(frames)).toBe(false);+ expect(filmReady(frames, (g) => g.id !== first.id)).toBe(true);+ for (const g of [second, third]) {+ const done: OutputFile[] = g.outputs.map((o) => ({ ...o, url: `/api/files/${g.id}-finished.png`, meta: { ...o.meta, finished: true, original: o.url } }));+ db().prepare("UPDATE generations SET outputs_json = ? WHERE id = ?").run(JSON.stringify(done), g.id);+ }+ expect(filmReady(board.items.map((g) => gens.getGeneration(g.id)!))).toBe(true);+ const film = createStoryboardFilm(board.batchId);+ const shots = film.items.filter((g) => g.op !== "concat");+ expect(shots.length).toBe(3);+ expect(shots.every((g) => g.request.params?.aspectRatio === "21:9")).toBe(true);+ for (const g of film.items) await settle(g.id);+ });++ it("the next frame's hosted route sends the next-scene LoRA as a URL at its strength", async () => {+ setSetting("falKey", "fal-test-key");+ try {+ const [, next] = planStoryboard({ engine: "cloud", scenes });+ const p = gens.previewChained(next, 1);+ expect(p).toMatchObject({ demo: false, route: { provider: "fal", endpoint: "fal-ai/qwen-image-edit-plus-lora" } });+ expect(p.loras.applied.map((l) => l.file)).toEqual(["next-scene_lora-v2-3000.safetensors"]);+ const route = p.model.routes.find((r) => r.provider === "fal")!;+ const body = buildPayload(route.map!, { prompt: p.prompt, images: ["https://x/prev.png"], aspectRatio: "16:9", loras: p.loras.applied });+ expect(body).toMatchObject({+ prompt: "Next Scene: the bus arrives.",+ image_urls: ["https://x/prev.png"],+ loras: [{ path: "https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509/resolve/9b9da698b8a5370efd875f18b1727cc1119f3863/next-scene_lora-v2-3000.safetensors", scale: 0.75 }],+ });+ } finally {+ setSetting("falKey", "");+ }});it("a raw slot takes the picture before its finish; any other slot the finished one", async () => {@@ -97,13 +166,17 @@ describe("Popcorn looks: boards (demo)", () => {setSetting("falKey", "fal-test-key");try {const e = estimateStoryboard({ engine: "cloud", frames: 4, look: look.id });- expect(e).toMatchObject({ frames: 4, demo: false, models: ["Fuobe Soul", "Nano Banana Pro"] });- // Three Nano Banana Pro edits at $0.15, and Fuobe Soul's picture at about a cent.- expect(e.costUsd).toBeGreaterThan(0.45);- expect(e.costUsd).toBeLessThan(0.5);+ expect(e).toMatchObject({ frames: 4, demo: false, models: ["Fuobe Soul", "Qwen-Image-Edit 2509 (hosted)"] });+ // Fuobe Soul's picture at about a cent, then three hosted Qwen-Image-Edit 2509 edits at $0.035 a megapixel.+ expect(e.costUsd).toBeGreaterThan(0.05);+ expect(e.costUsd).toBeLessThan(0.2);const plain = estimateStoryboard({ engine: "cloud", frames: 4 });- expect(plain.models).toEqual(["Nano Banana Pro"]);- expect(plain.costUsd).toBeCloseTo(0.6, 3);+ expect(plain.models).toEqual(["Z-Image Turbo (hosted)", "Qwen-Image-Edit 2509 (hosted)"]);+ expect(plain.costUsd).toBeLessThan(0.2);+ // The partner board as boards ran before: four Nano Banana Pro pictures at $0.15.+ const partner = estimateStoryboard({ engine: "cloud", frames: 4, partner: "nano-banana-pro" });+ expect(partner.models).toEqual(["Nano Banana Pro"]);+ expect(partner.costUsd).toBeCloseTo(0.6, 3);} finally {setSetting("falKey", "");}