The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Split soundtrack: the remix graph validated on ComfyUI, and tests for Assist's and MCP's soundtrack tools
Claude781fc915b908
diff --git a/scripts/comfy/validation-state.json b/scripts/comfy/validation-state.jsonindex 790055aa..0d03accf 100644--- a/scripts/comfy/validation-state.json+++ b/scripts/comfy/validation-state.json@@ -459,7 +459,7 @@"sha256": "446a72103ae501fe15e3f8a196a9321d378990e8a4eddef268f7b1defb5aed35","validated": true,"error": null,- "at": "2026-10-29T17:59:49.683Z"+ "at": "2026-11-02T11:18:01.057Z"},"sfx-hunyuan-foley": {"sha256": "54a10b4f9586f3e65c0f9cd1bcedf02d1842e3bf73df9dd98304eef0f07b212a",@@ -497,6 +497,12 @@"error": null,"at": "2026-10-17T21:02:06.266Z"},+ "soundtrack-remix-dbs": {+ "sha256": "af4e32587e3b53a8206aae43e36f62a359b5a25ecc03ff63e5002377bfb4a114",+ "validated": true,+ "error": null,+ "at": "2026-11-02T11:18:01.187Z"+ },"speech-translate-gemma4": {"sha256": "baf609432b57514c43d2f91630b9ae3cb916e9fe8dab47ac02c6c9b64ded643a","validated": true,diff --git a/tests/assist-soundtrack-tools.test.ts b/tests/assist-soundtrack-tools.test.tsnew file mode 100644index 00000000..d76987ce--- /dev/null+++ b/tests/assist-soundtrack-tools.test.ts@@ -0,0 +1,302 @@+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { afterAll, beforeAll, describe, expect, it } from "vitest";+import type { Engine, Generation, GenInput } from "@/lib/catalog/types";++// DBS D9 (docs/research/dbs-separation-7.md §8 and §9 D9): Assist's and MCP's split_soundtrack and remove_dialogue. What+// a call returns (stems, one stem, one remix), graph C (soundtrack-remix-dbs) as the remix's variant, the open engine+// only (the cloud refuses: samAudioCloud is false), price first (estimate_job), and the offline planner's suggestions.+const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-soundtrack-tools-"));+process.env.FUOBE_DATA_DIR = dir;+// Nothing listens: the open models run on the demo provider.+process.env.COMFYUI_URL = "http://127.0.0.1:9";+process.env.OLLAMA_URL = "http://127.0.0.1:9";++const { setSetting } = await import("@/server/settings");+const { saveFile } = await import("@/server/storage");+const tools = await import("@/server/assist/tools");+const studio = await import("@/server/assist/studio-tools");+const agent = await import("@/server/assist/agent");+const { handleMcp } = await import("@/server/mcp");+const gens = await import("@/server/generations");+const { prepareWorkflow } = await import("@/server/providers/comfyui");+const { resolveWorkflowId } = await import("@/lib/comfy-variants");+const split = await import("@/lib/av/split");+const { CLOUD_ONLY_REMOVE_PROBLEM, CLOUD_REMOVE_PROBLEM } = await import("@/lib/av/remove-dialogue");++beforeAll(() => setSetting("demoMode", "auto"));+afterAll(() => {+ try {+ fs.rmSync(dir, { recursive: true, force: true });+ } catch {}+});++const plan = (name: string, input: unknown, engine: Engine = "cloud") => tools.planFor(name, input, { engine });+const run = (name: string, input: unknown, engine: Engine = "cloud") => tools.executeTool(name, input, { engine });+const rpc = (method: string, params?: unknown) => handleMcp({ jsonrpc: "2.0", id: 1, method, params });++/** A two-second 16-bit stereo WAV. */+function wav(name = "film.wav"): string {+ const rate = 8000;+ const n = rate * 2;+ const buf = Buffer.alloc(44 + n * 4);+ buf.write("RIFF", 0);+ buf.writeUInt32LE(36 + n * 4, 4);+ buf.write("WAVEfmt ", 8);+ buf.writeUInt32LE(16, 16);+ buf.writeUInt16LE(1, 20);+ buf.writeUInt16LE(2, 22);+ buf.writeUInt32LE(rate, 24);+ buf.writeUInt32LE(rate * 4, 28);+ buf.writeUInt16LE(4, 32);+ buf.writeUInt16LE(16, 34);+ buf.write("data", 36);+ buf.writeUInt32LE(n * 4, 40);+ return saveFile({ data: buf, contentType: "audio/wav", name, source: "upload" }).url;+}++/** A small MP4 with a video track and (unless null) a stereo AAC track, 2 s each. */+function mp4(channels: number | null = 2, name = "interview.mp4"): string {+ const u32 = (...v: number[]) => Buffer.concat(v.map((x) => Buffer.from([x >>> 24, (x >>> 16) & 255, (x >>> 8) & 255, x & 255])));+ const box = (type: string, ...parts: Buffer[]) => {+ const body = Buffer.concat(parts);+ return Buffer.concat([u32(8 + body.length), Buffer.from(type), body]);+ };+ const trak = (handler: string, ...stbl: Buffer[]) =>+ box("trak", box("mdia", box("mdhd", u32(0, 0, 0, 1000, 2000), Buffer.alloc(4)), box("hdlr", u32(0, 0), Buffer.from(handler), Buffer.alloc(12)), box("minf", box("stbl", ...stbl))));+ const entry = Buffer.alloc(28);+ entry.writeUInt16BE(1, 6);+ entry.writeUInt16BE(channels ?? 2, 16);+ entry.writeUInt16BE(16, 18);+ const sound = channels === null ? [] : [trak("soun", box("stsd", u32(0, 1), box("mp4a", entry)))];+ const data = Buffer.concat([box("ftyp", Buffer.from("isom"), u32(0)), box("moov", box("mvhd", u32(0, 0, 0, 1000, 2000), Buffer.alloc(80)), trak("vide", box("stts", u32(0, 1, 50, 40))), ...sound)]);+ return saveFile({ data, contentType: "video/mp4", name, source: "upload" }).url;+}++async function finished(id: string): Promise<Generation> {+ const deadline = Date.now() + 15_000;+ let g = gens.getGeneration(id)!;+ while (g.status !== "succeeded" && g.status !== "failed" && Date.now() < deadline) {+ await new Promise((r) => setTimeout(r, 200));+ g = gens.getGeneration(id)!;+ }+ return g;+}++describe("what split_soundtrack returns (splitOutcome)", () => {+ it("all four stems, one stem, music & effects as the background stem, or a mix", () => {+ expect(split.splitOutcome()).toEqual({ kind: "stems" });+ expect(split.splitOutcome(["dialogue", "music", "effects"])).toEqual({ kind: "stems" });+ expect(split.splitOutcome(["music"])).toEqual({ kind: "stem", stem: "music" });+ expect(split.splitOutcome(["dialogue"])).toEqual({ kind: "stem", stem: "voice" });+ expect(split.splitOutcome(["effects", "music"])).toEqual({ kind: "stem", stem: "background" });+ // Dialogue with one of the others isn't one stem: one mix, the rest left out.+ expect(split.splitOutcome(["dialogue", "effects"])).toEqual({ kind: "mix", levels: { voiceDb: 0, musicDb: split.REMIX_OUT_DB, effectsDb: 0 } });+ });++ it("levels make one mix: whole dB, clamped, a stem not kept left out", () => {+ expect(split.splitOutcome(undefined, { music: -12.4 })).toEqual({ kind: "mix", levels: { voiceDb: 0, musicDb: -12, effectsDb: 0 } });+ expect(split.splitOutcome(["dialogue", "music"], { dialogue: 40, music: -90, effects: 3 })).toEqual({+ kind: "mix",+ levels: { voiceDb: split.REMIX_MAX_DB, musicDb: split.REMIX_MIN_DB, effectsDb: split.REMIX_OUT_DB },+ });+ // A level only for a stem that isn't kept changes nothing: the music stem.+ expect(split.splitOutcome(["music"], { dialogue: -6 })).toEqual({ kind: "stem", stem: "music" });+ expect(() => split.splitOutcome([])).toThrow("Keep at least one of dialogue, music or effects");+ expect(split.remixWords({ voiceDb: 0, musicDb: -12, effectsDb: split.REMIX_OUT_DB })).toBe("Dialogue + Music −12 dB");+ });++ it("a remix plan: one job with the levels, every channel of a stereo source", () => {+ const p = split.planSplit({ engine: "open", media: "/api/files/a.wav", kind: "audio", channels: 2, seconds: 10, remix: { voiceDb: 0, musicDb: -12, effectsDb: -100 } });+ expect(p.mode).toBe("each channel");+ expect(p.steps[0].request.params?.extra).toMatchObject({ remix: true, voiceDb: 0, musicDb: -12, effectsDb: -100, channels: "each channel" });+ expect(p.steps[0].request.title).toBe("Mix (Dialogue + Music −12 dB) · soundtrack");+ // A mono source stays one pass; asked for mono, a stereo one too.+ expect(split.planSplit({ engine: "open", media: "/api/files/a.wav", kind: "audio", channels: 1, remix: { voiceDb: 0, musicDb: 0, effectsDb: 0 } }).mode).toBe("mono");+ expect(split.planSplit({ engine: "open", media: "/api/files/a.wav", kind: "audio", channels: 2, stereo: false, remix: { voiceDb: 0, musicDb: 0, effectsDb: 0 } }).mode).toBe("mono");+ // Without levels: as the Audio hub's plan (mono, four stems).+ expect(split.planSplit({ engine: "open", media: "/api/files/a.wav", kind: "audio", channels: 2 }).steps[0].request.params?.extra).toEqual({ channels: "mono", sourceChannels: 2 });+ });+});++describe("graph C runs for a remix (soundtrack-remix-dbs)", () => {+ const has = () => true;+ const req = (extra: Record<string, unknown>) => ({ op: "separate-audio", clips: 0, images: 0, audio2: false, extra, has });++ it("is separate-soundtrack-dbs's variant for params.extra.remix", () => {+ expect(resolveWorkflowId("separate-soundtrack-dbs", req({ remix: true }))).toBe("soundtrack-remix-dbs");+ expect(resolveWorkflowId("separate-soundtrack-dbs", req({}))).toBe("separate-soundtrack-dbs");+ expect(resolveWorkflowId("separate-soundtrack-dbs", { ...req({ remix: true }), has: () => false })).toBe("separate-soundtrack-dbs");+ });++ it("binds the levels to Adjust Audio Volume and the DBS rules to the loader and the split", async () => {+ const input: GenInput = { seed: 1, audio: "film.wav", extra: { remix: true, voiceDb: -6, musicDb: -100, effectsDb: 3, channels: "each channel", separationModel: "DBS-TIGER-DnR" } };+ const { workflow } = await prepareWorkflow("soundtrack-remix-dbs", input, {+ generationId: "gen1",+ op: "separate-audio",+ upload: async (_d: unknown, _t: unknown, name: string) => `up_${name}`,+ media: () => ({ container: "wav", channels: 2 }),+ device: async () => "cpu",+ dbsModels: async () => undefined,+ } as never);+ expect(workflow["1"].inputs.audio).toBe("film.wav");+ expect(workflow["2"].inputs.model).toBe("DBS-TIGER-DnR");+ expect(workflow["3"].inputs.channels).toBe("each channel");+ expect([workflow["4"].inputs.volume, workflow["5"].inputs.volume, workflow["6"].inputs.volume]).toEqual([-6, -100, 3]);+ expect(workflow["9"]).toMatchObject({ class_type: "SaveAudioAdvanced", inputs: { format: "flac" } });+ });++ it("is in the manifest, validated, with its pack and the four DBS files on the GPU pre-flight's index", () => {+ const manifest = JSON.parse(fs.readFileSync(path.join(process.cwd(), "workflows/comfyui/manifest.json"), "utf8"));+ const w = manifest.workflows.find((x: { id: string }) => x.id === "soundtrack-remix-dbs");+ expect(w).toMatchObject({ capability: "separate-audio", validated: true, outputs: [{ node: "9", kind: "audio", role: "mix" }] });+ const reqs = JSON.parse(fs.readFileSync(path.join(process.cwd(), "workflows/comfyui/requirements.json"), "utf8"));+ const r = reqs.workflows?.["soundtrack-remix-dbs"] ?? reqs["soundtrack-remix-dbs"];+ expect(r.packs).toEqual({ "ComfyUI-DBS": ["DBSLoader", "DBSSeparate"] });+ expect(r.files).toHaveLength(4);+ });+});++describe("split_soundtrack and remove_dialogue as tools", () => {+ it("are gated studio tools, listed for Assist and over MCP, priced by estimate_job", async () => {+ for (const name of ["split_soundtrack", "remove_dialogue"]) {+ const t = tools.getTool(name)!;+ expect(t.gated).toBe(true);+ expect(t.description).toMatch(/there is no hosted DBS, so the cloud engine refuses it/);+ }+ const list = (await rpc("tools/list")) as { result: { tools: { name: string; inputSchema: { properties?: Record<string, unknown>; enum?: string[] } }[] } };+ const names = list.result.tools.map((t) => t.name);+ expect(names).toEqual(expect.arrayContaining(["split_soundtrack", "remove_dialogue", "estimate_job"]));+ const est = list.result.tools.find((t) => t.name === "estimate_job")!;+ expect((est.inputSchema.properties!.tool as { enum: string[] }).enum).toEqual(expect.arrayContaining(["split_soundtrack", "remove_dialogue"]));+ const init = (await rpc("initialize", { protocolVersion: "2025-11-25" })) as { result: { instructions: string; serverInfo: { version: string } } };+ expect(init.result.serverInfo.version).toBe("1.4.0");+ expect(init.result.instructions).toMatch(/split_soundtrack/);+ expect(init.result.instructions).toMatch(/remove_dialogue/);+ });++ it("validates its arguments: levels in range, keep from the three stems, music_db 0 to −30", () => {+ expect(plan("split_soundtrack", { media: "/api/files/x.wav", keep: ["voice"] }).error).toBeTruthy();+ expect(plan("split_soundtrack", { media: "/api/files/x.wav", levels_db: { music: -80 } }).error).toBeTruthy();+ expect(plan("remove_dialogue", { video: "/api/files/x.mp4", music_db: -40 }).error).toBeTruthy();+ expect(plan("remove_dialogue", { video: "/api/files/x.mp4", keep: "music" }).error).toBeTruthy();+ });++ it("prices a split first: free on the open engine (demo here), one step, the studio's page", () => {+ const media = wav("song.wav");+ // The chat's engine is the cloud: the tool still runs on the open engine unless asked otherwise.+ const p = plan("split_soundtrack", { media, keep: ["music"] });+ expect(p.error).toBeUndefined();+ expect(p.jobs).toHaveLength(1);+ expect(p.jobs[0]).toMatchObject({ tool: "split_soundtrack", modelId: "oss-dbs-separate", op: "separate-audio", costUsd: 0, demo: true, atomic: true });+ expect(p.jobs[0].error).toBeUndefined();+ expect(p.total).toBe(0);+ expect(p).toMatchObject({ studio: "Split soundtrack", href: "/audio/split" });+ });++ it("prices Remove dialogue as the page's two steps (the split, then the stream-copy mux)", () => {+ const video = mp4();+ const p = plan("remove_dialogue", { video, music_db: -18 });+ expect(p.jobs.map((j) => [j.modelId, j.op, j.costUsd, !!j.error])).toEqual([+ ["oss-dbs-separate", "separate-audio", 0, false],+ ["oss-mux", "mux", 0, false],+ ]);+ expect(p).toMatchObject({ studio: "Remove dialogue", href: "/video-tools/remove-dialogue" });+ });++ it("refuses the cloud engine and a paid-APIs-only install in words, before anything is queued", async () => {+ const media = wav("cloud.wav");+ const video = mp4(2, "cloud.mp4");+ expect(plan("split_soundtrack", { media, engine: "cloud" }).jobs[0].error).toBe(split.CLOUD_SPLIT_PROBLEM);+ expect(plan("remove_dialogue", { video, engine: "cloud" }).jobs[0].error).toBe(CLOUD_REMOVE_PROBLEM);+ const before = gens.listGenerations({ limit: 500 }).length;+ const out = await run("split_soundtrack", { media, engine: "cloud" });+ expect(out.isError).toBe(true);+ expect(JSON.parse(out.content as string).error).toBe(split.CLOUD_SPLIT_PROBLEM);+ setSetting("engineMode", "cloud");+ try {+ expect(plan("split_soundtrack", { media }).jobs[0].error).toBe(split.CLOUD_ONLY_PROBLEM);+ expect(plan("remove_dialogue", { video }).jobs[0].error).toBe(CLOUD_ONLY_REMOVE_PROBLEM);+ expect((await run("remove_dialogue", { video })).isError).toBe(true);+ } finally {+ setSetting("engineMode", "both");+ }+ expect(gens.listGenerations({ limit: 500 }).length).toBe(before);+ });++ it("refuses what the pages refuse: a silent video, an image, keep 'bed' with music_db, a file that is gone", () => {+ expect(plan("remove_dialogue", { video: mp4(null, "silent.mp4") }).jobs[0].error).toBe("This clip has no sound");+ expect(plan("split_soundtrack", { media: "/api/files/uploads/still.png" }).jobs[0].error).toMatch(/Pass an audio file or a video/);+ expect(plan("remove_dialogue", { video: wav("speech.wav") }).jobs[0].error).toMatch(/use split_soundtrack for an audio file/);+ expect(plan("remove_dialogue", { video: mp4(2, "bed.mp4"), keep: "bed", music_db: -12 }).jobs[0].error).toMatch(/music_db lowers the music/);+ expect(plan("split_soundtrack", { media: "/api/files/uploads/gone.wav" }).jobs[0].error).toBe("That audio file is gone — add it again");+ expect(plan("split_soundtrack", { media: wav("none.wav"), keep: [] }).jobs[0].error).toBe("Keep at least one of dialogue, music or effects");+ });++ it("runs a split into the Library and says which stem to pick", async () => {+ const out = await run("split_soundtrack", { media: wav("run.wav"), keep: ["music"] });+ expect(out.isError).toBeFalsy();+ const body = JSON.parse(out.content as string);+ expect(body).toMatchObject({ tool: "Split soundtrack", href: "/audio/split", engine: "open", costUsd: 0, demo: true });+ expect(body.returns).toMatch(/music stem/);+ expect(out.items).toEqual([expect.objectContaining({ role: "tool", href: "/audio/split" }), { id: "", role: "generations", ids: [body.result] }]);+ const g = await finished(body.result);+ expect(g.status).toBe("succeeded");+ expect(g.outputs.map((o) => o.meta?.stem)).toEqual(["voice", "music", "effects", "background"]);+ }, 30_000);++ it("runs a remix as one mixed file (graph C)", async () => {+ const out = await run("split_soundtrack", { media: wav("remix.wav"), levels_db: { music: -12 }, keep: ["dialogue", "music"] });+ const body = JSON.parse(out.content as string);+ expect(body.returns).toBe("one mixed file: Dialogue + Music −12 dB");+ const g = await finished(body.result);+ expect(g.request.params?.extra).toMatchObject({ remix: true, voiceDb: 0, musicDb: -12, effectsDb: -100 });+ expect(g.outputs).toHaveLength(1);+ expect(g.outputs[0]).toMatchObject({ kind: "audio" });+ expect(g.outputs[0].meta?.role).toBe("mix");+ }, 30_000);++ it("runs Remove dialogue as the page does: the split, then the mux with the background stem", async () => {+ const out = await run("remove_dialogue", { video: mp4(2, "run.mp4") });+ const body = JSON.parse(out.content as string);+ expect(body.steps).toHaveLength(2);+ expect(body.returns).toMatch(/music and effects only/);+ const g = await finished(body.result);+ expect(g).toMatchObject({ modelId: "oss-mux", op: "mux", status: "succeeded" });+ expect(g.request.chain).toEqual([{ slot: "audio", stem: "background" }]);+ }, 30_000);++ it("builds the pages' own requests (the exported builders)", () => {+ const v = mp4(2, "b.mp4");+ expect(studio.removeDialogueBody({ video: v, keep: "dialogue" }).body).toMatchObject({ tool: "remove-dialogue", engine: "open", outcome: "dialogue-only" });+ expect(studio.removeDialogueBody({ video: v, music_db: -9.6 }).body).toMatchObject({ outcome: "lower-music", musicDb: -10 });+ expect(studio.splitSoundtrackBody({ media: v, quality: "best" }).body).toMatchObject({ tool: "split", kind: "video", quality: "best" });+ });+});++describe("the offline planner", () => {+ const attached = (kind: string, url: string) => `\n\nAttached files (use these URLs):\n- ${kind} 1: ${url}`;++ it("'Remove the dialogue from this video' with a video attached: remove_dialogue", () => {+ const v = "/api/files/uploads/clip.mp4";+ expect(agent.offlinePlan(`Remove the dialogue from this video${attached("video", v)}`, "cloud")).toMatchObject({ tool: "remove_dialogue", input: { video: v } });+ expect(agent.offlinePlan(`keep just the dialogue${attached("video", v)}`, "open")).toMatchObject({ tool: "remove_dialogue", input: { video: v, keep: "dialogue" } });+ expect(agent.offlinePlan(`lower the music under the talking by 18 dB${attached("video", v)}`, "open")).toMatchObject({ tool: "remove_dialogue", input: { video: v, music_db: -18 } });+ });++ it("'just the music' with a file attached: split_soundtrack", () => {+ const a = "/api/files/uploads/song.wav";+ expect(agent.offlinePlan(`give me just the music${attached("audio", a)}`, "open")).toMatchObject({ tool: "split_soundtrack", input: { media: a, keep: ["music"] } });+ expect(agent.offlinePlan(`remove the vocals${attached("audio", a)}`, "open")).toMatchObject({ tool: "split_soundtrack", input: { media: a, keep: ["music", "effects"] } });+ expect(agent.offlinePlan(`split the soundtrack into stems${attached("video", "/api/files/v.mp4")}`, "open")).toMatchObject({ tool: "split_soundtrack", input: { media: "/api/files/v.mp4" } });+ });++ it("asks for the file when none is attached, and leaves new pieces alone", () => {+ expect(agent.offlineSoundtrack("Remove the dialogue from this video")).toEqual({ say: expect.stringMatching(/Attach the video/) });+ expect(agent.offlineSoundtrack("write a song with no vocals")).toBeNull();+ expect(agent.offlineSoundtrack("a cinematic video of a lighthouse, no dialogue")).toBeNull();+ expect(agent.offlinePlan("a cinematic video of a lighthouse, no dialogue", "cloud")?.tool).toBe("generate");+ expect(agent.offlineSoundtrack("a red fox in the snow")).toBeNull();+ });+});diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.jsonindex 2e3544dd..258ee07d 100644--- a/workflows/comfyui/manifest.json+++ b/workflows/comfyui/manifest.json@@ -1,6 +1,6 @@{"version": 1,- "generatedAt": "2026-11-02T01:24:28.192Z",+ "generatedAt": "2026-11-02T11:17:46.843Z","comfyuiCommit": "fc04da91b2ab12f99e4716371a7e4f98ac982597","comfyuiVersion": "0.41.0","workflowTemplatesVersion": "0.11.86",@@ -16533,6 +16533,111 @@"validated": true,"notes": "CPU OK, about 1.7 GiB on CUDA. audio = an audio file or a video (LoadAudio reads a video's soundtrack without decoding frames). DBSLoader model DBS-BSRNN-DnR (fast: 18.9 MB, 9.07 dB SI-SDR on DnR v2, the CPU default) or DBS-TIGER-DnR (best: 4.1 MB, 10.13 dB, about 3x slower on a CPU, the CUDA default); device auto. Measured on a 4-CPU host (torch 2.14.1+cpu, 10-20 s clips): DBS-BSRNN 0.17-0.33x real time per channel, DBS-TIGER 0.08-0.09x. DBSSeparate channels mono (the mean of the channels, the official usage) or each channel (stereo stems: every channel separated on its own, 2x the time); output_sample_rate input. ComfyUI saves audio as mono or stereo only (a 5.1 waveform comes out as scrambled stereo three times as long), so the provider splits a file with more than 2 channels in mono and makes its background from music + effects (node 4 rewired to AudioMerge add) rather than the original minus the speech. Outputs in order: voice (speech), music, effects (sfx), background = original minus speech (AudioMerge subtract: with mono it keeps the original stereo image at mono cost; AudioMerge scales the whole result down when it peaks over 1.0), and the pack's JSON report (model, device, rates, windows, seconds, times real time). Voice + background add up to the source, except on a loud master where AudioMerge had to lower the background to fit under full scale (FLAC holds no more). Voice is first, so a chain without a stem takes the dialogue. Trained on synthetic English mixes (DnR v2): dialogue separates well (15-16 dB), music against effects less so (5.7-7.8 dB). Some FSD50K and FMA clips inside DnR v2 carry their own CC licences, NC variants included; whether that reaches the weights or their outputs is unresolved (recorded as information)."},+ {+ "id": "soundtrack-remix-dbs",+ "title": "Remix a soundtrack: dialogue, music and effects each at their own level (DBS, ComfyUI-DBS)",+ "capability": "separate-audio",+ "file": "soundtrack-remix-dbs.json",+ "source": "hand-built (scripts/comfy/hand-built/soundtrack-remix-dbs.json)",+ "bindings": {+ "audio": [+ {+ "node": "1",+ "input": "audio"+ }+ ],+ "separationModel": [+ {+ "node": "2",+ "input": "model"+ }+ ],+ "channels": [+ {+ "node": "3",+ "input": "channels"+ }+ ],+ "voiceDb": [+ {+ "node": "4",+ "input": "volume"+ }+ ],+ "musicDb": [+ {+ "node": "5",+ "input": "volume"+ }+ ],+ "effectsDb": [+ {+ "node": "6",+ "input": "volume"+ }+ ],+ "filenamePrefix": [+ {+ "node": "9",+ "input": "filename_prefix"+ }+ ]+ },+ "outputs": [+ {+ "node": "9",+ "kind": "audio",+ "role": "mix"+ }+ ],+ "defaults": {+ "separationModel": "DBS-BSRNN-DnR",+ "channels": "mono",+ "voiceDb": 0,+ "musicDb": 0,+ "effectsDb": 0+ },+ "limits": {},+ "models": [+ {+ "file": "DBS-BSRNN-DnR/model.safetensors",+ "folder": "dbs",+ "url": "https://huggingface.co/JusperLee/DBS-BSRNN-DnR/resolve/5af343f57f106fbb95efe8a60f1a3999eeb0aef8/model.safetensors",+ "sizeGb": 0.02+ },+ {+ "file": "DBS-BSRNN-DnR/config.json",+ "folder": "dbs",+ "url": "https://huggingface.co/JusperLee/DBS-BSRNN-DnR/resolve/5af343f57f106fbb95efe8a60f1a3999eeb0aef8/config.json",+ "sizeGb": 0+ },+ {+ "file": "DBS-TIGER-DnR/model.safetensors",+ "folder": "dbs",+ "url": "https://huggingface.co/JusperLee/DBS-TIGER-DnR/resolve/22da7d4cd3ea63f9365181008bff1c0d2ab6fb2b/model.safetensors",+ "sizeGb": 0.004+ },+ {+ "file": "DBS-TIGER-DnR/config.json",+ "folder": "dbs",+ "url": "https://huggingface.co/JusperLee/DBS-TIGER-DnR/resolve/22da7d4cd3ea63f9365181008bff1c0d2ab6fb2b/config.json",+ "sizeGb": 0+ }+ ],+ "customNodes": [+ {+ "name": "ComfyUI-DBS",+ "repo": "https://github.com/hiroki-abe-58/ComfyUI-DBS/tree/f656e53434b5485c148a2866fbd6ddc6b6152ed6"+ }+ ],+ "vramGb": 0,+ "license": "DBS weights Apache-2.0 (JusperLee; trained on DnR v2, CC BY 4.0); ComfyUI-DBS code MIT; vendored DBS code Apache-2.0 with MIT notices (BS-RoFormer, MSST, TIGER)",+ "validated": true,+ "notes": "CPU OK, about 1.7 GiB on CUDA. Graph A's split (LoadAudio, DBSLoader, DBSSeparate) with each stem through core Adjust Audio Volume (whole dB, -100..100; -100 takes a stem out) and added back with two AudioMerge add nodes: one FLAC, the mix. AudioMerge scales the whole sum down when it peaks over 1.0 (a crude limiter), so a loud mix comes out a little quieter than asked. With channels mono the mix is mono: the provider asks for each channel on a stereo source (2x the time), and a source with more than 2 channels runs in mono (ComfyUI saves mono or stereo only).",+ "buildWarnings": [+ "model DBS-BSRNN-DnR/config.json: https://huggingface.co/JusperLee/DBS-BSRNN-DnR/resolve/5af343f57f106fbb95efe8a60f1a3999eeb0aef8/config.json -> no size (HTTP 200)"+ ]+ },{"id": "voice-clean-reuse","title": "Clean up voice: noise, echo, clipping and codec damage removed from speech (NVIDIA RE-USE, ComfyUI-RE-USE)",diff --git a/workflows/comfyui/requirements.json b/workflows/comfyui/requirements.jsonindex 007e01f8..56037e1a 100644--- a/workflows/comfyui/requirements.json+++ b/workflows/comfyui/requirements.json@@ -1,6 +1,6 @@{"v": 1,- "hash": "d519066f28eb85ed60dd0e6a34906d68dd3557910c0c1d14046782e4e15e96d2",+ "hash": "677e89a4e28116b97cadb615af6b300368f611e22a669b5232f17c3a6474548a","comfyui": {"min":"0.41.0","testedCommit":"fc04da91"},"folders": ["audio_encoders","background_removal","checkpoints","clip_vision","dbs","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","text_encoders","thinksound","upscale_models","vae"],"sentinels": ["AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3SLAAttention","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","PasteBackFuobeLive","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],@@ -368,6 +368,7 @@"sfx-stable-audio-open": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","EmptyLatentAudio","KSampler","SaveAudioAdvanced","VAEDecodeAudio"],"packs":{},"files":["checkpoints/stable-audio-open-1.0.safetensors","text_encoders/t5-base.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[],"validated":true},"sfx-thinksound": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-ThinkSound_Wrapper":["ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler"]},"files":["thinksound/synchformer_state_dict.pth","thinksound/thinksound_light.ckpt","thinksound/vae.ckpt"],"optional":[],"vramGb":12,"isolated":true,"firstRun":["ThinkSoundFeatureUtilsLoader fetches google/t5-v1_1-xl and facebook/metaclip-h14 into the Hugging Face cache on first run"],"validated":true},"soul-cast-sheet-zimage": {"core":["CLIPLoader","CLIPTextEncode","ConditioningZeroOut","EmptySD3LatentImage","KSampler","ModelSamplingAuraFlow","SaveImage","StringConcatenate","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-KJNodes":["ImageGridtoBatch"]},"files":["diffusion_models/z_image_turbo_bf16.safetensors","text_encoders/qwen_3_4b.safetensors","vae/ae.safetensors"],"optional":[],"vramGb":14,"isolated":false,"firstRun":[],"validated":true},+ "soundtrack-remix-dbs": {"core":["AudioAdjustVolume","AudioMerge","LoadAudio","SaveAudioAdvanced"],"packs":{"ComfyUI-DBS":["DBSLoader","DBSSeparate"]},"files":["dbs/DBS-BSRNN-DnR/config.json","dbs/DBS-BSRNN-DnR/model.safetensors","dbs/DBS-TIGER-DnR/config.json","dbs/DBS-TIGER-DnR/model.safetensors"],"optional":[],"vramGb":0,"isolated":false,"firstRun":[]},"speech-translate-gemma4": {"core":["CLIPLoader","LoadAudio","SaveText","TextGenerate"],"packs":{},"files":["text_encoders/gemma4_e4b_it_fp8_scaled.safetensors"],"optional":[],"vramGb":12,"isolated":false,"firstRun":[],"validated":true},"still-to-clip": {"core":["ComfyMathExpression","CreateVideo","EmptyAudio","ImageScale","LoadImage","PrimitiveFloat","RepeatImageBatch","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},"storyboard-qwen-edit-2509-next-scene": {"core":["CFGNorm","CLIPLoader","FluxKontextImageScale","KSampler","LoadImage","LoraLoaderModelOnly","ModelSamplingAuraFlow","PrimitiveFloat","PrimitiveInt","SaveImageAdvanced","StringConcatenate","TextEncodeQwenImageEditPlus","UNETLoader","VAEDecode","VAEEncode","VAELoader"],"packs":{},"files":["diffusion_models/qwen_image_edit_2509_fp8_e4m3fn.safetensors","loras/Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors","loras/next-scene_lora-v2-3000.safetensors","text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors","vae/qwen_image_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},diff --git a/workflows/comfyui/soundtrack-remix-dbs.json b/workflows/comfyui/soundtrack-remix-dbs.jsonnew file mode 100644index 00000000..749a5194--- /dev/null+++ b/workflows/comfyui/soundtrack-remix-dbs.json@@ -0,0 +1,126 @@+{+ "1": {+ "class_type": "LoadAudio",+ "inputs": {+ "audio": "input.wav"+ },+ "_meta": {+ "title": "Soundtrack to remix (audio, or a video with sound)"+ }+ },+ "2": {+ "class_type": "DBSLoader",+ "inputs": {+ "model": "DBS-BSRNN-DnR",+ "device": "auto"+ },+ "_meta": {+ "title": "DBS Loader"+ }+ },+ "3": {+ "class_type": "DBSSeparate",+ "inputs": {+ "model": [+ "2",+ 0+ ],+ "audio": [+ "1",+ 0+ ],+ "channels": "mono",+ "output_sample_rate": "input"+ },+ "_meta": {+ "title": "DBS Separate (music / sfx / speech)"+ }+ },+ "4": {+ "class_type": "AudioAdjustVolume",+ "inputs": {+ "audio": [+ "3",+ 2+ ],+ "volume": 0+ },+ "_meta": {+ "title": "Dialogue level (dB)"+ }+ },+ "5": {+ "class_type": "AudioAdjustVolume",+ "inputs": {+ "audio": [+ "3",+ 0+ ],+ "volume": 0+ },+ "_meta": {+ "title": "Music level (dB)"+ }+ },+ "6": {+ "class_type": "AudioAdjustVolume",+ "inputs": {+ "audio": [+ "3",+ 1+ ],+ "volume": 0+ },+ "_meta": {+ "title": "Effects level (dB)"+ }+ },+ "7": {+ "class_type": "AudioMerge",+ "inputs": {+ "audio1": [+ "4",+ 0+ ],+ "audio2": [+ "5",+ 0+ ],+ "merge_method": "add"+ },+ "_meta": {+ "title": "Dialogue + music"+ }+ },+ "8": {+ "class_type": "AudioMerge",+ "inputs": {+ "audio1": [+ "7",+ 0+ ],+ "audio2": [+ "6",+ 0+ ],+ "merge_method": "add"+ },+ "_meta": {+ "title": "+ effects"+ }+ },+ "9": {+ "class_type": "SaveAudioAdvanced",+ "inputs": {+ "audio": [+ "8",+ 0+ ],+ "filename_prefix": "fuobe/soundtrack-remix-dbs",+ "format": "flac"+ },+ "_meta": {+ "title": "The remix"+ }+ }+}