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.

Translate & dub: the Voice split checked in the browser, with notes on graph B as built

Claude749afc8b4ab2
diff --git a/docs/research/dbs-separation-7.md b/docs/research/dbs-separation-7.md
index c7ffc028..b91d0461 100644
--- a/docs/research/dbs-separation-7.md
+++ b/docs/research/dbs-separation-7.md
@@ -244,7 +244,7 @@ Why the background is "original minus speech" (node 4) and not "music plus effec
| 7 | `AILab_Qwen3ASRSubtitle` | `audio` [3,2]; the same settings as node 7 of the existing graph (Qwen3-ASR 1.7B + ForcedAligner 0.6B; bindings `sourceLanguage`, `asrModel`, `hints`, `maxChars`) |
| 8 / 9 / 10 | `SaveText` / `SaveText` / `PreviewAny` | cues, transcript, language |
-Honest expectation: the separation half becomes CPU-friendly (23 MB instead of the 0.46 GB MelBand RoFormer), but Qwen3-ASR stays in the graph, so the 8 GB listing and the ~5.9 GB first-run ASR download remain (`library.spec.mjs` L2255–2259).
+Honest expectation: the separation half becomes CPU-friendly (23 MB instead of the 0.46 GB MelBand RoFormer), but Qwen3-ASR stays in the graph, so the 8 GB listing and the ~5.9 GB first-run ASR download remain (`library.spec.mjs` L2255–2259). *As built (D3):* as in this table, with both DBS models required (as in graph A) and the provider's surround rule (a file with more than 2 channels gets its background from music + effects). Validated on the CPU ComfyUI; a real CPU run of a 12 s clip (LibriSpeech speech over chords and noise bursts, `asrModel` Qwen3-ASR 0.6B) took 133 s including the ASR load, the voice and background added back to the source within 3.0e-5, and the transcript was right. The full open dub after it (local LLM translation, Chatterbox, InfiniteTalk) was not run here.
**C. `soundtrack-remix-dbs`** (capability `separate-audio`, one output). For server-side remixes (Assist, MCP, Canvas, a video Remix) where the browser mixer is not in the loop.
@@ -385,7 +385,7 @@ Packages in priority order. The full brief of each one (goal, exact spots, both
### D3 · Translate & dub keeps the score and effects (P0)
-Open: graph B `dub-prepare-dbs-transcribe` and ModelDef `oss-dbs-voice-separate` "DBS + Qwen3-ASR"; a "Voice split" choice in Dub studio (DBS / MelBand RoFormer), default unchanged until D4 reports. Cloud: replace `sound` + `background` (extract + Demucs, three beds) in `prepareSteps` (`dub.ts` L116, cloud branch L144–158) with extract + `sam-audio-separate` prompt "speech": one bed (`residual`), one loudnorm at `BACKGROUND_DB`, one compose track; Demucs stays the fallback (`OPTIONAL_PREPARE`). Keep ElevenLabs isolation for the clone voice. Copy: "Keeps the music and sound effects of the original". Tests in the dub suites.
+Open: graph B `dub-prepare-dbs-transcribe` and ModelDef `oss-dbs-voice-separate` "DBS + Qwen3-ASR"; a "Voice split" choice in Dub studio (DBS / MelBand RoFormer), default unchanged until D4 reports. Cloud: replace `sound` + `background` (extract + Demucs, three beds) in `prepareSteps` (`dub.ts` L116, cloud branch L144–158) with extract + `sam-audio-separate` prompt "speech": one bed (`residual`), one loudnorm at `BACKGROUND_DB`, one compose track; Demucs stays the fallback (`OPTIONAL_PREPARE`). Keep ElevenLabs isolation for the clone voice. Copy: "Keeps the music and sound effects of the original". Tests in the dub suites. *As built:* the open half only. The owner has not allowed SAM Audio on the cloud (`samAudioCloud` false in `docs/handoff/owner-decisions.json`), so the cloud dub keeps extract + Demucs (three beds) unchanged and the studio says what Demucs does ("Music model: some sound effects may be lowered, and singing may be replaced"); the SAM Audio step and a Background split setting wait on that decision.
### D4 · Separation evaluation (P1)
diff --git a/scripts/comfy/README.md b/scripts/comfy/README.md
index 26851760..5ed76db7 100644
--- a/scripts/comfy/README.md
+++ b/scripts/comfy/README.md
@@ -428,6 +428,20 @@ COMFYUI_URL=http://127.0.0.1:<port> COMFYUI_MODELS_DIR=<that ComfyUI>/models nod
(the command above). A run of every id against the shared server records it as `missing_node_type`, not validated,
like the H3 entries.
+DBS D3 adds graph B, the open dub's first step with DBS for the split (Translate & dub's "Voice split"):
+
+```bash
+npm run build -- dub-prepare-dbs-transcribe
+COMFYUI_URL=http://127.0.0.1:<port> COMFYUI_MODELS_DIR=<that ComfyUI>/models node validate-workflows.mjs dub-prepare-dbs-transcribe --shared
+```
+
+| id | capability | what | validated here |
+|---|---|---|---|
+| `dub-prepare-dbs-transcribe` | separate-audio | `LoadAudio` → `DBSLoader` (`separationModel`) → `DBSSeparate` (mono, input rate) → stems `voice` (speech) and `background` (the original minus the speech) as FLAC, plus `dub-prepare-separate-transcribe`'s Qwen3-ASR node 7 on the speech (bindings `sourceLanguage`, `asrModel`, `hints`, `maxChars`) → `cues`, `transcript`, `language`: the same outputs as the MelBand graph | yes, on the CPU ComfyUI with ComfyUI-DBS and the weights; a real CPU run of a 12 s clip (LibriSpeech speech + chords + noise bursts, Qwen3-ASR 0.6B) took 133 s with the ASR load, gave voice + background equal to the source within 3.0e-5 and a correct transcript |
+
+The provider fills it like graph A (host pick, a model that isn't there refused in words, a surround source's background
+from music + effects); it has no `channels` binding: the dub's split is always mono.
+
## Fly path (N7-5)
One hand-built graph films a still along a camera path keyframed in Cinema's 3D scene, on core nodes only
diff --git a/src/components/dub/dub-studio.tsx b/src/components/dub/dub-studio.tsx
index da49a15c..e01ff278 100644
--- a/src/components/dub/dub-studio.tsx
+++ b/src/components/dub/dub-studio.tsx
@@ -36,7 +36,6 @@ import {
VOICE_SPLIT_IDS,
VOICE_SPLITS,
voiceOnly,
- voiceSplitOf,
type DubPrice,
type DubSessionView,
type DubStage,
@@ -230,7 +229,7 @@ function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
<div className="min-w-0 flex-1">
{splits.length > 1 ? (
<Select value={split} onValueChange={(v) => setSplit(v as VoiceSplit)}>
- <SelectTrigger id="dub-split" className="h-9 w-full rounded-full sm:w-80">
+ <SelectTrigger id="dub-split" className="h-9 w-full rounded-full sm:w-auto sm:min-w-64">
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -382,13 +381,7 @@ const PREPARE_LABEL: Record<string, string> = { stems: "Voice, background and tr
function prepareRows(s: DubSessionView, lang: string): StepRow[] {
// Older open dubs transcribed in a step of their own.
const keys = Object.keys(s.prepare ?? {}).filter((k) => !k.startsWith("translate:"));
- // An open dub's split names its model (DBS keeps the music and effects; dubs before the setting ran MelBand RoFormer).
- const stems = s.generations[s.prepare?.stems ?? ""];
- const split = s.engine === "open" ? (s.voiceSplit ?? voiceSplitOf(stems?.modelId) ?? DEFAULT_VOICE_SPLIT) : undefined;
- const label = (k: string) => {
- const base = k === "stems" && keys.includes("words") ? "Voice and background" : (PREPARE_LABEL[k] ?? k);
- return k === "stems" && split ? `${base} · ${VOICE_SPLITS[split].name}` : base;
- };
+ const label = (k: string) => (k === "stems" && keys.includes("words") ? "Voice and background" : (PREPARE_LABEL[k] ?? k));
return [...keys.map((k) => ({ key: k, label: label(k), g: s.generations[s.prepare![k]] })), { key: "t", label: `Translate into ${languageByCode(lang)?.name ?? lang}`, g: s.generations[s.prepare?.[translateKey(lang)] ?? ""] }];
}
diff --git a/src/lib/av/dub.ts b/src/lib/av/dub.ts
index 1734f2f9..c69cd977 100644
--- a/src/lib/av/dub.ts
+++ b/src/lib/av/dub.ts
@@ -83,11 +83,6 @@ export function voiceSplitModel(split?: string): string {
return VOICE_SPLITS[split && split in VOICE_SPLITS ? (split as VoiceSplit) : DEFAULT_VOICE_SPLIT].modelId;
}
-/** The voice split a first-step model stands for (an older dub's, or Assist's model id). */
-export function voiceSplitOf(modelId?: string): VoiceSplit | undefined {
- return VOICE_SPLIT_IDS.find((k) => VOICE_SPLITS[k].modelId === modelId);
-}
-
/** How far the background (music and effects) sits under its original level once the new voice is on, both engines. */
export const BACKGROUND_DB = -3;
diff --git a/tests/av-dub.test.ts b/tests/av-dub.test.ts
index 6d0f848e..d2bb21d4 100644
--- a/tests/av-dub.test.ts
+++ b/tests/av-dub.test.ts
@@ -25,7 +25,6 @@ import {
VOICE_SPLITS,
voiceOnly,
voiceSplitModel,
- voiceSplitOf,
voiceSteps,
type DubSessionView,
} from "@/lib/av/dub";
@@ -139,9 +138,6 @@ describe("dub pipeline DAGs", () => {
expect(voiceSplitModel("dbs")).toBe("oss-dbs-voice-separate");
expect(voiceSplitModel("nope")).toBe("oss-voice-separate");
expect(voiceSplitModel()).toBe("oss-voice-separate");
- expect(voiceSplitOf("oss-dbs-voice-separate")).toBe("dbs");
- expect(voiceSplitOf("oss-voice-separate")).toBe("melband");
- expect(voiceSplitOf("demucs")).toBeUndefined();
expect(VOICE_SPLITS.dbs.note).toBe("Keeps the music and sound effects of the original");
expect(VOICE_SPLITS.melband.note).toBe(MUSIC_MODEL_NOTE);
});
diff --git a/tests/e2e/dub-voice-split.mjs b/tests/e2e/dub-voice-split.mjs
new file mode 100644
index 00000000..38efed26
--- /dev/null
+++ b/tests/e2e/dub-voice-split.mjs
@@ -0,0 +1,99 @@
+// Browser check of Translate & dub's Voice split (DBS D3).
+// Usage: node tests/e2e/dub-voice-split.mjs [appUrl] [outDir] (the app in demo mode: no keys, no ComfyUI)
+// Checks, at 1440 px and 390 px in light and dark: the open engine's Voice split (MelBand RoFormer by default, DBS
+// with "Keeps the music and sound effects of the original"), the route line and the price line following it; the
+// cloud engine's Demucs note and no Voice split; no sideways scroll. Then a DBS dub in demo mode: its first step runs
+// on DBS + Qwen3-ASR. Screenshots go to outDir.
+import { spawnSync } from "node:child_process";
+import fs from "node:fs";
+import path from "node:path";
+import { DESKTOP, PHONE, launch, openRoute } from "./_browser.mjs";
+
+const args = process.argv.slice(2).filter((a) => !a.startsWith("--"));
+const app = args[0] ?? "http://localhost:3000";
+const out = args[1] ?? fs.mkdtempSync("/tmp/fuobe-dub-split-");
+fs.mkdirSync(out, { recursive: true });
+
+// A 4 s video with a tone as its soundtrack.
+const mp4 = path.join(out, "dub-source.mp4");
+const r = spawnSync("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "testsrc2=s=320x180:r=24:d=4", "-f", "lavfi", "-i", "sine=f=330:d=4", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-shortest", mp4]);
+if (r.status !== 0) throw new Error(`ffmpeg failed: ${r.stderr}`);
+
+const failures = [];
+const check = (ok, what) => {
+ console.log(`${ok ? "✓" : "✗"} ${what}`);
+ if (!ok) failures.push(what);
+};
+const noSideScroll = async (page, label) => {
+ const over = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
+ check(over <= 0, `${label}: no horizontal scroll (${over}px)`);
+};
+const setup = async (browser, device, theme, engine) => {
+ const ctx = await browser.newContext({ ...device, colorScheme: theme });
+ await ctx.addInitScript(([e]) => localStorage.setItem("fuobe.engine", e), [engine]);
+ // Connect your GPU's card looks for a ComfyUI on this computer: it reaches nothing but the app.
+ await ctx.route((u) => u.origin !== new URL(app).origin && /^https?:$/.test(u.protocol), (rt) => rt.abort());
+ return ctx;
+};
+const PRICE = /Placeholder · free|Free on your GPU/;
+
+const browser = await launch();
+try {
+ for (const [dname, device] of [
+ ["1440", DESKTOP],
+ ["390", PHONE],
+ ]) {
+ for (const theme of ["light", "dark"]) {
+ const label = `${dname} ${theme}`;
+ // ---- Open engine: the Voice split.
+ let ctx = await setup(browser, device, theme, "open");
+ let page = await ctx.newPage();
+ await openRoute(page, `${app}/audio/translate`);
+ await page.locator('input[type="file"]').setInputFiles(mp4);
+ await page.getByText(PRICE).first().waitFor({ timeout: 30_000 });
+ const split = page.getByRole("combobox", { name: "Voice split" });
+ check(await split.isVisible(), `${label}: the open engine shows a Voice split`);
+ check((await split.innerText()).includes("MelBand RoFormer"), `${label}: MelBand RoFormer is the default`);
+ check(await page.getByText("Music model: some sound effects may be lowered, and singing may be replaced.").isVisible(), `${label}: MelBand says what a music model does`);
+ await page.screenshot({ path: path.join(out, `dub-open-melband-${dname}-${theme}.png`), fullPage: true });
+ await split.click();
+ await page.getByRole("option", { name: "DBS: keeps music and effects, CPU-friendly" }).click();
+ check(await page.getByText("Keeps the music and sound effects of the original.").isVisible(), `${label}: DBS keeps the music and sound effects`);
+ check(await page.getByText(/Open source: DBS splits the dialogue from the music and effects/).isVisible(), `${label}: the route line follows the split`);
+ await page.getByText(PRICE).first().waitFor({ timeout: 20_000 });
+ const price = await page.getByText(PRICE).first().innerText();
+ check(PRICE.test(price), `${label}: the price line with DBS reads "${price}"`);
+ await page.screenshot({ path: path.join(out, `dub-open-dbs-${dname}-${theme}.png`), fullPage: true });
+ await noSideScroll(page, `${label} open`);
+ await ctx.close();
+
+ // ---- Cloud engine: Demucs, no Voice split.
+ ctx = await setup(browser, device, theme, "cloud");
+ page = await ctx.newPage();
+ await openRoute(page, `${app}/audio/translate`);
+ check(await page.getByText("Music and effects: Demucs. Music model: some sound effects may be lowered, and singing may be replaced.").isVisible(), `${label}: the cloud names Demucs and what it does`);
+ check((await page.getByRole("combobox", { name: "Voice split" }).count()) === 0, `${label}: no Voice split on the cloud`);
+ await page.screenshot({ path: path.join(out, `dub-cloud-${dname}-${theme}.png`), fullPage: true });
+ await noSideScroll(page, `${label} cloud`);
+ await ctx.close();
+ }
+ }
+
+ // ---- A DBS dub in demo mode: its first step runs on DBS + Qwen3-ASR.
+ const ctx = await setup(browser, DESKTOP, "light", "open");
+ const page = await ctx.newPage();
+ await openRoute(page, `${app}/audio/translate`);
+ await page.locator('input[type="file"]').setInputFiles(mp4);
+ await page.getByText(PRICE).first().waitFor({ timeout: 30_000 });
+ await page.getByRole("combobox", { name: "Voice split" }).click();
+ await page.getByRole("option", { name: /^DBS/ }).click();
+ await page.getByRole("button", { name: "Translate" }).click();
+ await page.getByText("Voice, background and transcript").first().waitFor({ timeout: 30_000 });
+ check(await page.getByText("DBS + Qwen3-ASR").first().isVisible(), "a DBS dub's first step runs on DBS + Qwen3-ASR");
+ await page.screenshot({ path: path.join(out, "dub-session-dbs-1440.png"), fullPage: true });
+ await ctx.close();
+} finally {
+ await browser.close();
+}
+console.log(failures.length ? `\n${failures.length} failed` : "\nall passed");
+process.exit(failures.length ? 1 : 0);