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.

Split soundtrack: a remix graph that mixes dialogue, music and effects at their own levels

Claude989a710f32d5
diff --git a/scripts/comfy/build-library.mjs b/scripts/comfy/build-library.mjs
index 2beadfae..4e9a337e 100644
--- a/scripts/comfy/build-library.mjs
+++ b/scripts/comfy/build-library.mjs
@@ -162,6 +162,8 @@ export const BINDING_KEYS = new Set([
'invertDepth',
// nm10-qwen21-fast: the VAE file Options → Decoder picks (Qwen-Image 2.1) and a speed tier's sigma schedule for the canvas size
'vae', 'sigmas',
+ // originals (o/dbs-d9): graph C's stem levels (soundtrack-remix-dbs, Adjust Audio Volume in whole dB)
+ 'voiceDb', 'musicDb', 'effectsDb',
]);
// Sizes in GB: two decimals, and three where two would read 0 (a 4 MB DBS model), so no other entry's size changes.
diff --git a/scripts/comfy/hand-built/soundtrack-remix-dbs.json b/scripts/comfy/hand-built/soundtrack-remix-dbs.json
new file mode 100644
index 00000000..8e18ab58
--- /dev/null
+++ b/scripts/comfy/hand-built/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/dbs/mix",
+ "format": "flac"
+ },
+ "_meta": {
+ "title": "The remix"
+ }
+ }
+}
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjs
index 8ae44f68..2864594f 100644
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@ -116,6 +116,8 @@
// Keys added with MOSS-Image (docs/research/new-models-7.md §4.6). Model settings (params.extra; MOSS-Image's Quality control writes them):
// sampler, scheduler (KSampler sampler_name / scheduler)
// unet (UNETLoader file: the Fast tier's drop-in 8-step DMD file, listed in optionalModels)
+// Keys added with Assist's split_soundtrack (o/dbs-d9, graph C soundtrack-remix-dbs), model settings (params.extra):
+// voiceDb, musicDb, effectsDb (Adjust Audio Volume on the speech, music and sfx stems, whole dB -100..100; -100 = left out)
// Entry field requiredModels: files a loader reads by a name with no extension (DBSLoader's model folder), listed in the
// manifest like any model (KNOWN_MODELS keys are the path under the folder, e.g. 'DBS-BSRNN-DnR/model.safetensors'), so the
// Workflows page's presence check and its install commands cover them.
@@ -3417,6 +3419,32 @@ export const SPEC = [
'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).',
},
+ // originals (o/dbs-d9): graph C of docs/research/dbs-separation-7.md §4.4, the server-side remix behind Assist's and MCP's
+ // split_soundtrack with levels: separate-soundtrack-dbs runs it for params.extra.remix (src/lib/comfy-variants.ts).
+ {
+ id: 'soundtrack-remix-dbs',
+ title: 'Remix a soundtrack: dialogue, music and effects each at their own level (DBS, ComfyUI-DBS)',
+ capability: 'separate-audio',
+ handBuilt: 'hand-built/soundtrack-remix-dbs.json',
+ packs: ['ComfyUI-DBS'],
+ requiredModels: ['DBS-BSRNN-DnR/model.safetensors', 'DBS-BSRNN-DnR/config.json', 'DBS-TIGER-DnR/model.safetensors', 'DBS-TIGER-DnR/config.json'],
+ bindings: {
+ audio: [b('1', 'audio')],
+ separationModel: [b('2', 'model')],
+ channels: [b('3', 'channels')],
+ voiceDb: [b('4', 'volume')],
+ musicDb: [b('5', 'volume')],
+ effectsDb: [b('6', 'volume')],
+ },
+ outputs: [{ node: '9', kind: 'audio', role: 'mix' }],
+ defaults: { separationModel: 'DBS-BSRNN-DnR', channels: 'mono', voiceDb: 0, musicDb: 0, effectsDb: 0 },
+ 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)',
+ 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).',
+ },
// Clean up voice (NVIDIA NemotronLabs RE-USE, universal speech enhancement): Fuobe's own ComfyUI-RE-USE pack (no mamba-ssm).
// Not on the validation server: checked statically there (core nodes) and run through the pack's own tests.
{
diff --git a/src/lib/comfy-variants.ts b/src/lib/comfy-variants.ts
index 4d9fa402..511a6e7e 100644
--- a/src/lib/comfy-variants.ts
+++ b/src/lib/comfy-variants.ts
@@ -36,6 +36,12 @@ export const H3_ORBIT_GRAPH: Record<string, string> = { "minimax-h3-i2v": "minim
*/
export const REUSE_BED_GRAPH: Record<string, string> = { "voice-clean-reuse": "voice-clean-bed-reuse" };
+/**
+ * originals (o/dbs-d9): a split with levels (params.extra.remix, Assist's and MCP's split_soundtrack): graph C makes one
+ * mix of the dialogue, music and effects at params.extra.voiceDb / musicDb / effectsDb instead of four stems.
+ */
+export const DBS_REMIX_GRAPH: Record<string, string> = { "separate-soundtrack-dbs": "soundtrack-remix-dbs" };
+
export interface VariantRequest {
op: string;
/** Clips a join takes ("video-concat-{n}"). */
@@ -75,5 +81,7 @@ export function resolveWorkflowId(endpointTemplate: string, r: VariantRequest):
else if (best && r.extra.quality === "best" && r.has(best)) endpoint = best;
const bed = REUSE_BED_GRAPH[endpoint];
if (bed && r.extra.background === "keep" && r.has(bed)) endpoint = bed;
+ const remix = DBS_REMIX_GRAPH[endpoint];
+ if (remix && r.extra.remix === true && r.has(remix)) endpoint = remix;
return endpoint;
}
diff --git a/src/lib/comfy.ts b/src/lib/comfy.ts
index fcd74300..f380d0ec 100644
--- a/src/lib/comfy.ts
+++ b/src/lib/comfy.ts
@@ -90,7 +90,9 @@ export interface ManifestOutput {
| "matte"
| "preview"
| "master"
- | "report";
+ | "report"
+ /** originals (o/dbs-d9): a server-side remix of a split's stems (soundtrack-remix-dbs). */
+ | "mix";
}
export interface ManifestWorkflow {
diff --git a/src/server/providers/mock.ts b/src/server/providers/mock.ts
index 1f8bfff4..fac6db4a 100644
--- a/src/server/providers/mock.ts
+++ b/src/server/providers/mock.ts
@@ -294,6 +294,8 @@ function demoOutputs(op: Operation | undefined, kind: MediaKind, prompt: string,
}
case "separate-audio": {
const stem = (name: string, wav: Buffer): DemoOutput => ({ url: toDataUri(wav, "audio/wav"), kind: "audio", contentType: "audio/wav", meta: { stem: name, demo: true } });
+ // A split with levels (graph C): one mix of the stems.
+ if (meta.remix) return [{ url: toDataUri(demoWav(3, [220, 392], 3), "audio/wav"), kind: "audio", contentType: "audio/wav", meta: { role: "mix", demo: true } }];
// A dialogue / music / effects split (DBS) returns those three and the music-and-effects bed, voice first.
const stems: DemoOutput[] = meta.threeStems
? [stem("voice", demoWav(3, [220, 330], 3)), stem("music", demoWav(3, [262, 392])), stem("effects", demoWav(3, [90, 140], 7)), stem("background", demoWav(3, [110, 165]))]
@@ -424,6 +426,8 @@ export const mockProvider: ProviderAdapter = {
transcript: route.op === "separate-audio" && route.provider === "comfyui" && route.endpoint.includes("transcribe"),
// A dialogue / music / effects split (ComfyUI's separate-soundtrack-dbs): four stems.
threeStems: route.op === "separate-audio" && route.endpoint === "separate-soundtrack-dbs",
+ // originals (o/dbs-d9): the same split with levels (graph C, soundtrack-remix-dbs): one mix.
+ remix: route.op === "separate-audio" && route.endpoint === "separate-soundtrack-dbs" && input.extra?.remix === true,
},
payload: { demo: true, ...input },
};