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: a plain split opens the mixer on Original, and Canvas Clean up voice offers only your GPU's model
Claude11d3901f708d
diff --git a/src/components/audio-tools/split-tool.tsx b/src/components/audio-tools/split-tool.tsxindex 9820c649..cb73f78f 100644--- a/src/components/audio-tools/split-tool.tsx+++ b/src/components/audio-tools/split-tool.tsx@@ -60,7 +60,7 @@ import { cn } from "@/lib/utils";import { responseError, toastError } from "@/lib/refusals";import { useAudioToolPreview, useAudioToolRun, useSettled, type AudioToolBody } from "./hooks";import { CleanDialoguePanel } from "./clean-dialogue-panel";-import { CLEAN_DIALOGUE_PRESET } from "@/lib/av/clean-dialogue";+import { CLEAN_DIALOGUE_PRESET, mixPresetFor } from "@/lib/av/clean-dialogue";/*** Audio → Split soundtrack (DBS D1). Drop a song, podcast, film clip or video; DBS splits it into Dialogue, Music,@@ -712,9 +712,11 @@ export function SplitSoundtrackTool({ tabs }: { tabs?: React.ReactNode }) {setMixPreset(CLEAN_DIALOGUE_PRESET);}, []);useHandoff(take, arrive);+ // The mixer opens on the Clean dialogue preset only from Clean up dialogue ("Fine-tune in the mixer", or arriving+ // on the preset); picking Split into stems yourself opens it on the original mix.const pickGoal = (next: "split" | "clean") => {setGoal(next);- if (next === "clean") setMixPreset(CLEAN_DIALOGUE_PRESET);+ setMixPreset(mixPresetFor(next));};const ready = source && !source.uploading && source.ref ? source : null;const readyRef = ready?.ref;@@ -808,7 +810,10 @@ export function SplitSoundtrackTool({ tabs }: { tabs?: React.ReactNode }) {engine={engine}visitor={visitor}blocker={visitor ? SELF_HOSTED : !source ? "Add a soundtrack to clean" : source.uploading ? "Uploading…" : null}- onMixer={() => pickGoal("split")}+ onMixer={() => {+ setGoal("split");+ setMixPreset(mixPresetFor("split", true));+ }}/>)}{goal === "split" && source && engine === "cloud" && (diff --git a/src/lib/av/clean-dialogue.ts b/src/lib/av/clean-dialogue.tsindex 2b512f07..96df2bca 100644--- a/src/lib/av/clean-dialogue.ts+++ b/src/lib/av/clean-dialogue.ts@@ -26,6 +26,8 @@ export const EXTRACT_MODEL = "extract-soundtrack";/** The page's address for the tool (Split soundtrack, opened on Clean up dialogue). */export const CLEAN_DIALOGUE_PRESET = "clean-dialogue";+/** The preset Split soundtrack's mixer opens on for a task: Clean dialogue for that task or its "Fine-tune in the mixer". */+export const mixPresetFor = (goal: "split" | "clean", fromClean = false): string | null => (goal === "clean" || fromClean ? CLEAN_DIALOGUE_PRESET : null);export const cleanDialogueHref = (kind: "audio" | "video", url: string): string => `/audio/split?${kind}=${encodeURIComponent(url)}&preset=${CLEAN_DIALOGUE_PRESET}`;// ---------------------------------------------------------------------------diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.tsindex abead690..7113c8f4 100644--- a/src/lib/catalog/canvas.ts+++ b/src/lib/catalog/canvas.ts@@ -474,7 +474,10 @@ export function modelChoices(n: Pick<CanvasNode, "type" | "data">): ModelDef[] {}if (n.type === "concat") return Object.values(CONCAT_MODELS).flatMap((id) => getModel(id) ?? []);const ops = nodeOps(n);- return MODELS.filter((m) => ops.some((op) => supportsOp(m, op)) && (!m.hidden || ops.includes("frame")) && !needsMarks(m));+ // 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).+ const own = (m: ModelDef) => n.type !== "clean-voice" || runsOn(m, "open");+ return MODELS.filter((m) => ops.some((op) => supportsOp(m, op)) && (!m.hidden || ops.includes("frame")) && !needsMarks(m) && own(m));}// ---------------------------------------------------------------------------diff --git a/tests/clean-dialogue.test.ts b/tests/clean-dialogue.test.tsindex 3bdae048..6680fe7e 100644--- a/tests/clean-dialogue.test.ts+++ b/tests/clean-dialogue.test.ts@@ -9,6 +9,7 @@ import {cleanDialogueHref,cleanDialogueProblem,CLEANERS,+ mixPresetFor,CLOUD_NOTE,deepFilterNetPrice,OFF_DB,@@ -20,6 +21,7 @@ import {import { buildPayload, extractOutputs } from "@/lib/catalog/payload";import { estimateCost } from "@/lib/catalog/plan";import { getModel } from "@/lib/catalog";+import { defaultModelForNode, modelChoices } from "@/lib/catalog/canvas";import type { Generation, GenInput } from "@/lib/catalog/types";// Clean up dialogue (DBS D5): the plan per engine and cleaner, the cloud cleaners' prices and payloads against their@@ -232,6 +234,20 @@ describe("hand-offs and the GPU pre-flight board", () => {for (const g of [gen("audio", "music"), gen("audio", "sfx"), gen("audio", "separate-audio", CLEAN_DIALOGUE_FEATURE)]) expect(outputActions(g, 0).some((x) => x.id === "clean-dialogue")).toBe(false);});+ it("opens the mixer on Clean dialogue only from that task, and on the original mix for a plain split", () => {+ expect(mixPresetFor("clean")).toBe(CLEAN_DIALOGUE_PRESET);+ // "Fine-tune in the mixer" switches to Split into stems and keeps the preset.+ expect(mixPresetFor("split", true)).toBe(CLEAN_DIALOGUE_PRESET);+ // Picking Split into stems after visiting Clean up dialogue clears it.+ expect(mixPresetFor("split")).toBeNull();+ });++ it("leaves the Canvas Clean up voice node on your GPU: the hosted cleaners aren't in its picker", () => {+ const node = { type: "clean-voice" as const, data: {} };+ expect(defaultModelForNode(node, "cloud")).toBeUndefined();+ expect(modelChoices(node).map((m) => m.id)).toEqual(["oss-reuse-voice"]);+ });+it("has a row on the board: graph C and the mux", () => {const row = STUDIO_ROWS.find((r) => r.href === `/audio/split?preset=${CLEAN_DIALOGUE_PRESET}`)!;expect(row).toMatchObject({ label: "Clean up dialogue", group: "Audio" });@@ -282,12 +298,19 @@ describe("POST /api/audio-tools clean-dialogue (demo mode)", () => {it("prices each cloud cleaner on the file's length", async () => {const media = wav();const priced = async (cleaner: string) => (await (await post({ tool: "clean-dialogue", engine: "cloud", media, kind: "audio", cleaner }, true)).json()) as { costUsd: number | null; demo: boolean; steps: number };- const veed = await priced("veed");- const dfn = await priced("deepfilternet");- const iso = await priced("isolation");- expect([veed.steps, dfn.steps, iso.steps]).toEqual([1, 1, 1]);- // Demo mode runs the placeholder, but the price shown is the cleaner's.- if (!veed.demo) expect([veed.costUsd, dfn.costUsd, iso.costUsd]).toEqual([0.013, 0.002, 0.003]);+ // With a fal.ai key the price check takes the real route (a check never calls fal): the 2 s file at each cleaner's+ // price. VEED bills at least a minute ($0.0125), DeepFilterNet 3 $0.001/s, ElevenLabs $0.10/min of the clip.+ setSetting("falKey", "fal-test-key");+ try {+ const veed = await priced("veed");+ const dfn = await priced("deepfilternet");+ const iso = await priced("isolation");+ expect([veed.steps, dfn.steps, iso.steps]).toEqual([1, 1, 1]);+ expect([veed.demo, dfn.demo, iso.demo]).toEqual([false, false, false]);+ expect([veed.costUsd, dfn.costUsd, iso.costUsd]).toEqual([0.013, 0.002, 0.003]);+ } finally {+ setSetting("falKey", "");+ }});it("an install set to paid APIs only keeps the cloud cleaners and refuses the open remix", async () => {diff --git a/tests/e2e/clean-dialogue.mjs b/tests/e2e/clean-dialogue.mjsindex cefcf3a1..a7e5cbdd 100644--- a/tests/e2e/clean-dialogue.mjs+++ b/tests/e2e/clean-dialogue.mjs@@ -4,7 +4,8 @@// clip in, the open engine offers the level under the dialogue (−18 dB picked), says what it removes and how it relates// to Clean up voice, and prices it Free; the cloud engine offers VEED, DeepFilterNet 3 and ElevenLabs with a price and// says it gives the voice alone; no sideways scroll and no console errors. Then one demo run on the open engine gives a-// result, "Fine-tune in the mixer" switches to Split into stems, and a split's mixer opens on the Clean dialogue preset;+// result, "Fine-tune in the mixer" switches to Split into stems, and a split's mixer opens on the Clean dialogue preset+// (and back on Original once Split into stems is picked by hand after visiting Clean up dialogue);// last, a result's actions menu in the Library offers "Clean up dialogue". Screenshots go to outDir.import { spawnSync } from "node:child_process";import fs from "node:fs";@@ -93,6 +94,14 @@ try {await page.getByRole("heading", { name: "Stems and mixer" }).waitFor({ timeout: 40_000 });check((await page.getByRole("radio", { checked: true, name: "Clean dialogue (−18 dB)" }).count()) === 1, "run: the mixer opens on the Clean dialogue preset");await page.screenshot({ path: path.join(out, "clean-mixer.png"), fullPage: true });+ // Visiting Clean up dialogue and then picking Split into stems yourself puts the mixer back on the original mix.+ await page.getByRole("radio", { name: "Clean up dialogue" }).click();+ await page.getByRole("radio", { name: "Split into stems" }).click();+ await page.getByRole("heading", { name: "Stems and mixer" }).waitFor({ timeout: 40_000 });+ check(+ await page.getByRole("radio", { checked: true, name: "Original", exact: true }).waitFor({ timeout: 20_000 }).then(() => true, () => false),+ "run: Split into stems picked after Clean up dialogue opens the mixer on Original",+ );// ---- The hand-off on a result: the Library's actions menu (a phone's ⋯ button on each tile).const phone = await setup(browser, PHONE, "dark", "open");