Skip to content

armgit / fuobe

Public Imported from GitHub
0

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.

Camera angles: QMA · 96 views in Angles, Cinema, the turnaround and the Canvas

Claude80125c17e0ee
diff --git a/src/components/cinema/soul-builders.tsx b/src/components/cinema/soul-builders.tsx
index 4c269a68..f523a45a 100644
--- a/src/components/cinema/soul-builders.tsx
+++ b/src/components/cinema/soul-builders.tsx
@@ -8,6 +8,7 @@ import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Slider } from "@/components/ui/slider";
+import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";
import { useSoulFinish } from "@/components/studio/soul-finish";
import { TurnaroundButton } from "@/components/turnaround/turnaround-dialog";
@@ -35,6 +36,7 @@ import {
import { soulLook } from "@/lib/catalog/soul";
import { sheetPictures } from "@/lib/catalog/turnaround";
import { finishedUrl } from "@/lib/soul-post";
+import { QMA_MODEL } from "@/lib/qma";
import type { Engine, Generation } from "@/lib/catalog/types";
import { formatCost } from "@/lib/format";
import { cn } from "@/lib/utils";
@@ -392,6 +394,9 @@ function SoulLocation({ projectId, folderId, engine, settings, context, brief, o
const [prompt, setPrompt] = useState("");
const [batch, setBatch] = useState(2);
const [picked, setPicked] = useState<string[]>([]);
+ // Other views on your GPU: the Multiple-Angles default, or QMA · 96 views (qma-angles), when this install offers it.
+ const [qma, setQma] = useState(false);
+ const qmaOffered = engine === "open" && !!getModel(QMA_MODEL);
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 };
@@ -400,7 +405,7 @@ function SoulLocation({ projectId, folderId, engine, settings, context, brief, o
const run = (extra?: { view: string; url: string }) =>
generate.mutate(
{
- input: extra ? { ...input, action: "location-view", view: extra.view, source: { url: extra.url, kind: "image" }, batch: 1 } : input,
+ input: extra ? { ...input, action: "location-view", view: extra.view, source: { url: extra.url, kind: "image" }, batch: 1, ...(qma && qmaOffered && { modelId: QMA_MODEL }) } : input,
folderId,
},
{
@@ -459,6 +464,12 @@ function SoulLocation({ projectId, folderId, engine, settings, context, brief, o
{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>
+ {qmaOffered && (
+ <label className="mr-1 inline-flex items-center gap-1.5 text-[12px] text-muted-foreground">
+ <Switch checked={qma} onCheckedChange={setQma} aria-label="Use QMA · 96 views, on your GPU" />
+ QMA · 96 views
+ </label>
+ )}
{LOCATION_VIEWS.map((v) => (
<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}
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index 1aa80581..e2458760 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -1,5 +1,6 @@
"use client";
+import { OrbitPad, orbitOptions } from "@/components/studio/orbit-pad";
import { ArrowUp, AtSign, Cloud, Cpu, GalleryHorizontalEnd, LayoutDashboard, Loader2, Sparkles, X } from "lucide-react";
import dynamic from "next/dynamic";
import Link from "next/link";
@@ -810,6 +811,11 @@ export function Composer({ docked }: { docked: boolean }) {
const effectiveOp = studioOp ?? op;
// Qwen-Image 2.1's Options → GPU on Small: what the small encoder can't do (or that a speed with its own graph wins).
const smallGpuNote = qwen21Note(opts.controls, p.extra, effectiveOp);
+ // A setting an app's choices already set (the Angles app's angle, height and distance on QMA · 96 views) isn't asked twice.
+ const presetSets = new Set((preset?.options ?? []).flatMap((o) => o.choices.flatMap((c) => Object.keys(c.extra ?? {}))));
+ const shownControls = (opts.controls ?? []).filter((c) => !presetSets.has(c.param));
+ // The Angles app's camera: an orbit pad beside its chips.
+ const orbit = orbitOptions(preset?.options);
// SDR to HDR, Export: every format the studio's models on this engine write; picking one this model doesn't
// write moves the request to the model that does (EXR frames → LTX 2.3 HDR on the cloud).
const engineModels = useMemo(() => models.filter((m) => m.engine === (model?.engine ?? engine)), [models, model?.engine, engine]);
@@ -1099,7 +1105,7 @@ export function Composer({ docked }: { docked: boolean }) {
onStrength={(v) => setDraft({ presetStrength: v })}
/>
)}
- {opts.controls && <ControlsChip controls={opts.controls} values={p.extra ?? {}} onChange={setExtra} title={config.controlsTitle} op={effectiveOp} />}
+ {shownControls.length > 0 && <ControlsChip controls={shownControls} values={p.extra ?? {}} onChange={setExtra} title={config.controlsTitle} op={effectiveOp} />}
</>
);
const hasSecondary =
@@ -1321,6 +1327,7 @@ export function Composer({ docked }: { docked: boolean }) {
{/* Preset options (apps) */}
{preset?.options?.length ? (
<div className="flex flex-wrap gap-3 px-1.5 pb-2">
+ {orbit && <OrbitPad options={orbit} values={draft.presetOptions} onChange={(next) => setDraft({ presetOptions: next })} />}
{preset.options.map((o) => (
<div key={o.key} role="radiogroup" aria-label={o.label} onKeyDown={radioKeys} className="flex flex-wrap items-center gap-1">
<span className="mr-1 text-[12px] text-muted-foreground">{o.label}</span>
diff --git a/src/components/studio/orbit-pad.tsx b/src/components/studio/orbit-pad.tsx
new file mode 100644
index 00000000..eb74e8ac
--- /dev/null
+++ b/src/components/studio/orbit-pad.tsx
@@ -0,0 +1,128 @@
+"use client";
+
+import { useRef, useState, type KeyboardEvent, type PointerEvent } from "react";
+import type { PresetOption } from "@/lib/catalog/types";
+import { orbitDrag, qmaLabel, qmaPose, qmaView, QMA_ELEVATIONS, QMA_PARAMS } from "@/lib/qma";
+import type { ScenePose } from "@/lib/scene3d";
+import { cn } from "@/lib/utils";
+
+/**
+ * The Angles app's orbit pad (qma-angles): drag round the ring to swing the camera, up and down to raise or lower it. It
+ * snaps to the nearest of the app's views (QMA's 96: 8 sides, 4 heights, 3 distances) and sets the same choices as the chips
+ * beside it, so both always agree.
+ */
+
+type Keys = { angle: PresetOption; height: PresetOption; distance: PresetOption };
+
+/** The app's three camera options, when it has them (choices that set horizontal_angle, vertical_angle and zoom). */
+export function orbitOptions(options: PresetOption[] | undefined): Keys | undefined {
+ const by = (param: string) => options?.find((o) => o.choices.length > 0 && o.choices.every((c) => typeof c.extra?.[param] === "number"));
+ const angle = by(QMA_PARAMS.horizontal);
+ const height = by(QMA_PARAMS.vertical);
+ const distance = by(QMA_PARAMS.zoom);
+ return angle && height && distance ? { angle, height, distance } : undefined;
+}
+
+const chosen = (o: PresetOption, values: Record<string, string>) => o.choices.find((c) => c.value === (values[o.key] ?? o.default ?? o.choices[0]?.value)) ?? o.choices[0];
+
+/** The choice of an option whose setting is nearest a value. */
+function nearest(o: PresetOption, param: string, v: number): string {
+ return o.choices.reduce((best, c) => (Math.abs(Number(c.extra?.[param]) - v) < Math.abs(Number(best.extra?.[param]) - v) ? c : best)).value;
+}
+
+export function OrbitPad({ options, values, onChange }: { options: Keys; values: Record<string, string>; onChange: (next: Record<string, string>) => void }) {
+ const pose: ScenePose = {
+ horizontal: Number(chosen(options.angle, values).extra?.[QMA_PARAMS.horizontal] ?? 0),
+ vertical: Number(chosen(options.height, values).extra?.[QMA_PARAMS.vertical] ?? 0),
+ zoom: Number(chosen(options.distance, values).extra?.[QMA_PARAMS.zoom] ?? 5),
+ };
+ const view = qmaView(pose);
+ const drag = useRef<{ x: number; y: number; from: ScenePose; size: number } | null>(null);
+ const [live, setLive] = useState<ScenePose | null>(null);
+
+ const set = (p: ScenePose) => {
+ const snapped = qmaPose(qmaView(p));
+ // The ring wraps: 315° is as near 360° as 0° is far, so the angle compares on the circle.
+ const h = snapped.horizontal;
+ const angle = options.angle.choices.find((c) => Number(c.extra?.[QMA_PARAMS.horizontal]) % 360 === h)?.value ?? nearest(options.angle, QMA_PARAMS.horizontal, h);
+ const next = { ...values, [options.angle.key]: angle, [options.height.key]: nearest(options.height, QMA_PARAMS.vertical, snapped.vertical), [options.distance.key]: nearest(options.distance, QMA_PARAMS.zoom, snapped.zoom) };
+ if (Object.keys(next).some((k) => next[k] !== values[k])) onChange(next);
+ };
+ const down = (e: PointerEvent<HTMLDivElement>) => {
+ e.currentTarget.setPointerCapture(e.pointerId);
+ drag.current = { x: e.clientX, y: e.clientY, from: pose, size: e.currentTarget.getBoundingClientRect().width };
+ setLive(pose);
+ };
+ const move = (e: PointerEvent<HTMLDivElement>) => {
+ const d = drag.current;
+ if (!d) return;
+ const p = orbitDrag(d.from, e.clientX - d.x, e.clientY - d.y, d.size);
+ setLive(p);
+ set(p);
+ };
+ const up = () => {
+ drag.current = null;
+ setLive(null);
+ };
+ const key = (e: KeyboardEvent<HTMLDivElement>) => {
+ const step: Record<string, Partial<ScenePose>> = {
+ ArrowRight: { horizontal: pose.horizontal + 45 },
+ ArrowLeft: { horizontal: pose.horizontal - 45 },
+ ArrowUp: { vertical: pose.vertical + 30 },
+ ArrowDown: { vertical: pose.vertical - 30 },
+ };
+ if (!step[e.key]) return;
+ e.preventDefault();
+ set({ ...pose, ...step[e.key] });
+ };
+
+ // Seen from above: the subject in the middle, the photo's camera at the bottom, swinging right goes round to the right.
+ const shown = live ?? qmaPose(view);
+ const rad = (shown.horizontal * Math.PI) / 180;
+ const r = 34;
+ const cx = 44 + Math.sin(rad) * r;
+ const cy = 44 + Math.cos(rad) * r;
+ const level = QMA_ELEVATIONS.indexOf(view.elevation);
+ const label = qmaLabel(view);
+ return (
+ <div className="flex items-center gap-3">
+ <div
+ role="slider"
+ tabIndex={0}
+ aria-label="Camera orbit: drag to swing the camera round and up or down; arrow keys move it one view"
+ aria-valuemin={0}
+ aria-valuemax={315}
+ aria-valuenow={qmaPose(view).horizontal}
+ aria-valuetext={label}
+ onPointerDown={down}
+ onPointerMove={move}
+ onPointerUp={up}
+ onPointerCancel={up}
+ onKeyDown={key}
+ className="relative size-[88px] shrink-0 cursor-grab touch-none rounded-full border bg-muted/50 outline-none select-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing"
+ >
+ <svg viewBox="0 0 88 88" className="size-full" aria-hidden>
+ <circle cx="44" cy="44" r={r} className="fill-none stroke-border" strokeDasharray="2 3" />
+ {Array.from({ length: 8 }, (_, i) => {
+ const a = (i * 45 * Math.PI) / 180;
+ return <circle key={i} cx={44 + Math.sin(a) * r} cy={44 + Math.cos(a) * r} r="1.6" className="fill-muted-foreground/50" />;
+ })}
+ <rect x="38" y="38" width="12" height="12" rx="3" className="fill-foreground/70" />
+ <line x1={cx} y1={cy} x2="44" y2="44" className="stroke-primary" strokeWidth="1.2" />
+ <circle cx={cx} cy={cy} r="6" className="fill-primary" />
+ </svg>
+ </div>
+ <div className="flex items-center gap-2">
+ <div className="flex h-[60px] flex-col-reverse justify-between" aria-hidden>
+ {QMA_ELEVATIONS.map((e, i) => (
+ <span key={e} className={cn("h-1.5 w-4 rounded-full", i === level ? "bg-primary" : "bg-muted-foreground/25")} />
+ ))}
+ </div>
+ <p className="max-w-[9rem] text-[12px] leading-snug text-muted-foreground" aria-live="polite">
+ <span className="block font-medium text-foreground">{label.split(" · ")[0]}</span>
+ {label.split(" · ").slice(1).join(" · ")}
+ </p>
+ </div>
+ </div>
+ );
+}
diff --git a/src/components/turnaround/turnaround-dialog.tsx b/src/components/turnaround/turnaround-dialog.tsx
index 454d2d69..3765be7e 100644
--- a/src/components/turnaround/turnaround-dialog.tsx
+++ b/src/components/turnaround/turnaround-dialog.tsx
@@ -16,6 +16,7 @@ import { Switch } from "@/components/ui/switch";
import { useEngine, useGenerations } from "@/lib/api";
import { SOUL_ID_COPY } from "@/lib/catalog/training";
import {
+ FILL_NAMES,
SIDE_NAMES,
SIDES_HINT,
TURN_PATHS,
@@ -24,6 +25,7 @@ import {
elementPictures,
startingViews,
type TurnPicture,
+ type TurnFill,
type TurnRoute,
type TurnSide,
type TurnaroundPreview,
@@ -40,6 +42,7 @@ export interface TurnaroundBody {
sheet?: string;
route?: TurnRoute;
fill?: boolean;
+ fillWith?: TurnFill;
path?: string;
duration?: number;
aspectRatio?: "9:16" | "16:9";
@@ -163,6 +166,7 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
const [views, setViews] = useState<Partial<Record<TurnSide, string>>>(start.views);
const [sheet, setSheet] = useState<string | undefined>(start.sheet);
const [fill, setFill] = useState<boolean | undefined>(undefined);
+ const [fillWith, setFillWith] = useState<TurnFill>("angles");
// The route and length picked hold for the engine they were picked on: another engine starts from its own defaults.
const [picked, setPicked] = useState<{ engine: Engine; route?: TurnRoute; duration?: number }>({ engine });
const route = picked.engine === engine ? picked.route : undefined;
@@ -182,6 +186,7 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
...(sheet && { sheet }),
...(route && { route }),
...(fill !== undefined && { fill }),
+ ...(engine === "open" && fillWith !== "angles" && { fillWith }),
...(path && { path }),
...(duration && { duration }),
aspectRatio,
@@ -209,6 +214,9 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
const usedRoute = p?.route ?? route;
const camera = usedRoute === "camera";
+ const stills = usedRoute === "stills";
+ // QMA · 96 views is offered on your GPU when this install has it (its Stills route is listed then).
+ const qmaHere = engine === "open" && !!p?.routes.includes("stills");
const slotUrl = (k: SlotKey) => (k === "sheet" ? sheet : views[k]);
const setSlot = (k: SlotKey, url: string | undefined) => {
if (k === "sheet") setSheet(url);
@@ -292,7 +300,7 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
);
})}
</div>
- {!camera && (
+ {!camera && !stills && (
<label className="flex items-center justify-between gap-3 rounded-xl border px-3 py-2">
<span className="min-w-0">
<span className="block text-[13px] font-medium">Draw the missing sides</span>
@@ -301,6 +309,15 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
<Switch checked={p?.fill ?? fill ?? true} onCheckedChange={(v) => setFill(v)} aria-label="Draw the missing sides" />
</label>
)}
+ {qmaHere && !camera && !stills && (p?.fill ?? fill ?? true) && (
+ <Chips
+ label="Drawn with"
+ value={fillWith}
+ options={(Object.keys(FILL_NAMES) as TurnFill[]).map((k) => ({ value: k, label: FILL_NAMES[k] }))}
+ onChange={(v) => setFillWith(v as TurnFill)}
+ hint={fillWith === "qma" ? "Turns the camera round the front view on your GPU, one of 96 set angles" : undefined}
+ />
+ )}
</section>
{p && p.routes.length > 1 && (
@@ -309,8 +326,8 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
{p && p.routes.length === 1 && usedRoute && <p className="text-[12px] text-muted-foreground">{TURN_ROUTES[usedRoute].detail}.</p>}
{camera && <Chips label="Path" value={path ?? TURN_PATHS[0].id} options={TURN_PATHS.map((x) => ({ value: x.id, label: x.name }))} onChange={setPath} hint={TURN_PATHS.find((x) => x.id === (path ?? TURN_PATHS[0].id))?.description} />}
<div className="flex flex-wrap gap-x-6 gap-y-3">
- {p && <Chips label="Length" value={String(p.duration)} options={p.durations.map((d) => ({ value: String(d), label: `${d} s` }))} onChange={(v) => setDuration(Number(v))} />}
- {!camera && (
+ {p && p.durations.length > 0 && <Chips label="Length" value={String(p.duration)} options={p.durations.map((d) => ({ value: String(d), label: `${d} s` }))} onChange={(v) => setDuration(Number(v))} />}
+ {!camera && !stills && (
<Chips
label="Shape"
value={aspectRatio}
@@ -377,7 +394,7 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
{preview.isFetching && !p ? "Pricing…" : price}
</span>
<Button onClick={makeIt} disabled={!p || !!p.blocker || preview.isError || make.isPending || preview.isFetching}>
- {make.isPending ? <Loader2 className="animate-spin" /> : <Rotate3d />} {flyAround ? "Fly around" : "Make turnaround"}
+ {make.isPending ? <Loader2 className="animate-spin" /> : <Rotate3d />} {stills ? "Make 8 views" : flyAround ? "Fly around" : "Make turnaround"}
</Button>
</div>
</>
@@ -439,13 +456,24 @@ export function useCharacterPictures(urls: string[]): TurnPicture[] {
/** A run's progress, then the finished turnaround. */
function RunView({ heading, state, elementId, onAgain }: { heading: string; state: ReturnType<typeof useRunState>; elementId?: string; onAgain: () => void }) {
const { video, failed, done, total, working } = state;
+ // A still set (Stills · 8 views): its pictures once every one is drawn.
+ const pictures = !video && total > 0 && done === total ? state.rows.flatMap((g) => g.outputs.filter((o) => o.kind === "image")) : [];
return (
<>
<DialogHeader>
<DialogTitle className="font-heading text-[24px] font-normal">{heading}</DialogTitle>
- <DialogDescription>{video ? "Your turnaround is ready." : failed ? "A step didn't finish." : "Making it now: you can close this, it carries on."}</DialogDescription>
+ <DialogDescription>{pictures.length ? "Your views are ready." : video ? "Your turnaround is ready." : failed ? "A step didn't finish." : "Making it now: you can close this, it carries on."}</DialogDescription>
</DialogHeader>
- {video ? (
+ {pictures.length > 0 ? (
+ <div className="grid grid-cols-3 gap-1.5 sm:grid-cols-4">
+ {pictures.map((o) => (
+ <a key={o.url} href={o.url} target="_blank" rel="noreferrer" className="overflow-hidden rounded-lg bg-muted">
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img src={o.url} alt="" className="aspect-[3/4] w-full object-cover" />
+ </a>
+ ))}
+ </div>
+ ) : video ? (
<video src={video.url} controls loop playsInline autoPlay muted className="max-h-[60svh] w-full rounded-xl bg-black object-contain" aria-label={`${heading}, the video`} />
) : failed ? (
<p role="alert" className="rounded-xl border border-destructive/40 p-3 text-[13px] text-destructive">
diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.ts
index 5c0c7960..4c7df384 100644
--- a/src/lib/catalog/apps.ts
+++ b/src/lib/catalog/apps.ts
@@ -1,3 +1,4 @@
+import { QMA_MODEL } from "@/lib/qma";
import { ANGLES_2511_LORA } from "./open-tools";
import { CAST_LOOK } from "./soul-cards";
import type { InputSlot, Preset, PresetOption, PresetRoute } from "./types";
@@ -71,6 +72,7 @@ type AppSpec = {
placeholder?: string;
cloud?: Partial<PresetRoute> | null;
open?: Partial<PresetRoute> | null;
+ openAlso?: PresetRoute[];
badges?: Preset["badges"];
parity?: string;
tool?: Preset["tool"];
@@ -101,6 +103,7 @@ function app(a: AppSpec): Preset {
promptPlaceholder: a.placeholder,
cloud: cloud as PresetRoute | null,
open: open as PresetRoute | null,
+ ...(a.openAlso?.length && { openAlso: a.openAlso }),
parity: a.parity,
...(a.tool && { tool: a.tool }),
};
@@ -320,6 +323,9 @@ export const APPS: Preset[] = [
loras: [ANGLES_2511_LORA],
promptTemplate: "<sks> {option:angle} {option:height} {option:distance}. {prompt}",
},
+ // QMA · 96 views (qma-angles): Qwen-Image 2.1 with the QMA LoRA, on your GPU only (fal's Qwen-Image 2.1 takes no LoRAs).
+ // The choices' angles (horizontal_angle, vertical_angle, zoom) become its words in the plan, the note after them.
+ openAlso: [{ modelId: QMA_MODEL, op: "edit", promptTemplate: "{prompt}" }],
}),
app({
name: "Fuobe Angles",
diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.ts
index 5005d036..a83a31cd 100644
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@ -9,6 +9,7 @@
*/
import type { CanvasComment, CanvasGroup, CanvasPage, CanvasShape } from "./canvas-board";
import { EXAMPLE_SCENE, EXAMPLE_WORDS, beatsFrom, blockoutFramePrompt, compileBlockoutPrompt, type BlockoutRef } from "@/lib/blockout";
+import { QMA_MODEL } from "@/lib/qma";
import { getModel, getPreset, MODELS, supportsOp } from "./index";
import { dualEngine, onEngine, runsOn } from "./engines";
import { chainedWaitMessage, keyframeChain } from "./keyframes";
@@ -1785,9 +1786,14 @@ interface TplNode {
y: number;
data?: CanvasNodeData;
models?: ModelPair;
+ /** What changes on one engine (the product angles' QMA · 96 views on your GPU: its pose and shorter words). */
+ on?: Partial<Record<Engine, CanvasNodeData>>;
width?: number;
}
+/** The product angles' words on QMA · 96 views, after its camera words. */
+const QMA_STUDIO = "on a seamless studio background, soft key light, sharp details";
+
function tpl(nodes: TplNode[], edges: [string, string, string?][]): (engine: Engine) => CanvasGraph {
return (engine) => {
const graph: CanvasGraph = {
@@ -1795,7 +1801,7 @@ function tpl(nodes: TplNode[], edges: [string, string, string?][]): (engine: Eng
id: t.id,
type: t.type,
position: { x: t.x, y: t.y },
- data: { ...t.data, ...(t.models && { modelId: t.models[engine] }) },
+ data: { ...t.data, ...t.on?.[engine], ...(t.models && { modelId: t.models[engine] }) },
...(t.width && { width: t.width }),
})),
edges: [],
@@ -1912,9 +1918,11 @@ export const CANVAS_TEMPLATES: CanvasTemplate[] = [
build: tpl(
[
{ id: "product", type: "image-input", x: 0, y: ROW, data: { label: "Product photo" } },
- { id: "front", type: "model", x: COL, y: 0, data: { mediaKind: "image", label: "Front ¾ angle", op: "edit", prompt: "The same product from a three-quarter front angle on a seamless studio background, soft key light, sharp details" }, models: { cloud: "nano-banana-pro", open: "oss-qwen-image-21" } },
- { id: "side", type: "model", x: COL, y: ROW, data: { mediaKind: "image", label: "Side profile", op: "edit", prompt: "The same product in a clean side profile on a seamless studio background, rim light, sharp details" }, models: { cloud: "nano-banana-pro", open: "oss-qwen-image-21" } },
- { id: "top", type: "model", x: COL, y: ROW * 2, data: { mediaKind: "image", label: "Top-down", op: "edit", prompt: "The same product shot top-down as a flat lay on a seamless studio background, even light" }, models: { cloud: "nano-banana-pro", open: "oss-qwen-image-21" } },
+ // On your GPU the three angles are QMA · 96 views (qma-angles): the camera itself turns (its pose in params.extra), the
+ // words only set the studio look.
+ { id: "front", type: "model", x: COL, y: 0, data: { mediaKind: "image", label: "Front ¾ angle", op: "edit", prompt: "The same product from a three-quarter front angle on a seamless studio background, soft key light, sharp details" }, models: { cloud: "nano-banana-pro", open: QMA_MODEL }, on: { open: { prompt: QMA_STUDIO, params: { extra: { horizontal_angle: 45, vertical_angle: 30, zoom: 5 } } } } },
+ { id: "side", type: "model", x: COL, y: ROW, data: { mediaKind: "image", label: "Side profile", op: "edit", prompt: "The same product in a clean side profile on a seamless studio background, rim light, sharp details" }, models: { cloud: "nano-banana-pro", open: QMA_MODEL }, on: { open: { prompt: QMA_STUDIO, params: { extra: { horizontal_angle: 90, vertical_angle: 0, zoom: 5 } } } } },
+ { id: "top", type: "model", x: COL, y: ROW * 2, data: { mediaKind: "image", label: "Top-down", op: "edit", prompt: "The same product shot top-down as a flat lay on a seamless studio background, even light" }, models: { cloud: "nano-banana-pro", open: QMA_MODEL }, on: { open: { prompt: QMA_STUDIO, params: { extra: { horizontal_angle: 0, vertical_angle: 60, zoom: 5 } } } } },
{ id: "video", type: "model", x: COL * 2, y: ROW - 40, data: { mediaKind: "video", label: "Ad clip", op: "ref2v", prompt: "A premium product commercial: the camera orbits the product from the reference angles, studio lighting, slow and smooth", params: { aspectRatio: "16:9", duration: 5 } }, models: { cloud: "seedance-2-5", open: "oss-wan-vace" } },
{ id: "out", type: "output", x: COL * 3, y: ROW, data: { label: "Ad" } },
],
diff --git a/src/lib/catalog/cinema.ts b/src/lib/catalog/cinema.ts
index 6a7c8c7f..2b075b0c 100644
--- a/src/lib/catalog/cinema.ts
+++ b/src/lib/catalog/cinema.ts
@@ -6,6 +6,7 @@ import { lengthRange, PLANNED_DURATIONS, plannedDurations } from "./clip-lengths
import { DOP_MODEL, LTX25_HOSTED } from "./dop";
import { dualEngine, onEngine } from "./engines";
import { localOnly, needsToken, triggerOf } from "./loras";
+import { QMA_MODEL, qmaLabel, qmaView } from "@/lib/qma";
import { ANGLES_2511_LORA } from "./open-tools";
import { composeShots, estimateCost, planGeneration, routesFor } from "./plan";
import { soulRecipe } from "./soul";
@@ -1756,6 +1757,19 @@ function planLocationView(input: CinemaGenerateInput): CinemaPlan {
inputs,
params: { numOutputs: 1, extra: { horizontal_angle: view.pose.horizontal, vertical_angle: view.pose.vertical, zoom: view.pose.zoom } },
};
+ } else if (input.modelId === QMA_MODEL && getModel(QMA_MODEL)) {
+ // QMA · 96 views (qma-angles): Qwen-Image 2.1 with the QMA LoRA moves the camera to the view's pose (its nearest of 96).
+ model = getModel(QMA_MODEL)!;
+ request = {
+ feature: "cinema-location",
+ modelId: model.id,
+ op: "edit",
+ prompt: withBrief(input.brief, `${LOCATION_KEEP}${tidy(input.prompt) ? `. ${tidy(input.prompt)}` : ""}.`),
+ inputs,
+ params: { numOutputs: 1, extra: { horizontal_angle: view.pose.horizontal, vertical_angle: view.pose.vertical, zoom: view.pose.zoom } },
+ };
+ notes.push(`${model.name} moves the camera for the ${view.name.toLowerCase()} view (${qmaLabel(qmaView(view.pose)).toLowerCase()}), on your GPU`);
+ return finish(model, [{ key: "main", request }], notes, src ? undefined : "Pick the location image to re-angle");
} else {
model = editModel("open");
const loras = [ANGLES_2511_LORA];
@@ -2001,7 +2015,7 @@ export const SCENE_MODELS: Record<Engine, string> = { cloud: "marigold-depth", o
* What re-renders a captured view. The first is the default. On your GPU that stays Qwen-Image-Edit 2511, which runs it
* with the Multiple-Angles LoRA trained on it; Qwen-Image 2.1 is the choice after it, with plain words.
*/
-export const RECOMPOSE_MODELS: Record<Engine, string[]> = { cloud: ["nano-banana-pro", "qwen-multiple-angles"], open: ["oss-qwen-edit", "oss-qwen-image-21"] };
+export const RECOMPOSE_MODELS: Record<Engine, string[]> = { cloud: ["nano-banana-pro", "qwen-multiple-angles"], open: ["oss-qwen-edit", "oss-qwen-image-21", QMA_MODEL] };
/** The open scene mesh skips every other pixel: about a quarter of the triangles, light enough for a phone. */
export const SCENE_DECIMATION = 2;
@@ -2044,7 +2058,12 @@ function planRecompose(input: CinemaGenerateInput): CinemaPlan {
const pose = cap?.pose ?? REFERENCE_POSE;
const params = fitParams(model, { ...input, batch: 1, resolution: input.resolution ?? "1K" }, notes, "image");
let request: GenerationRequest;
- if (model.id === "qwen-multiple-angles") {
+ if (model.id === QMA_MODEL) {
+ // QMA · 96 views re-shoots the still itself from the flown camera, snapped to the nearest of its 96 views (on your GPU).
+ params.extra = { ...params.extra, horizontal_angle: pose.horizontal, vertical_angle: pose.vertical, zoom: pose.zoom };
+ request = { feature: "cinema-recompose", modelId: model.id, op: "edit", prompt: tidy(input.prompt), inputs: src ? { images: [src] } : undefined, params };
+ notes.push(`${model.name} re-shoots the still from the nearest of its 96 views to where you flew (${qmaLabel(qmaView(pose)).toLowerCase()}) — the capture itself isn't sent`);
+ } else if (model.id === "qwen-multiple-angles") {
params.extra = { horizontal_angle: pose.horizontal, vertical_angle: pose.vertical, zoom: pose.zoom };
request = { feature: "cinema-recompose", modelId: model.id, op: "edit", prompt: anglesNote(lens, aperture, input.prompt), inputs: src ? { images: [src] } : undefined, params };
notes.push(`${model.name} re-shoots the still from the angles you flew to (${Math.round(pose.horizontal)}° round, ${Math.round(pose.vertical)}° up, zoom ${pose.zoom}) — the capture itself isn't sent`);
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index b130108e..22b14b16 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -3,6 +3,7 @@ import { DEFAULT_FPS_TARGET, FPS_TARGETS, SLOW_MOTION } from "@/lib/av/fps";
import { ASR_LANGUAGES, WHISPER_LANGUAGES } from "../speech-languages";
import { PROMPT_HELPER_PARAM } from "@/lib/comfy";
import { QWEN21_DECODER, QWEN21_GPU, QWEN21_SPEED } from "@/lib/qwen21-speed";
+import { QMA_AZIMUTHS, QMA_AZIMUTH_LABELS, QMA_DISTANCES, QMA_DISTANCE_LABELS, QMA_DISTANCE_ZOOM, QMA_ELEVATIONS, QMA_ELEVATION_DEGREES, QMA_ELEVATION_LABELS, QMA_MODEL, QMA_PARAMS } from "@/lib/qma";
import { loraEntry, loraRef } from "./loras";
import { ANGLES_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEAK_PROMPT } from "./open-tools";
import { CINEMA_CROP, SOUL_ASPECTS, SOUL_TIERS } from "./soul";
@@ -59,6 +60,8 @@ const RESTORE_LORA = (() => {
const TRYON_LORA = loraEntry("tryon-klein-4b");
/** akhaliq's Next-Scene LoRA for Qwen-Image 2.1: the 2.1 next-scene graph loads it, and its switch in Models & licences holds the model. */
const NEXT_SCENE_21_LORA = loraEntry("qwen21-next-scene");
+/** gribbliest's QMA camera-angles LoRA for Qwen-Image 2.1: the QMA graph loads it, and its switch in Models & licences holds the model. */
+const QMA_LORA = loraEntry("qwen21-qma-angles");
/** The try-on LoRA card's own instruction, for a run with no words. */
export const TRYON_PROMPT = "a full-body photo of a person. Replace the outfit with the top and bottom as shown in the reference images. The final image is a full body shot.";
@@ -1182,6 +1185,34 @@ const open: ModelDef[] = [
options: { seed: true, maxImages: 2, controls: [QWEN21_DECODER], ...(NEXT_SCENE_21_LORA && { loras: [loraRef(NEXT_SCENE_21_LORA)] }) },
hidden: true,
}),
+ // QMA camera angles (qma-angles): Qwen-Image 2.1 with gribbliest's QMA LoRA re-shoots a picture from one of 96 cameras. The
+ // pose is the Angles app's own three settings (horizontal_angle, vertical_angle, zoom); the plan writes the LoRA's words
+ // from it (promptFormat "qma", src/lib/qma.ts). Open engine only: fal's Qwen-Image 2.1 takes no LoRAs.
+ o({
+ id: QMA_MODEL,
+ name: "QMA · 96 views",
+ vendor: "Alibaba Qwen",
+ family: "qwen-image",
+ kind: "image",
+ tagline: "Re-shoot a picture from any of 96 camera angles: 8 sides, 4 heights, 3 distances · on your GPU, 20 GB · non-commercial weights",
+ badges: ["new"],
+ routes: [{ ...comfy("edit", "qwen-image-21-qma", "QMA LoRA at 1.0, 30 steps, CFG 3"), unsized: true, maxImages: 1 }],
+ options: {
+ seed: true,
+ maxImages: 1,
+ promptFormat: "qma",
+ promptOptional: true,
+ promptPlaceholder: "Anything else to change (optional)",
+ controls: [
+ { param: QMA_PARAMS.horizontal, label: "Angle", values: QMA_AZIMUTHS.map((_, i) => i * 45), default: 45, labels: Object.fromEntries(QMA_AZIMUTHS.map((a, i) => [String(i * 45), QMA_AZIMUTH_LABELS[a]])) },
+ { param: QMA_PARAMS.vertical, label: "Height", values: QMA_ELEVATIONS.map((e) => QMA_ELEVATION_DEGREES[e]), default: 0, labels: Object.fromEntries(QMA_ELEVATIONS.map((e) => [String(QMA_ELEVATION_DEGREES[e]), QMA_ELEVATION_LABELS[e]])) },
+ { param: QMA_PARAMS.zoom, label: "Distance", values: QMA_DISTANCES.map((d) => QMA_DISTANCE_ZOOM[d]), default: 5, labels: Object.fromEntries(QMA_DISTANCES.map((d) => [String(QMA_DISTANCE_ZOOM[d]), QMA_DISTANCE_LABELS[d]])) },
+ { param: "size", label: "Size", values: ["full", "preview"], default: "full", labels: { full: "Full · about 1 MP", preview: "Preview · 768 px, faster" }, sets: { full: { megapixels: 1 }, preview: { megapixels: 0.6 } } },
+ QWEN21_DECODER,
+ ],
+ ...(QMA_LORA && { loras: [loraRef(QMA_LORA)] }),
+ },
+ }),
o({
id: "oss-qwen-next-scene",
name: "Qwen-Image-Edit Next Scene",
diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.ts
index 3f63c3e7..56827d12 100644
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@ -15,6 +15,7 @@ import { billedClipSeconds, editClipsProblem, sourceSeconds } from "./clip-windo
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 { anglesPrompt, anglesWords, ANGLES_ORIGINAL } from "./open-tools";
+import { qmaRunPrompt } from "@/lib/qma";
import { askedSize, clipWords, numFramesValue, sizeValue } from "./payload";
import { characterScale, CINEMA_CROP, soulKind, soulMegapixels, soulRecipe, soulSize, type SoulOverlay } from "./soul";
import { computeDimensions, fitCanvas } from "@/lib/comfy";
@@ -399,6 +400,9 @@ export function planGeneration(
prompt = "";
}
}
+ // QMA camera angles: the run's pose (the Angles app's choices, the model's Angle / Height / Distance, Cinema's camera) becomes
+ // the LoRA's own words, nearest of its 96 views, the user's words after them (src/lib/qma.ts).
+ if (model.options.promptFormat === "qma") prompt = qmaRunPrompt(prompt, params.extra);
// The words a model takes when none are given (Fuobe Try-On: its LoRA's own instruction).
if (!prompt && model.options.defaultPrompt) prompt = model.options.defaultPrompt;
// A recipe's own LoRAs (Fuobe Try-On's try-on LoRA) go on every run, first (an API's LoRA cap leaves out yours
diff --git a/src/lib/catalog/preset-recipe-routes.ts b/src/lib/catalog/preset-recipe-routes.ts
index 88a81ab5..68f57ad9 100644
--- a/src/lib/catalog/preset-recipe-routes.ts
+++ b/src/lib/catalog/preset-recipe-routes.ts
@@ -24,7 +24,7 @@
import type { Engine, Preset, PresetEndStep, PresetRecipeEdit, PresetRoute } from "./types";
/** What the rules read of a preset. */
-export type RecipePreset = Pick<Preset, "id" | "type" | "open" | "cloud" | "prestep" | "promptTemplate" | "grade" | "recipe" | "userPrompt" | "inputs">;
+export type RecipePreset = Pick<Preset, "id" | "type" | "open" | "openAlso" | "cloud" | "prestep" | "promptTemplate" | "grade" | "recipe" | "userPrompt" | "inputs">;
/** Whether the viewer's catalog has a model (the server's full catalog, or a studio's slice in the browser). */
export type HasModel = (id: string) => boolean;
@@ -143,7 +143,9 @@ export const ownRoute = (p: Pick<Preset, "open" | "cloud">, engine: Engine): Pre
export function presetRoutes(p: RecipePreset, engine: Engine, has: HasModel): PresetRoute[] {
const recipe = recipeRoute(p, engine);
const own = ownRoute(p, engine);
- return [...(recipe && has(recipe.modelId) ? [recipe] : []), ...(own ? [own] : [])];
+ // The open engine's extra routes (the Angles app's QMA · 96 views) after its own, when the viewer's catalog has their model.
+ const also = engine === "open" ? (p.openAlso ?? []).filter((r) => has(r.modelId)) : [];
+ return [...(recipe && has(recipe.modelId) ? [recipe] : []), ...(own ? [own] : []), ...also];
}
/**
diff --git a/src/lib/catalog/turnaround.ts b/src/lib/catalog/turnaround.ts
index 862e41b7..ff9624f7 100644
--- a/src/lib/catalog/turnaround.ts
+++ b/src/lib/catalog/turnaround.ts
@@ -15,6 +15,7 @@
*/
import { DEFAULT_MOTION, PATH_PRESETS, presetKeys, type CameraKey } from "@/lib/camera-path";
import { poseWords } from "@/lib/scene3d";
+import { QMA_MODEL, QMA_TURN_SET, qmaLabel, qmaPose } from "@/lib/qma";
import { getModel, getPreset } from "./index";
import { onEngine } from "./engines";
import { FRAMES_MODELS, chainGapProblem, chainTiming, frameTimes } from "./keyframes";
@@ -85,10 +86,19 @@ export function anglesHorizontal(side: TurnSide): number {
return (((viewAzimuth(side) * ANGLES_SIDE_SIGN) % 360) + 360) % 360;
}
+/**
+ * QMA's horizontal_angle for a side. QMA turns the ORIGINAL CAMERA (its card: "right side view" = the camera swings 90° to its
+ * own right round the subject), and a camera that swings to its right sees the person's LEFT side: their right side is QMA's
+ * 270° ("left side view"), their back 180°.
+ */
+export function qmaHorizontal(side: TurnSide): number {
+ return (360 - viewAzimuth(side)) % 360;
+}
+
// ---------------------------------------------------------------------------
// Routes
-export type TurnRoute = "frames" | "references" | "keyframes" | "camera";
+export type TurnRoute = "frames" | "references" | "keyframes" | "camera" | "stills";
export interface TurnRouteInfo {
engine: Engine;
@@ -139,9 +149,24 @@ export const TURN_ROUTES: Record<TurnRoute, TurnRouteInfo> = {
duration: 5,
resolution: "768P",
},
+ // Turnaround stills · 8 views (qma-angles): QMA · 96 views draws the person from all 8 sides at eye level, one batch of
+ // pictures and no film. Your GPU only: fal's Qwen-Image 2.1 takes no LoRAs.
+ stills: {
+ engine: "open",
+ modelId: QMA_MODEL,
+ name: "Stills · 8 views",
+ detail: "QMA · 96 views draws the character from all 8 sides at eye level: eight pictures, no video",
+ durations: [],
+ duration: 0,
+ resolution: "",
+ },
};
-export const ROUTES_ON: Record<Engine, TurnRoute[]> = { open: ["frames"], cloud: ["references", "keyframes", "camera"] };
+export const ROUTES_ON: Record<Engine, TurnRoute[]> = { open: ["frames", "stills"], cloud: ["references", "keyframes", "camera"] };
+
+/** How the missing sides are drawn on your GPU: the Angles app's Multiple-Angles route (the default), or QMA · 96 views. */
+export type TurnFill = "angles" | "qma";
+export const FILL_NAMES: Record<TurnFill, string> = { angles: "Multiple Angles", qma: "QMA · 96 views" };
/** The Angles app's routes, which draw a missing side from the front view (on your GPU the Multiple-Angles LoRA's base). */
export const FILL_MODELS: Record<Engine, string> = { cloud: "qwen-multiple-angles", open: "oss-qwen-edit" };
@@ -278,6 +303,8 @@ export interface TurnaroundInput {
route?: TurnRoute;
/** Draw the sides nobody has a picture of with the Angles app first (default on, except References with a sheet). */
fill?: boolean;
+ /** What draws them on your GPU: the Angles app's route (default) or QMA · 96 views (qma-angles). */
+ fillWith?: TurnFill;
/** The camera route's path (TURN_PATHS; any N7-5 preset id is taken). */
path?: string;
duration?: number;
@@ -359,6 +386,7 @@ export function routeOfModel(engine: Engine, modelId: string | undefined): TurnR
/** The duration a route takes: the one asked for when offered, else the nearest it offers. */
export function turnDuration(route: TurnRoute, asked?: number): number {
const { durations, duration } = TURN_ROUTES[route];
+ if (!durations.length) return duration;
const want = asked ?? duration;
return durations.reduce((best, d) => (Math.abs(d - want) < Math.abs(best - want) ? d : best), durations[0]);
}
@@ -410,8 +438,10 @@ export function planTurnaround(input: TurnaroundInput, ctx: TurnaroundContext =
for (const s of TURN_SIDES) if (input.views?.[s]) views[s] = input.views[s];
const sheet = input.sheet || undefined;
const camera = route === "camera";
+ const stills = route === "stills";
const frontFromSheet = !views.front && !!sheet;
- const fill = camera ? false : (input.fill ?? !(route === "references" && sheet));
+ const fill = camera || stills ? false : (input.fill ?? !(route === "references" && sheet));
+ const byQma = engine === "open" && input.fillWith === "qma" && has(QMA_MODEL);
const fills = fill && (views.front || frontFromSheet) ? TURN_SIDES.filter((s) => s !== "front" && !views[s]) : [];
const duration = turnDuration(route, input.duration);
const aspectRatio = input.aspectRatio ?? "9:16";
@@ -435,11 +465,13 @@ export function planTurnaround(input: TurnaroundInput, ctx: TurnaroundContext =
notes.push(`${m.name} draws a front view from the sheet first`);
}
// The missing sides, drawn from the front view by the Angles app's route.
- const fillModel = getModel(FILL_MODELS[engine])!;
+ const fillModel = getModel(byQma ? QMA_MODEL : FILL_MODELS[engine])!;
for (const side of fills) {
const horizontal = anglesHorizontal(side);
- const request: GenerationRequest =
- engine === "cloud"
+ const request: GenerationRequest = byQma
+ ? // QMA turns the camera, so the person's own side is the other way round (qmaHorizontal); its words come from the pose.
+ { feature: stepFeature, modelId: fillModel.id, op: "edit", prompt: FILL_KEEP, params: { numOutputs: 1, extra: { horizontal_angle: qmaHorizontal(side), vertical_angle: 0, zoom: 5 } } }
+ : engine === "cloud"
? { feature: stepFeature, modelId: fillModel.id, op: "edit", prompt: FILL_KEEP, params: { numOutputs: 1, extra: { horizontal_angle: horizontal, vertical_angle: 0, zoom: 5 } } }
: {
feature: stepFeature,
@@ -455,7 +487,7 @@ export function planTurnaround(input: TurnaroundInput, ctx: TurnaroundContext =
if (fills.length) {
const list = fills.map((s) => SIDE_NAMES[s].toLowerCase());
const said = list.length > 1 ? `${list.slice(0, -1).join(", ")} and ${list.at(-1)}` : list[0];
- notes.push(`The Angles app (${fillModel.name} with the Multiple-Angles LoRA) draws the ${said} from the front view first`);
+ notes.push(byQma ? `${fillModel.name} draws the ${said} from the front view first, on your GPU` : `The Angles app (${fillModel.name} with the Multiple-Angles LoRA) draws the ${said} from the front view first`);
}
const sourceOf = (side: TurnSide): Source | undefined =>
@@ -481,7 +513,27 @@ export function planTurnaround(input: TurnaroundInput, ctx: TurnaroundContext =
let main: TurnStep | undefined;
let blocker: string | undefined = views.front || frontFromSheet ? undefined : NEEDS_FRONT;
- if (route === "frames" || route === "keyframes") {
+ if (stills) {
+ // Eight eye-level pictures round the person, each drawn from the front view; the front's own picture stays the first.
+ const src = sourceOf("front");
+ const turns = QMA_TURN_SET.filter((v) => v.azimuth !== "front view");
+ frames = src ? [{ side: "front", from: fromOf(src, "front"), ...("url" in src && { url: src.url }) }] : [];
+ for (const v of turns) {
+ const pose = qmaPose(v);
+ const request: GenerationRequest = {
+ feature,
+ modelId: model.id,
+ op: "edit",
+ prompt: withWords(FILL_KEEP, input.prompt),
+ title: `${title.replace(/^Turnaround/, "Turnaround stills")} · ${qmaLabel(v).split(" · ")[0]}`,
+ params: { numOutputs: 1, extra: { horizontal_angle: pose.horizontal, vertical_angle: pose.vertical, zoom: pose.zoom }, ...seed },
+ };
+ const key = `still-${pose.horizontal}`;
+ if (src && "key" in src) steps.push({ key, request: { ...request, chain: [{ slot: "images" }] }, after: [src.key] });
+ else steps.push({ key, request: { ...request, ...(src && { inputs: { images: [src.url] } }) } });
+ }
+ notes.push(`${model.name} draws the character from ${turns.length} more sides at eye level, each from the front view, on your GPU: ${turns.length + 1} pictures with the front`);
+ } else if (route === "frames" || route === "keyframes") {
const list = TURN_FRAMES.flatMap((f) => {
const src = sourceOf(f.side);
return src ? [{ ...f, src }] : [];
@@ -581,8 +633,15 @@ export function planTurnaround(input: TurnaroundInput, ctx: TurnaroundContext =
if (TURN_SIDES.some((s) => s !== "front" && views[s]) || sheet) notes.push("Your other views aren't used on this route: References or Keyframes keep them");
}
// The pictures drawn first are numbered steps of the run, before the film (whose own clips the keyframe film numbers).
- steps.forEach((s, i) => (s.request.step = { label: s.key === "front" ? "Front view from the sheet" : `${SIDE_NAMES[s.key.slice(5) as TurnSide]} (Angles)`, index: i, of: steps.length + 1 }));
- steps.push(main);
+ const stepLabel = (k: string) =>
+ k === "front"
+ ? "Front view from the sheet"
+ : k.startsWith("still-")
+ ? qmaLabel(QMA_TURN_SET[Number(k.slice(6)) / 45]).split(" · ")[0]
+ : `${SIDE_NAMES[k.slice(5) as TurnSide]} (${byQma ? "QMA" : "Angles"})`;
+ const total = steps.length + (main ? 1 : 0);
+ steps.forEach((s, i) => (s.request.step = { label: stepLabel(s.key), index: i, of: total }));
+ if (main) steps.push(main);
// Prices at list (or launch) rates; free on the open engine.
let cost: number | null = 0;
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index ac15098f..9cc54761 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -640,8 +640,10 @@ export interface ModelOptions {
* "minimax-h3" = MiniMax H3's layout: an alignment line for the start (and end) frame, then integrated_multimodal_description,
* overall_soundscape and non_diegetic_music. The server wraps the words in it (src/lib/h3-prompt.ts) and keeps the result
* as the run's prompt; words already in the layout pass through.
+ * "qma" = the QMA camera-angles LoRA's "<qma> {azimuth} {elevation} {distance}": the plan writes it from the run's pose
+ * (params.extra horizontal_angle / vertical_angle / zoom, src/lib/qma.ts), the words after it.
*/
- promptFormat?: "ideogram4" | "minimax-h3";
+ promptFormat?: "ideogram4" | "minimax-h3" | "qma";
/**
* LoRAs the model's recipe always loads (Fuobe Try-On's try-on LoRA): every run carries them before the user's own
* (an API's LoRA cap leaves out the user's first), their trigger words leading the prompt. A ComfyUI graph that loads
@@ -1392,6 +1394,11 @@ export interface Preset {
promptPlaceholder?: string;
cloud: PresetRoute | null;
open: PresetRoute | null;
+ /**
+ * More routes on your GPU after the open one, each its own pick in the app's model picker (the Angles app's QMA · 96 views):
+ * a model the cloud has no hosted version of keeps its place on the open engine.
+ */
+ openAlso?: PresetRoute[];
/** Research confidence / parity notes shown in docs and the UI. */
parity?: string;
/** Fuobe DoP's colour-grade effects: a src/lib/grade.ts preset the browser applies to the finished clip. */
diff --git a/src/lib/qma.ts b/src/lib/qma.ts
index c1548d78..51be9cd8 100644
--- a/src/lib/qma.ts
+++ b/src/lib/qma.ts
@@ -15,6 +15,11 @@
*/
import type { ScenePose } from "@/lib/scene3d";
+/** The model that runs it (src/lib/catalog/models.ts): Qwen-Image 2.1 with the QMA LoRA, on your GPU. */
+export const QMA_MODEL = "oss-qwen-image-21-qma";
+/** Its ComfyUI graph. */
+export const QMA_WORKFLOW = "qwen-image-21-qma";
+
/** The LoRA's trigger: every prompt starts with it. */
export const QMA_TRIGGER = "<qma>";
diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.ts
index b4f9e5a1..50fcd2cd 100644
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@ -17,6 +17,7 @@ import { presetRoutes, recipeRoute } from "@/lib/catalog/preset-recipes";
import { resolveWorkflowId } from "@/lib/comfy-variants";
import { STUDIO_WORKFLOWS } from "@/lib/catalog/swap-studio-plan";
import { FILL_MODELS } from "@/lib/catalog/turnaround";
+import { QMA_MODEL } from "@/lib/qma";
import type { LoraRef, ModelDef, Operation } from "@/lib/catalog/types";
import type { LoraNeed } from "@/lib/gpu/readiness";
import { basename } from "@/lib/gpu/requirements";
@@ -214,6 +215,9 @@ export const STUDIO_ROWS: StudioRowDef[] = [
{ modelId: FILL_MODELS.open, op: "edit", loras: [ANGLES_2511_LORA] },
],
},
+ // Turnaround stills · 8 views (qma-angles): the character from all 8 sides at eye level, drawn by QMA · 96 views (the
+ // turnaround dialog's Stills route; its graph loads the QMA LoRA itself). It also draws a film's missing sides when picked.
+ { href: "/character-sheet?stills=1", label: "Turnaround stills · 8 views", group: "Images", steps: [{ modelId: QMA_MODEL, op: "edit" }] },
{ href: "/audio", label: "Voice", group: "Audio", config: S.AUDIO_STUDIO },
{ href: "/audio/dialogue", label: "Dialogue", group: "Audio", config: S.DIALOGUE_STUDIO },
{ href: "/audio/voice-change", label: "Voice change", group: "Audio", config: S.VOICE_CHANGE_STUDIO },
diff --git a/src/server/turnaround.ts b/src/server/turnaround.ts
index 9e158b5f..7ce07107 100644
--- a/src/server/turnaround.ts
+++ b/src/server/turnaround.ts
@@ -25,8 +25,9 @@ export const TurnaroundSchema = z.object({
engine: z.enum(["cloud", "open"]),
views: z.object({ front: FileRef.optional(), right: FileRef.optional(), back: FileRef.optional(), left: FileRef.optional() }).default({}),
sheet: FileRef.optional(),
- route: z.enum(["frames", "references", "keyframes", "camera"]).optional(),
+ route: z.enum(["frames", "references", "keyframes", "camera", "stills"]).optional(),
fill: z.boolean().optional(),
+ fillWith: z.enum(["angles", "qma"]).optional(),
path: z.string().max(40).optional(),
duration: z.number().min(1).max(30).optional(),
aspectRatio: z.enum(["9:16", "16:9"]).optional(),
diff --git a/tests/model-access-listings.test.ts b/tests/model-access-listings.test.ts
index dfe1dad2..3ad78ee7 100644
--- a/tests/model-access-listings.test.ts
+++ b/tests/model-access-listings.test.ts
@@ -98,8 +98,8 @@ describe("Models & licences in listings and picks", () => {
// Multiple-angles and Fuobe Speak's FusioniX 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), and Fuobe Restore's
// two gated IC-LoRAs (Lightricks' Restore and Detail Refine), and Open-H3 Regenerate's merged refiner LoRA, each once. Qwen-Image 2.1's three speed LoRAs and its Next-Scene LoRA
- // (nm10-qwen21-fast) are four more.
- expect(list.loras.length).toBe(181);
+ // (nm10-qwen21-fast) are four more, and the QMA camera-angles LoRA (qma-angles) one more.
+ expect(list.loras.length).toBe(182);
expect(list.loras.find((l) => l.file === "open_h3_regenerate_2k_lora.safetensors")).toMatchObject({ group: "adapter", base: "MiniMax H3", on: true, licence: { name: "MiniMax H3 Community License", class: "regions" } });
expect(list.packs.find((p) => p.name === "ComfyUI-Open-H3-Regenerate")).toMatchObject({ licence: { name: "Apache-2.0" }, on: true, models: 1 });
expect(list.packs.find((p) => p.name === "Comfyui_Minimax_h3_latent_Upscaler")).toMatchObject({ licence: { name: "MIT" }, on: true, models: 1 });
diff --git a/tests/open-engine.test.ts b/tests/open-engine.test.ts
index 97a5ed5b..3b79f261 100644
--- a/tests/open-engine.test.ts
+++ b/tests/open-engine.test.ts
@@ -138,6 +138,8 @@ describe("round-3 open models", () => {
if (p === "quality" && H3_BEST_GRAPH[wid]) continue;
// Qwen-Image 2.1's Speed and GPU pick the graph that runs too (src/lib/qwen21-speed.ts).
if ((p === "speed" || p === "gpu") && QWEN21_SPEED_GRAPH[wid]) continue;
+ // QMA · 96 views' camera settings become its LoRA's words in the planner (src/lib/qma.ts, promptFormat "qma").
+ if (m.options.promptFormat === "qma" && ["horizontal_angle", "vertical_angle", "zoom"].includes(p)) continue;
if (!PROVIDER_PARAMS.has(p) && p !== "cameraMotion" && !(m.id === ANGLES_ORIGINAL && (ANGLES_FIELDS as readonly string[]).includes(p))) expect(keys, `${m.id} → ${wid}: ${p}`).toContain(p);
}
}
diff --git a/tests/qma-angles.test.ts b/tests/qma-angles.test.ts
new file mode 100644
index 00000000..f22b8816
--- /dev/null
+++ b/tests/qma-angles.test.ts
@@ -0,0 +1,233 @@
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { afterAll, describe, expect, it } from "vitest";
+import type { GenInput, Operation } from "@/lib/catalog/types";
+import type { ComfyWorkflow, ManifestWorkflow } from "@/lib/comfy";
+
+// Package qma-angles: the QMA camera-angles LoRA on Qwen-Image 2.1 (96 views) in the Angles app, Cinema's location views and
+// 3D re-shoots, the turnaround's missing sides and its 8-view still set, and the Canvas product angles. Open engine only:
+// fal's Qwen-Image 2.1 takes no LoRAs and Replicate has none.
+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-qma-"));
+process.env.FUOBE_DATA_DIR = tmp;
+process.env.COMFYUI_URL = "http://comfy.test:8188";
+const { prepareWorkflow } = await import("@/server/providers/comfyui");
+const { getModel, getPreset } = await import("@/lib/catalog");
+const { planGeneration } = await import("@/lib/catalog/plan");
+const { appModels } = await import("@/lib/catalog/preset-recipe-routes");
+const { libraryEntry } = await import("@/lib/catalog/loras");
+const { planCinema, RECOMPOSE_MODELS } = await import("@/lib/catalog/cinema");
+const { planTurnaround, qmaHorizontal, ROUTES_ON, TURN_ROUTES, anglesHorizontal } = await import("@/lib/catalog/turnaround");
+const { CANVAS_TEMPLATES } = await import("@/lib/catalog/canvas");
+const { QMA_MODEL, QMA_WORKFLOW, parseQmaPrompt } = await import("@/lib/qma");
+const { STUDIO_ROWS, studioTool } = await import("@/server/gpu/tools");
+const { modelLicence } = await import("@/server/model-access");
+const { TurnaroundSchema } = await import("@/server/turnaround");
+afterAll(() => fs.rmSync(tmp, { recursive: true, force: true }));
+
+const LIBRARY = path.join(process.cwd(), "workflows/comfyui");
+const read = (f: string) => JSON.parse(fs.readFileSync(path.join(LIBRARY, f), "utf8"));
+const manifest = read("manifest.json") as { workflows: ManifestWorkflow[] };
+const entry = (id: string) => manifest.workflows.find((w) => w.id === id)!;
+const pins = read("model-pins.json") as Record<string, { revision: string; sizeBytes: number; sha256: string }>;
+const index = read("requirements.json") as { workflows: Record<string, { files: string[]; packs: Record<string, string[]>; vramGb: number }> };
+const ofClass = (wf: ComfyWorkflow, cls: string) => Object.entries(wf).filter(([, n]) => n.class_type === cls);
+const has = (id: string) => !!getModel(id);
+
+async function prepare(input: GenInput, op: Operation = "edit") {
+ return prepareWorkflow(QMA_WORKFLOW, { seed: 7, ...input }, {
+ generationId: "g-qma",
+ op,
+ upload: async (_d, _t, name) => `up_${name}`,
+ media: () => undefined as never,
+ serverRam: async () => undefined,
+ modelPath: async () => undefined,
+ });
+}
+
+describe("the QMA model and its graph", () => {
+ it("is an open edit model with the camera as three settings, its LoRA held to its switch", () => {
+ const m = getModel(QMA_MODEL)!;
+ expect(m).toMatchObject({ engine: "open", kind: "image", name: "QMA · 96 views" });
+ expect(m.routes.map((r) => [r.provider, r.op, r.endpoint])).toEqual([["comfyui", "edit", QMA_WORKFLOW]]);
+ expect(m.options.promptFormat).toBe("qma");
+ expect(m.options.controls?.map((c) => c.param)).toEqual(["horizontal_angle", "vertical_angle", "zoom", "size", "decoder"]);
+ expect(m.options.controls?.[0].values).toEqual([0, 45, 90, 135, 180, 225, 270, 315]);
+ expect(m.options.loras?.map((l) => [l.file, l.strength])).toEqual([["qwen-image-2.1-qma-camera-angles.safetensors", 1]]);
+ expect(m.tagline).toMatch(/on your GPU/);
+ });
+
+ it("records the LoRA pinned, with its licence, and the graph validated with the card's settings", () => {
+ const e = libraryEntry({ file: "qwen-image-2.1-qma-camera-angles.safetensors" })!;
+ expect(e.url).toContain("/resolve/13007eec2648c09529e930164c2ccc9c8c12428c/");
+ expect(e.sha256).toBe("ad2c20e0e103b6ad3ffffc56ab4e89c0822263c488aa4dd70e7e03091ff37b8d");
+ expect(e.licence).toMatchObject({ commercial: false, hostedOk: false });
+ const w = entry(QMA_WORKFLOW);
+ expect(w.validated).toBe(true);
+ expect(w.defaults).toMatchObject({ steps: 30, cfg: 3, loraStrength: 1, megapixels: 1 });
+ expect(w.vramGb).toBe(20);
+ expect(w.notes).not.toMatch(/src\//);
+ const lora = w.models.find((x) => x.folder === "loras")!;
+ expect(lora.sizeGb).toBe(0.32);
+ expect(pins[lora.url!]).toMatchObject({ revision: "13007eec2648c09529e930164c2ccc9c8c12428c", sizeBytes: 318820224 });
+ expect(index.workflows[QMA_WORKFLOW].files).toEqual(expect.arrayContaining(["loras/qwen-image-2.1-qma-camera-angles.safetensors", "diffusion_models/qwen_image_2.1_int8_convrot.safetensors"]));
+ expect(index.workflows[QMA_WORKFLOW].packs).toEqual({});
+ expect(modelLicence(getModel(QMA_MODEL)!).licence.name).toMatch(/Qwen Research/);
+ });
+
+ it("writes the camera words from the run's settings and binds the card's sampler", async () => {
+ const m = getModel(QMA_MODEL)!;
+ const plan = planGeneration({ feature: "edit", modelId: m.id, prompt: "make it dusk", inputs: { images: ["/api/files/p.png"] }, params: { extra: { horizontal_angle: 180, vertical_angle: 60, zoom: 0 } } }, getModel, getPreset);
+ expect(plan.prompt).toBe("<qma> back view high-angle shot wide shot make it dusk");
+ // No words and no settings: a quarter turn at eye level.
+ expect(planGeneration({ feature: "edit", modelId: m.id, prompt: "", inputs: { images: ["/api/files/p.png"] } }, getModel, getPreset).prompt).toBe("<qma> front-right quarter view eye-level shot medium shot");
+ const { workflow: wf } = await prepare({ prompt: plan.prompt, images: ["/api/files/p.png"], loras: plan.loras });
+ expect(wf["30"].inputs.prompt).toBe(plan.prompt);
+ expect(wf["32"].inputs).toMatchObject({ steps: 30, cfg: 3, sampler_name: "euler", scheduler: "simple" });
+ expect(wf["20"].inputs.megapixels).toBe(1);
+ // The graph loads the LoRA itself: the plan's copy isn't added twice.
+ expect(ofClass(wf, "LoraLoaderModelOnly").map(([, n]) => [n.inputs.lora_name, n.inputs.strength_model])).toEqual([["qwen-image-2.1-qma-camera-angles.safetensors", 1]]);
+ const preview = planGeneration({ feature: "edit", modelId: m.id, prompt: "", inputs: { images: ["/api/files/p.png"] }, params: { extra: { size: "preview" } } }, getModel, getPreset);
+ const { workflow: small } = await prepare({ prompt: preview.prompt, images: ["/api/files/p.png"], extra: preview.params.extra });
+ expect(small["20"].inputs.megapixels).toBe(0.6);
+ });
+});
+
+describe("the Angles app", () => {
+ const app = getPreset("app-angles")!;
+
+ it("offers QMA · 96 views on your GPU only, after its own routes", () => {
+ expect(appModels(app, "open", has)).toContain(QMA_MODEL);
+ expect(appModels(app, "open", has).at(-1)).toBe(QMA_MODEL);
+ expect(appModels(app, "cloud", has)).not.toContain(QMA_MODEL);
+ // Without the model in the catalog it isn't offered.
+ expect(appModels(app, "open", (id) => id !== QMA_MODEL && has(id))).not.toContain(QMA_MODEL);
+ });
+
+ it("turns the app's choices into QMA's words, the note after them, and none of the 2511 LoRA", () => {
+ const plan = planGeneration(
+ { feature: "app:app-angles", modelId: QMA_MODEL, presetId: app.id, prompt: "keep the red scarf", inputs: { images: ["/api/files/p.png"] }, presetOptions: { angle: "back-left", height: "elevated", distance: "close-up" } },
+ getModel,
+ getPreset,
+ );
+ expect(plan.prompt).toBe("<qma> back-left quarter view elevated shot close-up keep the red scarf");
+ expect(plan.loras.map((l) => l.file)).toEqual(["qwen-image-2.1-qma-camera-angles.safetensors"]);
+ expect(parseQmaPrompt(plan.prompt)?.view).toEqual({ azimuth: "back-left quarter view", elevation: "elevated shot", distance: "close-up" });
+ // Every one of the app's 8 × 4 × 3 choices reaches its own view.
+ const views = new Set<string>();
+ for (const a of app.options![0].choices)
+ for (const h of app.options![1].choices)
+ for (const d of app.options![2].choices) {
+ const p = planGeneration({ feature: "app:app-angles", modelId: QMA_MODEL, presetId: app.id, prompt: "", inputs: { images: ["/api/files/p.png"] }, presetOptions: { angle: a.value, height: h.value, distance: d.value } }, getModel, getPreset).prompt;
+ expect(p).toBe(`<qma> ${a.prompt} ${h.prompt} ${d.prompt}`);
+ views.add(p);
+ }
+ expect(views.size).toBe(96);
+ });
+});
+
+describe("Cinema", () => {
+ const settings = {} as never;
+ it("re-angles a location with QMA when asked, on your GPU", () => {
+ const plan = planCinema({ engine: "open", mode: "image", action: "location-view", view: "reverse", modelId: QMA_MODEL, prompt: "", settings, source: { url: "/api/files/loc.png", kind: "image" } } as never, {} as never);
+ expect(plan.model.id).toBe(QMA_MODEL);
+ const req = plan.steps[0].request;
+ expect(req.params?.extra).toMatchObject({ horizontal_angle: 180, vertical_angle: 0, zoom: 5 });
+ expect(planGeneration(req, getModel, getPreset).prompt).toMatch(/^<qma> back view eye-level shot medium shot Keep everything about the place the same/);
+ // The default stays the Multiple-Angles route.
+ expect(planCinema({ engine: "open", mode: "image", action: "location-view", view: "reverse", prompt: "", settings, source: { url: "/api/files/loc.png", kind: "image" } } as never, {} as never).model.id).toBe("oss-qwen-edit");
+ });
+
+ it("re-shoots a still from the flown camera's nearest view", () => {
+ expect(RECOMPOSE_MODELS.open).toContain(QMA_MODEL);
+ expect(RECOMPOSE_MODELS.cloud).not.toContain(QMA_MODEL);
+ const plan = planCinema(
+ { engine: "open", mode: "image", action: "recompose", modelId: QMA_MODEL, prompt: "", settings, source: { url: "/api/files/still.png", kind: "image" }, capture: { url: "/api/files/cap.png", lens: 24, aperture: 5.6, pose: { horizontal: 100, vertical: 20, zoom: 8 } } } as never,
+ {} as never,
+ );
+ const req = plan.steps[0].request;
+ expect(req.inputs?.images).toEqual(["/api/files/still.png"]);
+ expect(planGeneration(req, getModel, getPreset).prompt).toBe("<qma> right side view elevated shot close-up");
+ });
+});
+
+describe("the turnaround", () => {
+ it("knows QMA turns the camera, not the person", () => {
+ expect(qmaHorizontal("front")).toBe(0);
+ expect(qmaHorizontal("right")).toBe(270);
+ expect(qmaHorizontal("back")).toBe(180);
+ expect(qmaHorizontal("left")).toBe(90);
+ expect(anglesHorizontal("right")).toBe(90);
+ });
+
+ it("draws the missing sides with QMA when picked, on your GPU", () => {
+ const plan = planTurnaround({ engine: "open", views: { front: "/api/files/front.png" }, fillWith: "qma" });
+ const fills = plan.steps.filter((s) => s.key.startsWith("fill-"));
+ expect(fills.map((s) => [s.key, s.request.modelId, s.request.params?.extra?.horizontal_angle])).toEqual([
+ ["fill-right", QMA_MODEL, 270],
+ ["fill-back", QMA_MODEL, 180],
+ ["fill-left", QMA_MODEL, 90],
+ ]);
+ expect(fills[0].request.loras).toBeUndefined();
+ expect(planGeneration(fills[0].request, getModel, getPreset).prompt).toMatch(/^<qma> left side view eye-level shot medium shot Keep the same person/);
+ expect(plan.costUsd).toBe(0);
+ // The default stays the Angles app's route, and the cloud never takes QMA.
+ expect(planTurnaround({ engine: "open", views: { front: "/api/files/front.png" } }).steps.find((s) => s.key === "fill-right")!.request.modelId).toBe("oss-qwen-edit");
+ expect(planTurnaround({ engine: "cloud", views: { front: "/api/files/front.png" }, route: "keyframes", fillWith: "qma" }).steps.find((s) => s.key === "fill-right")!.request.modelId).toBe("qwen-multiple-angles");
+ });
+
+ it("makes the 8-view still set from the front view in one batch, with no film", () => {
+ expect(ROUTES_ON.open).toEqual(["frames", "stills"]);
+ expect(TURN_ROUTES.stills.modelId).toBe(QMA_MODEL);
+ const plan = planTurnaround({ engine: "open", views: { front: "/api/files/front.png", back: "/api/files/back.png" }, route: "stills", name: "Ada" });
+ expect(plan.route).toBe("stills");
+ expect(plan.blocker).toBeUndefined();
+ expect(plan.steps).toHaveLength(7);
+ expect(plan.steps.map((s) => s.request.params?.extra?.horizontal_angle)).toEqual([45, 90, 135, 180, 225, 270, 315]);
+ expect(plan.steps.every((s) => s.request.modelId === QMA_MODEL && s.request.inputs?.images?.[0] === "/api/files/front.png" && s.request.feature === "turnaround")).toBe(true);
+ expect(plan.steps.map((s) => s.request.step?.label)).toEqual(["Front right", "Right side", "Back right", "Back", "Back left", "Left side", "Front left"]);
+ expect(plan.steps[3].request.title).toBe("Turnaround stills · Ada · Back");
+ expect(plan.durations).toEqual([]);
+ expect(plan.costUsd).toBe(0);
+ // From a sheet: its front is drawn first and each view chains from it.
+ const sheet = planTurnaround({ engine: "open", sheet: "/api/files/sheet.png", route: "stills" });
+ expect(sheet.steps[0].key).toBe("front");
+ expect(sheet.steps.slice(1).every((s) => s.after?.[0] === "front")).toBe(true);
+ // No front: asked for. The cloud has no stills route.
+ expect(planTurnaround({ engine: "open", route: "stills" }).blocker).toMatch(/front view/);
+ expect(planTurnaround({ engine: "cloud", views: { front: "/api/files/front.png" }, route: "stills" }).route).not.toBe("stills");
+ // Without the QMA model offered the route isn't either.
+ expect(planTurnaround({ engine: "open", views: { front: "/api/files/front.png" }, route: "stills" }, { has: (id) => id !== QMA_MODEL }).routes).toEqual(["frames"]);
+ });
+
+ it("takes the still route and the QMA fill through the API", () => {
+ expect(TurnaroundSchema.parse({ engine: "open", route: "stills", fillWith: "qma" })).toMatchObject({ route: "stills", fillWith: "qma" });
+ expect(() => TurnaroundSchema.parse({ engine: "open", fillWith: "other" })).toThrow();
+ });
+});
+
+describe("the Canvas product angles and the GPU board", () => {
+ it("runs the three angles on QMA on your GPU, with the camera in each node's settings", () => {
+ const t = CANVAS_TEMPLATES.find((x) => x.id === "product-angles")!;
+ const open = t.build("open");
+ const cloud = t.build("cloud");
+ for (const id of ["front", "side", "top"]) {
+ const o = open.nodes.find((n) => n.id === id)!;
+ expect(o.data.modelId).toBe(QMA_MODEL);
+ expect(o.data.params?.extra).toHaveProperty("horizontal_angle");
+ const c = cloud.nodes.find((n) => n.id === id)!;
+ expect(c.data.modelId).toBe("nano-banana-pro");
+ expect(c.data.params).toBeUndefined();
+ }
+ const top = open.nodes.find((n) => n.id === "top")!;
+ expect(planGeneration({ feature: "canvas", modelId: QMA_MODEL, prompt: top.data.prompt ?? "", inputs: { images: ["/api/files/p.png"] }, params: top.data.params }, getModel, getPreset).prompt).toBe(
+ "<qma> front view high-angle shot medium shot on a seamless studio background, soft key light, sharp details",
+ );
+ });
+
+ it("gives the 8-view stills a row on the pre-flight board", () => {
+ const row = STUDIO_ROWS.find((r) => r.label === "Turnaround stills · 8 views")!;
+ expect(row).toBeDefined();
+ expect(studioTool(row)!.workflows).toEqual([QMA_WORKFLOW]);
+ });
+});
diff --git a/tests/turnaround-api.test.ts b/tests/turnaround-api.test.ts
index 54e6c0c7..32eb1586 100644
--- a/tests/turnaround-api.test.ts
+++ b/tests/turnaround-api.test.ts
@@ -50,7 +50,7 @@ describe("/api/turnaround", () => {
const res = await post({ engine: "open", views: { front, back } }, true);
expect(res.status).toBe(200);
const p = await res.json();
- expect(p).toMatchObject({ route: "frames", routes: ["frames"], fills: ["right", "left"], steps: 3, costUsd: 0, demo: true, gpuGb: 24, duration: 8 });
+ expect(p).toMatchObject({ route: "frames", routes: ["frames", "stills"], fills: ["right", "left"], steps: 3, costUsd: 0, demo: true, gpuGb: 24, duration: 8 });
expect(p.frames.map((f: { side: string; from: string }) => `${f.side}:${f.from}`)).toEqual(["front:picture", "right:angles", "back:picture", "left:angles", "front:picture"]);
expect(p.blocker).toBeUndefined();
});
diff --git a/tests/turnaround.test.ts b/tests/turnaround.test.ts
index b2cfe767..11a3827c 100644
--- a/tests/turnaround.test.ts
+++ b/tests/turnaround.test.ts
@@ -135,7 +135,7 @@ describe("the pictures a sheet or a character offers", () => {
describe("the open engine: Frames mode's chain", () => {
it("films all four sides as keyframes at 0, ¼, ½, ¾ and the end, with the orbit words, free", () => {
const plan = planTurnaround({ engine: "open", views: views("front", "right", "back", "left"), name: "Maya" });
- expect(plan).toMatchObject({ route: "frames", routes: ["frames"], fills: [], duration: 8, costUsd: 0 });
+ expect(plan).toMatchObject({ route: "frames", routes: ["frames", "stills"], fills: [], duration: 8, costUsd: 0 });
expect(plan.blocker).toBeUndefined();
expect(plan.steps).toHaveLength(1);
const { request } = plan.steps[0];