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.

Merge claude/fuobe-parity-4 into o/dbs-d8

Clauded33e384247bd
diff --cc src/components/canvas/canvas-context.tsx
index b7bac859,131909af..2c85d423
--- a/src/components/canvas/canvas-context.tsx
+++ b/src/components/canvas/canvas-context.tsx
@@@ -2,9 -2,10 +2,11 @@@
import {
AtSign,
+ Orbit,
+ Rotate3d,
AudioLines,
AudioWaveform,
+ Split,
Building2,
Castle,
Clapperboard,
diff --cc src/lib/catalog/canvas.ts
index 6efb6d06,7652aa37..062796a9
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@@ -16,9 -17,11 +17,12 @@@ import { isSpeed, keyTimes, timingFor,
import { estimateCost, inferOperation, planGeneration, routesFor, type Plan } from "./plan";
import { replacedBy, replacementOf } from "./replaced";
import { REGEN_COPY, REGEN_MODEL } from "./regenerate";
+import { CLOUD_ONLY_PROBLEM, CLOUD_SPLIT_PROBLEM, SPLIT_MODEL, STEMS, type StemId } from "@/lib/av/split";
import { compileWords, LAYOUT_PARAM, readLayout, type LayoutDraft } from "@/lib/layout-prompt";
import { fillLayout, layoutPlaceholders } from "@/lib/layout-surfaces";
+ import { FLY_MODELS, flyKeys, planFlyAround } from "./fly-around";
+ import type { CameraKey } from "@/lib/camera-path";
+ import type { ExactOrbit } from "@/lib/exact-orbit";
import {
OPERATION_LABELS,
OPERATION_OUTPUT,
@@@ -257,7 -268,7 +272,7 @@@ export const NODE_SPECS: Record<CanvasN
note: { type: "note", label: "Sticky note", group: "Output", icon: "StickyNote", description: "A note on the board (not run)" },
};
- export const GENERATOR_TYPES = new Set<CanvasNodeType>(["model", "join", "frame", "upscale", "bg-remove", "tts", "voice-change", "clean-voice", "split-soundtrack", "translate", "concat", "restore"]);
-export const GENERATOR_TYPES = new Set<CanvasNodeType>(["model", "join", "frame", "upscale", "bg-remove", "tts", "voice-change", "clean-voice", "translate", "concat", "restore", "fly-around"]);
++export const GENERATOR_TYPES = new Set<CanvasNodeType>(["model", "join", "frame", "upscale", "bg-remove", "tts", "voice-change", "clean-voice", "split-soundtrack", "translate", "concat", "restore", "fly-around"]);
export const isGenerator = (n: Pick<CanvasNode, "type">) => GENERATOR_TYPES.has(n.type);
/** Entries of the Add-node palette (several entries can make the same node type). */
@@@ -455,8 -465,7 +472,9 @@@ const KIND_OP: Record<MediaKind, Operat
/** The model a new generator node starts with. */
export function defaultModelForNode(n: Pick<CanvasNode, "type" | "data">, engine: Engine): ModelDef | undefined {
if (n.type === "concat") return getModel(CONCAT_MODELS[engine]);
+ // Split soundtrack: only a model that makes its stems, never another separator in its place (none on the cloud).
+ if (n.type === "split-soundtrack") return splitModels().find((m) => runsOn(m, engine));
+ if (n.type === "fly-around") return getModel(FLY_MODELS[engine]);
if (n.type === "model") {
const kind = n.data.mediaKind ?? "image";
return defaultModelFor(n.data.op ?? KIND_OP[kind], engine) ?? MODELS.find((m) => m.engine === engine && !m.hidden && m.kind === kind);
@@@ -494,7 -503,7 +512,8 @@@ export function modelChoices(n: Pick<Ca
return MODELS.filter((m) => !m.hidden && (!kind || m.kind === kind) && !needsMarks(m) && m.routes.some((r) => !UNSUPPORTED_OPS.has(r.op)));
}
if (n.type === "concat") return Object.values(CONCAT_MODELS).flatMap((id) => getModel(id) ?? []);
+ if (n.type === "split-soundtrack") return splitModels();
+ if (n.type === "fly-around") return [FLY_MODELS.cloud, FLY_MODELS.open].flatMap((id) => getModel(id) ?? []);
const ops = nodeOps(n);
// Clean up voice offers only what runs on your GPU (RE-USE): the hosted cleaners share its op but are Clean up
// dialogue's cloud engine (defaultModelForNode).
@@@ -654,96 -673,9 +683,96 @@@ export function outputType(_graph: Canv
return toPortType(n.data.mediaKind ?? "image");
}
+// ---------------------------------------------------------------------------
+// Output handles: one OUT per node, except Split soundtrack (DBS D8), whose four handles each carry one stem
+// into the next node's chain (ChainSlot.stem, read by pickOutput on the server).
+
+export interface OutputPortDef {
+ /** The handle id an edge saves as its sourceHandle. */
+ id: string;
+ label: string;
+ type: PortType;
+ /** Split soundtrack: the stem this handle carries. */
+ stem?: StemId;
+ /** Why nothing can be taken from this handle here (the node's model can't make that stem, or can't run here). */
+ disabled?: string;
+}
+
+/**
+ * Split soundtrack's handles, in the order the node shows them. Dialogue is OUT itself, so an edge drawn or saved without
+ * a handle (OUT, null) takes the dialogue, the stem a chain without one takes anyway; "voice" is read as OUT too.
+ */
+export const SPLIT_HANDLES: { id: string; stem: StemId; label: string }[] = STEMS.map((s) => ({ id: s.id === "voice" ? OUT : s.id, stem: s.id, label: s.label }));
+
+/**
+ * The stems each separator the node may run makes (the open engine's DBS: all four). Only these models are offered: the
+ * cloud has none while DBS is hosted nowhere, and Demucs (a music separator) is never put in its place.
+ */
+export const SPLIT_STEMS: Record<string, readonly StemId[]> = {
+ [SPLIT_MODEL]: ["voice", "music", "effects", "background"],
+};
+
+const splitModels = (): ModelDef[] => Object.keys(SPLIT_STEMS).flatMap((id) => getModel(id) ?? []);
+
+/** A Split soundtrack handle's id as stored (OUT for Dialogue, also for "voice" and no handle), or undefined when it has none such. */
+export function splitHandle(handle: string | null | undefined): string | undefined {
+ if (!handle || handle === "voice") return OUT;
+ return SPLIT_HANDLES.some((h) => h.id === handle) ? handle : undefined;
+}
+
+/** The stem an edge out of a Split soundtrack node carries (undefined for any other node, or a handle it doesn't have). */
+export function edgeStem(source: Pick<CanvasNode, "type"> | undefined, handle: string | null | undefined): StemId | undefined {
+ if (source?.type !== "split-soundtrack") return undefined;
+ const id = splitHandle(handle);
+ return SPLIT_HANDLES.find((h) => h.id === id)?.stem;
+}
+
+/** The names a separator may give each stem (as the server's pickOutput reads them). */
+const STEM_NAMES: Record<StemId, string[]> = {
+ voice: ["voice", "vocals", "speech", "target"],
+ music: ["music"],
+ effects: ["effects", "sfx"],
+ background: ["background", "accompaniment", "instrumental", "residual", "no_vocals"],
+};
+
+/** A result's output for one stem (meta.stem), as the next step takes it; without a stem, the first audio. */
+export function stemOutput<T extends { kind: string; meta?: Record<string, unknown> }>(outputs: readonly T[], stem: StemId | undefined): T | undefined {
+ const audio = outputs.filter((o) => o.kind === "audio");
+ if (!stem) return audio[0];
+ return audio.find((o) => typeof o.meta?.stem === "string" && STEM_NAMES[stem].includes(o.meta.stem.toLowerCase()));
+}
+
+/**
+ * Why a Split soundtrack node can't run on this install (it runs on your GPU only), or null. A node with no model yet,
+ * or one the catalog no longer has, isn't an engine problem: describeNode asks for a model and its edges stay.
+ */
+export function splitProblem(n: Pick<CanvasNode, "data">, mode: "both" | Engine = "both"): string | null {
+ if (mode === "cloud") return CLOUD_ONLY_PROBLEM;
+ const model = nodeModel(n, mode);
+ // A separator that isn't one of the node's (a cloud one such as Demucs, or a two-stem open one) is told to pick DBS.
+ return model && !SPLIT_STEMS[model.id] ? `${model.name} can't split a soundtrack into its stems — pick ${splitModels()[0]?.name ?? "another model"}` : null;
+}
+
+/** A node's output handles: OUT with its type, Split soundtrack's four stems, or none. */
+export function outputPorts(graph: CanvasGraph, n: CanvasNode, mode: "both" | Engine = "both"): OutputPortDef[] {
+ if (n.type === "split-soundtrack") {
+ // Only the install shuts the handles (a cloud-only one): a node still missing its model keeps its edges, and a
+ // separator that makes fewer stems shuts the ones it doesn't make.
+ const why = mode === "cloud" ? CLOUD_ONLY_PROBLEM : undefined;
+ const model = nodeModel(n, mode);
+ const stems = model && SPLIT_STEMS[model.id];
+ return SPLIT_HANDLES.map((h) => {
+ const disabled = why ?? (model && stems && !stems.includes(h.stem) ? `${model.name} doesn't make a ${h.label.toLowerCase()} stem` : undefined);
+ return { id: h.id, label: h.label, type: "audio" as const, stem: h.stem, ...(disabled && { disabled }) };
+ });
+ }
+ const type = outputType(graph, n);
+ return type ? [{ id: OUT, label: PORT_TYPE_LABEL[type], type }] : [];
+}
+
/** Which ports accept which types: a voice input also takes plain audio (a sample straight from a file or a model). */
export function acceptsType(port: PortDef | "preview", type: PortType): boolean {
- if (port === "preview") return type !== "element";
+ if (port === "preview") return type !== "element" && type !== "path";
return port.type === type || (port.type === "voice" && type === "audio");
}
diff --cc src/server/canvas.ts
index 84c1af61,a16a5ecd..0c99062a
--- a/src/server/canvas.ts
+++ b/src/server/canvas.ts
@@@ -106,9 -107,10 +108,11 @@@ const NODE_TYPES =
"clone-voice",
"translate",
"concat",
+ "restore",
"table",
"layout",
+ "camera-path",
+ "fly-around",
"output",
"note",
] as const satisfies readonly CanvasNodeType[];