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 branch 'r4/faceless-plus' into claude/fuobe-parity-4

Claude987a1f305c91
diff --cc scripts/comfy/library.spec.mjs
index e664c35b,8f10fec4..63e9b589
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@@ -73,22 -73,10 +73,23 @@@
// cutout, numGaussians, splatFormat (TripoSplat: BiRefNet cut-out on/off, number of Gaussians, ply | ksplat | spz)
// orbitFrames (TripoSplat orbit preview length in frames)
// frameWidth (reference brief: width the clip's frames are scaled to, px)
+// Keys added with round 4 (engine seams):
+// curveMode, filterSpeckle, colorPrecision (VTracer: spline | polygon | none curves, specks dropped (px), colour precision bits)
+// Keys added by the remove-object package (round 4):
+// colormap* (Video Depth Anything's colour map: gray | inferno; params.colormap grayscale → gray)
+// sideBySide (depth maps: the original clip next to the depth map)
+// Keys added with the round-4 video-finish workflows (FPS Boost, chunked upscaling, HDR formats). * = the provider fills it:
+// every* (FPS Boost: keep every n-th interpolated frame; source fps x multiplier / every = the target)
+// slowdown* (FPS Boost: slow-motion factor, params.slowdown; the output fps is divided by it)
+// shortSide* (chunked upscalers: the output's shorter edge in px, params.resolution: 1080p -> 1080)
+// colorSpace* (SDR to HDR: CreateVideo color space, "HDR" = BT.2020 HLG, "HDR PQ" = BT.2020 PQ (HDR10): params.format)
// Output fields beyond {node, kind}: stem ("voice" | "background"), role ("cues" | "transcript" | "language" |
// "sheet" | "tiles" | "layers" | "first-frame" | "turntable" | "lines" | "frame" | "frames" | "scene" | "depth" | "splat" |
-// "brief"). Entry fields: worker "isolated" (needs its own ComfyUI, see README), expand "captions" (the provider writes one
-// segment per caption cue before submitting), "timeline", "videos" / "audios" (one loader per clip in inputs.videos / audios).
+// "brief" | "mask" (a painted eraser's last tracked frame, white = the object) | "cutout" | "matte" (a matte graph's transparent
+// and black-and-white videos: params.matteOutput keeps one)). Entry fields: worker "isolated" (needs its own ComfyUI, see README), expand "captions" (the provider writes one
- // segment per caption cue before submitting), optionalModels (files a model control can pick instead of the graph's own,
++// segment per caption cue before submitting), "timeline", "videos" / "audios" (one loader per clip in inputs.videos / audios),
++// optionalModels (files a model control can pick instead of the graph's own,
+// listed in the manifest with optional: true so missing-model help can name their download).
import fs from 'node:fs';
diff --cc scripts/comfy/validation-state.json
index c6642980,619fdec7..90ef7d68
--- a/scripts/comfy/validation-state.json
+++ b/scripts/comfy/validation-state.json
@@@ -3,7 -3,7 +3,7 @@@
"sha256": "f18c08cd22f37ccadb81cf557c4624e894c71dd718685e7b3030c92c9893be6a",
"validated": true,
"error": null,
-- "at": "2026-10-23T00:12:21.245Z"
++ "at": "2026-10-24T05:04:51.883Z"
},
"audio-loop-crossfade": {
"sha256": "97a181dd41506ca676dd88cb238da5e7871ce7101b74186991e4be33a0a2654c",
@@@ -569,6 -545,12 +569,12 @@@
"error": null,
"at": "2026-10-16T23:33:20.703Z"
},
+ "video-concat-encoded": {
+ "sha256": "0d99102a6a9bbbc2150ee23ae8d2ac3bbcd5f30903bb374082da2b7a04c51988",
+ "validated": true,
+ "error": null,
- "at": "2026-10-23T01:05:19.050Z"
++ "at": "2026-10-24T05:04:50.642Z"
+ },
"video-concat-sound1-2": {
"sha256": "70ed1a9d7d25e3022e0289e8c1c4db3a6471e616201e3c1575150ce68cfef108",
"validated": true,
diff --cc src/components/studio/mode-switch-studio.tsx
index 12217850,fe340b77..e824e036
--- a/src/components/studio/mode-switch-studio.tsx
+++ b/src/components/studio/mode-switch-studio.tsx
@@@ -26,7 -22,7 +26,8 @@@ import { HUB_MODES, modeHref, type HubK
import { CaptionsStudio } from "@/components/captions/captions-studio";
import { DubStudio } from "@/components/dub/dub-studio";
import { TrimTool } from "@/components/av/trim-tool";
+import { RemoveObjectTool } from "@/components/remove-object/remove-object-tool";
+ import { AudioJoinTool, AudioLoopTool } from "@/components/audio-tools/audio-tools";
import { ModeStudio, ModeTabs } from "./mode-studio";
import type { StudioConfig } from "./studio-context";
@@@ -51,14 -46,10 +52,18 @@@ const CONFIGS: Record<HubKind, Record<s
},
};
- /** Modes that are their own tool rather than a composer studio (Translate & dub, Remove object, Captions, Trim). */
-/** Modes that are their own tool rather than a composer studio (Translate & dub, Loop / extend, Join, Captions, Trim). */
++/** Modes that are their own tool rather than a composer studio (Translate & dub, Loop / extend, Join, Remove object, Captions, Trim). */
const TOOLS: Partial<Record<HubKind, Record<string, (p: { tabs: React.ReactNode }) => React.ReactNode>>> = {
- audio: { translate: ({ tabs }) => <DubStudio tabs={tabs} /> },
- audio: { translate: ({ tabs }) => <DubStudio tabs={tabs} />, loop: ({ tabs }) => <AudioLoopTool tabs={tabs} />, join: ({ tabs }) => <AudioJoinTool tabs={tabs} /> },
- "video-tools": { captions: ({ tabs }) => <CaptionsStudio tabs={tabs} />, trim: ({ tabs }) => <TrimTool tabs={tabs} /> },
++ audio: {
++ translate: ({ tabs }) => <DubStudio tabs={tabs} />,
++ loop: ({ tabs }) => <AudioLoopTool tabs={tabs} />,
++ join: ({ tabs }) => <AudioJoinTool tabs={tabs} />,
++ },
+ "video-tools": {
+ "remove-object": ({ tabs }) => <RemoveObjectTool tabs={tabs} />,
+ captions: ({ tabs }) => <CaptionsStudio tabs={tabs} />,
+ trim: ({ tabs }) => <TrimTool tabs={tabs} />,
+ },
};
const HUB_TITLE: Record<HubKind, string> = { upscale: "Upscale", audio: "Audio", "video-tools": "Video tools" };
diff --cc src/components/studio/result-actions.tsx
index 048441e5,cc3b8d13..5109ad5b
--- a/src/components/studio/result-actions.tsx
+++ b/src/components/studio/result-actions.tsx
@@@ -19,7 -17,7 +19,8 @@@ import
Layers2,
Mic2,
MoreHorizontal,
+ Pin,
+ Repeat,
RotateCcw,
SlidersHorizontal,
Sparkles,
@@@ -78,8 -70,8 +79,9 @@@ export const ACTION_ICONS: Record<Outpu
reframe: Crop,
lipsync: Mic2,
"add-sound": AudioLines,
+ genjutsu: WandSparkles,
"voice-change": AudioLines,
+ "loop-audio": Repeat,
"copy-text": Copy,
"view-3d": Box,
download: Download,
diff --cc src/lib/catalog/payload.ts
index 79538291,5d2d3a0f..a0e05dc8
--- a/src/lib/catalog/payload.ts
+++ b/src/lib/catalog/payload.ts
@@@ -326,14 -325,10 +326,15 @@@ export function buildPayload(map: Field
const [k, v] = enumValue(map.colormap, input.colormap);
out[k] = v;
}
+ if (map.sideBySide && input.sideBySide !== undefined) out[map.sideBySide] = input.sideBySide;
+ if (map.matteOutput && input.matteOutput) {
+ const v = map.matteOutput.values[input.matteOutput];
+ if (v !== undefined) out[map.matteOutput.key] = v;
+ }
if (map.frames && images.length) out[map.frames.key] = images.map((url) => ({ [map.frames!.url]: url, [map.frames!.frames]: 1 }));
if (map.loop && input.audio) {
- const want = input.duration && input.sourceDuration ? Math.ceil(input.duration / input.sourceDuration) : map.loop.max;
+ // A length that is a whole number of plays counts as that many (30.003 / 10.001 is a hair over 3 in floats).
+ const want = input.duration && input.sourceDuration ? Math.ceil(input.duration / input.sourceDuration - 1e-6) : map.loop.max;
out[map.loop.key] = Array.from({ length: Math.max(2, Math.min(map.loop.max, want)) }, () => input.audio);
}
if (map.model3d && input.model3d) out[map.model3d] = input.model3d;
diff --cc src/lib/hubs.ts
index 89c50a22,13647754..fb785a4a
--- a/src/lib/hubs.ts
+++ b/src/lib/hubs.ts
@@@ -18,9 -15,10 +18,11 @@@ export const HUB_MODES: Record<HubKind
{ id: "dialogue", label: "Dialogue" },
{ id: "voice-change", label: "Voice change" },
{ id: "translate", label: "Translate" },
+ { id: "transcribe", label: "Transcribe" },
{ id: "sfx", label: "Sound effects" },
{ id: "music", label: "Music" },
+ { id: "loop", label: "Loop / extend" },
+ { id: "join", label: "Join" },
{ id: "video", label: "Sound for video" },
],
"video-tools": [
diff --cc src/lib/output-actions.ts
index e15dcf86,c2b1960b..f7429958
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@@ -21,8 -21,8 +21,9 @@@ export type OutputActionId
| "reframe"
| "lipsync"
| "add-sound"
+ | "genjutsu"
| "voice-change"
+ | "loop-audio"
| "copy-text"
| "view-3d"
| "download"
diff --cc src/server/providers/comfyui.ts
index 20742cdb,42c795ae..b807e535
--- a/src/server/providers/comfyui.ts
+++ b/src/server/providers/comfyui.ts
@@@ -31,19 -28,15 +31,21 @@@ import
type ManifestOutput,
type ManifestWorkflow,
} from "@/lib/comfy";
+import { fpsPlan } from "@/lib/av/fps";
+ import { crossfadeProblem, fadeCurveWav } from "@/lib/av/crossfade";
+ import { expandAudioJoinWorkflow, expandVideoJoinWorkflow } from "@/lib/av/joins";
import { expandTimelineWorkflow, readTimeline } from "@/lib/av/timeline";
+import { exportValues, exrWorkflow, framesPerPass, hdrColorSpace, upscaleShortSide, wholeClipProblem, wholeClipTool } from "@/lib/av/video-finish";
import { guessKind } from "@/lib/catalog/payload";
-import type { GenInput, MediaKind, Operation } from "@/lib/catalog/types";
+import { getMaker, makerPrompt, OPEN_TARGET_PROBLEM, swapTarget } from "@/lib/catalog/genjutsu";
+import { CLICK_OPEN_PROBLEM, HAND_OFF, REMOVE_SCENE, targetPhrase } from "@/lib/catalog/remove-object";
+import type { GenInput, MediaKind, ModelRoute, Operation } from "@/lib/catalog/types";
import { probeMedia, type MediaInfo } from "@/lib/media-probe";
-import { getSetting } from "../settings";
+import { getSetting, isCandidate, savedSetting } from "../settings";
import { decodePng, encodePng } from "../png";
-import { readRef } from "../storage";
+import { probeWebm } from "../webm-probe";
+import { adoptFile, readRef, scratchDir } from "../storage";
+import { zipToFile } from "../zip";
import { ProviderError, type ProviderAdapter, type RemoteOutput } from "./types";
export const WORKFLOW_DIR = path.join(process.cwd(), "workflows", "comfyui");
@@@ -516,80 -408,12 +518,86 @@@ function captionCues(input: GenInput, e
const seconds = (n: number) => (n >= 10 ? String(Math.round(n)) : String(Math.round(n * 10) / 10));
const GB = 2 ** 30;
+const clipFacts = (clip: MediaInfo | undefined) => ({ width: clip?.width, height: clip?.height, fps: clip?.fps, frames: clip?.frames, duration: clip?.videoDuration ?? clip?.duration });
+
+/**
+ * Values and graph edits for the Upscale hub's open tools, from the request and the clip's header:
+ * VHS format / profile (export), CreateVideo's colour space (HDR10 PQ or HLG), FPS Boost's multiplier m,
+ * selection n and slow motion (src/lib/av/fps.ts), the chunked upscalers' short side and pass size.
+ * `holds` = frame-sized copies of the whole clip the graph keeps in memory (for the RAM check).
+ */
+function videoFinishValues(manifest: ManifestWorkflow, input: GenInput, clip: MediaInfo | undefined, extra: Record<string, unknown>) {
+ const b = manifest.bindings;
+ const d = manifest.defaults;
+ const facts = clipFacts(clip);
+ const values: Partial<Record<BindingKey, unknown>> = {};
+ const out = { values, wholeClip: null as ReturnType<typeof wholeClipTool>, bypassInterpolation: false, dropSound: false };
+ try {
+ // Export: VideoHelperSuite's format and ProRes profile.
+ if (manifest.capability === "export-video" && b.format) {
+ const v = exportValues(input.format);
+ values.format = v.format;
+ if (v.profile) values.profile = v.profile;
+ }
+ // SDR to HDR: HLG or PQ (HDR10's curve).
+ if (manifest.capability === "sdr-to-hdr" && b.colorSpace) values.colorSpace = hdrColorSpace(input.format);
+ } catch (e) {
+ throw new ProviderError((e as Error).message);
+ }
+ // Graphs that decode the whole clip (src/lib/av/video-finish.ts wholeClipTool says how many copies they hold).
+ if (manifest.capability === "sdr-to-hdr") out.wholeClip = wholeClipTool("sdr-to-hdr", input.format);
+ if (manifest.id === "video-export-exr") out.wholeClip = wholeClipTool("export-video", "exr");
+ // FPS Boost: interpolate by m, keep every n-th frame (the graph computes the output frame rate itself).
+ if (b.every && b.multiplier) {
+ const target = input.targetFps;
+ const slowdown = Math.max(1, Math.round(input.slowdown ?? 1));
+ let m = Number(extra.multiplier ?? d.multiplier ?? 2);
+ let n = 1;
+ // m, n and the slow-motion factor go together: a stray params.extra value can't break the ratio.
+ for (const k of ["multiplier", "every", "slowdown"]) delete extra[k];
+ if (target) {
+ // m and n come from the clip's own rate (the upload's header, else what the server read from it).
+ const sourceFps = clip?.fps && clip.fps > 0 ? clip.fps : input.sourceFps && input.sourceFps > 0 ? input.sourceFps : undefined;
+ if (!sourceFps) {
+ throw new ProviderError(
+ `FPS Boost on the open engine works out its frames from the clip's frame rate, and this file doesn't say what it is, so ${target} fps can't be hit. Re-save it as MP4 (H.264) or WebM and try again`,
+ );
+ }
+ const plan = fpsPlan(sourceFps, target, slowdown, Number(manifest.limits?.maxMultiplier ?? 16));
+ m = plan.multiplier;
+ n = plan.every;
+ } else m = Math.max(2, Math.min(Number(manifest.limits?.maxMultiplier ?? 16), Math.round(m * slowdown)));
+ // m 1 (a target the clip's rate is a whole multiple of: 60 → 30 keeps every 2nd frame): FrameInterpolate is
+ // linked out below, and the graph's frame-rate expression still reads m, so it gets the real 1. Other lower
+ // targets still interpolate (30 → 24 is m 4, n 5).
+ values.multiplier = m;
+ values.every = n;
+ values.slowdown = slowdown;
+ out.bypassInterpolation = m < 2;
+ out.dropSound = slowdown > 1;
+ out.wholeClip = wholeClipTool("interpolate", undefined, m);
+ }
+ // Chunked upscaling: the shorter edge asked for, and passes that hold about 1.5 GB of frames.
+ if (b.shortSide) {
+ const shortSide = upscaleShortSide(input.resolution, Number(d.shortSide ?? 1080));
+ values.shortSide = shortSide;
+ if (b.framesPerBatch && extra.framesPerBatch === undefined) {
+ const seedvr = /seedvr/i.test(manifest.id);
+ // ESRGAN on a big source (1440p → 2160p: about 0.85 GB a frame): down to one frame a pass, to stay near the budget.
+ values.framesPerBatch = framesPerPass(facts, { shortSide, modelScale: seedvr ? 0 : 4, fourNPlusOne: seedvr, min: seedvr ? 5 : 1, max: seedvr ? 33 : 64, fallback: Number(d.framesPerBatch ?? 16) });
+ }
+ } else if (b.framesPerBatch && manifest.capability === "export-video" && extra.framesPerBatch === undefined) {
+ values.framesPerBatch = framesPerPass(facts, { min: 8, max: 256, fallback: Number(d.framesPerBatch ?? 64) });
+ }
+ return out;
+}
+
+ /** Per-job length limits a graph enforces (manifest limits.maxDurationSec), in words. */
+ const OVER_LIMIT: Record<string, (s: number) => string> = {
+ "still-motion": (s) => `Ken Burns on the open engine makes up to ${s} s per clip — split a longer move into pieces`,
+ "audio-loop": (s) => `Loops on the open engine run up to ${s / 60} minutes (${s} s)`,
+ };
+
/**
* Turn a canonical request into the exact ComfyUI prompt: picks the workflow variant, maps Fuobe's inputs
* onto the workflow's bindings (sizes, frames, trim times, languages, palettes, layers…), uploads files the
@@@ -886,10 -671,14 +923,17 @@@ export async function prepareWorkflow(e
throw new ProviderError((e as Error).message);
}
}
+ // Joins of more clips than the template binds: one loader per clip, in one prompt.
+ try {
+ if (manifest.expand === "videos" && clips.length > 2) wf = expandVideoJoinWorkflow(wf, clips);
+ if (manifest.expand === "audios" && audios.length > 2) wf = expandAudioJoinWorkflow(wf, audios);
+ } catch (e) {
+ throw new ProviderError((e as Error).message);
+ }
if (input.loras?.length) wf = injectLoras(wf, input.loras);
+ // The output not asked for isn't saved (nor encoded: ComfyUI runs only what an output node needs).
+ if (keepRole && manifest.outputs.some((o) => o.role === keepRole)) for (const o of manifest.outputs) if (o.role && o.role !== keepRole) delete wf[o.node];
+ if (ctx.op === "remove-object" && !handOff) for (const o of manifest.outputs) if (o.role === "mask") delete wf[o.node];
const metaBatch = Object.values(wf).some((n) => n.class_type === "VHS_BatchManager");
return {
manifest,
diff --cc workflows/comfyui/manifest.json
index 940b0a1e,ccc9f42b..8cd518b1
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@@ -1,6 -1,6 +1,6 @@@
{
"version": 1,
- "generatedAt": "2026-10-23T22:48:01.569Z",
- "generatedAt": "2026-10-23T01:05:11.311Z",
++ "generatedAt": "2026-10-24T05:04:42.430Z",
"comfyuiCommit": "fc04da91b2ab12f99e4716371a7e4f98ac982597",
"comfyuiVersion": "0.41.0",
"workflowTemplatesVersion": "0.11.86",