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.

Handoff: Split soundtrack node reports

Claudee28f18f34fca
diff --git a/docs/handoff/reports/dbs-d8.json b/docs/handoff/reports/dbs-d8.json
new file mode 100644
index 00000000..957f0850
--- /dev/null
+++ b/docs/handoff/reports/dbs-d8.json
@@ -0,0 +1,95 @@
+{
+ "key": "dbs-d8",
+ "impl": {
+ "branch": "o/dbs-d8",
+ "summary": "Canvas has a new Split soundtrack node. It has four labelled outputs (Dialogue, Music, Effects, Music & effects), and each one carries its stem (ChainSlot.stem voice/music/effects/background) into the next node's chain. Dialogue is the usual OUT handle, so edges saved with OUT, with no handle or as 'voice' all read as Dialogue, and old one-OUT boards load as before. The node runs only on the open engine with DBS (oss-dbs-separate), because samAudioCloud is false. On a cloud board it is disabled with CLOUD_SPLIT_PROBLEM, and on a cloud-only install with CLOUD_ONLY_PROBLEM; its handles are disabled with the same reasons. Demucs or another separator never stands in for DBS. The DBS step ran for real on the CPU ComfyUI and passed.",
+ "built": [
+ "src/lib/catalog/canvas.ts: new node type 'split-soundtrack' (Utilities, op separate-audio) with a palette entry. New exports: OutputPortDef, outputPorts() (OUT, or the four stem handles with disabled reasons), SPLIT_HANDLES, SPLIT_STEMS (the model to stems map, which a SAM Audio entry can join later), splitHandle(), edgeStem(), splitProblem(), stemOutput(). Changes to existing functions: connectionError checks the source handle and accepts an optional engine mode for disabled handles. buildRequest/sourceOf carry the edge's stem into chain slots, including through Clone voice's Sample. defaultModelForNode and modelChoices offer only DBS (none on the cloud). describeNode gives the cloud reasons, and tells a board saved on another open separator to pick DBS. cleanGraph rewrites 'voice' to OUT and removes duplicate OUT/null edges. paletteItems disables the node on a cloud board or install, with the reason. All changes add to the existing code.",
+ "src/components/canvas/nodes.tsx: StemPorts rows, each with a stem label, a player for that stem once the node has run, and its own source handle (greyed out with the reason when disabled). 'Connect output to…' lists each stem ('Music → Node · Port'). The Output node previews the stem that was wired in and captions it.",
+ "src/components/canvas/canvas-editor.tsx: a drag from a stem handle onto empty board keeps that handle. Connection checks pass the engine mode. Taking over connections from a split node moves only its Dialogue edges.",
+ "src/components/canvas/canvas-context.tsx: Split icon.",
+ "src/server/canvas.ts: GraphSchema node types gain 'split-soundtrack' and also 'restore'. 'restore' was missing before, so a board with a Restore & colourise node could not be saved (fixed, with a test that every node type parses).",
+ "tests/canvas-split.test.ts (17 tests), tests/e2e/comfyui-canvas-split.mjs (live end-to-end check against ComfyUI)"
+ ],
+ "tests": "Verified with tests: tests/canvas-split.test.ts covers the handles, edges carrying stems (including what the server's pickOutput reads), plans per engine, disabled handles and palette entries on cloud and cloud-only, convertEngine keeping the node on the open engine, the storage round trip through parseGraph and cleanGraph with old single-OUT and 'voice' edges, and that every node type can be saved. The canvas suites (canvas, canvas-plus, canvas-api, canvas-editor-state, canvas-models, canvas-comfy) and restore pass. tsc (needs NODE_OPTIONS=--max-old-space-size=6144) and eslint are clean. Full vitest: 5072 passed, 8 failed. 6 of the failures are the known pre-existing ones (comfy-reuse, dop-originals, preset-featured, soul-runs x2, split-soundtrack 'has no cloud route'). moderation-hook and preset-covers timed out under full-suite load and pass when run alone (rule 12). Verified live: node scripts/comfy/validate-workflows.mjs separate-soundtrack-dbs --shared passes on the CPU ComfyUI (DBSLoader present). tests/e2e/comfyui-canvas-split.mjs ran a real board through /api/canvases on a 12 s synthetic clip: Video → Split soundtrack (DBS-BSRNN, CPU, 131.6 s) → Music & effects → Add soundtrack (oss-mux, real CPU mux). It saved all 5 stem edges and ran split then mux at a price of 0. It produced four FLAC stems tagged voice/music/effects/background, and the muxed clip's sound correlates 0.996 with Music & effects and -0.553 with Dialogue. Dialogue → Qwen3-ASR was plan-only (no ASR weights on this host). Browser check (demo mode) at 1440 and 390 px, light and dark: the node shows 4 labelled handles with stem players after a run, and Dialogue → Transcribe and Music & effects → Add soundtrack are drawn. No console or page errors and no sideways scroll. Afterwards the server was stopped and .next deleted.",
+ "left": [
+ "The SAM Audio cloud route is not built (samAudioCloud is false). If the owner says yes, add 'sam-audio-separate' to SPLIT_STEMS (all four stems for two passes, or voice and background for one pass); the per-handle disabled reasons are already in place.",
+ "The node has no 'Put back on the video' shortcut or template. The board wires to Add soundtrack (oss-mux) by hand. A Canvas template could be added later.",
+ "Brief out of date: line numbers have moved (CanvasNodeType ~L44, PALETTE ~L265, OUT ~L490, OP_PORTS 'separate-audio' ~L536). CLOUD_SPLIT_PROBLEM and CLOUD_ONLY_PROBLEM already existed in split.ts from D1. None of D8 existed before. Only the Model node could run DBS, with a single OUT that gave the dialogue."
+ ],
+ "docsNotes": "FEATURES/Canvas: a 'Split soundtrack' utility node with four outputs (Dialogue, Music, Effects, Music & effects), each wiring its own stem into the next node (Transcribe, Change voice, Add soundtrack…). It runs on your GPU (DBS, open source) and is disabled on the cloud with the reason. ARCHITECTURE: Canvas output handles now come from outputPorts(). Every node has OUT except split-soundtrack, whose handles map to ChainSlot.stem; Dialogue is OUT, so boards from before stem handles keep working. Research §9 D8: done as above, cloud left out by the owner's decision. Note for the integrator: GraphSchema now also accepts 'restore' (Restore & colourise boards could not be saved before).",
+ "blocked": ""
+ },
+ "review": {
+ "findings": [
+ {
+ "severity": "low",
+ "file": "src/lib/catalog/canvas.ts",
+ "line": 456,
+ "title": "A Split soundtrack node with no model loses all its stem edges on save",
+ "detail": "splitProblem() returns CLOUD_SPLIT_PROBLEM whenever nodeModel() is undefined, so outputPorts() marks all four handles disabled, connectionError() rejects them, and cleanGraph() (used by parseGraph, the server's save path and the editor's pruneEdges) quietly drops every edge out of the node. A Model node with no model keeps its edges, because outputType() falls back to mediaKind. Verified with a scratch script: video -> split(data {}) -> Music -> Output keeps 1 of 2 edges after cleanGraph. In normal use this does not happen, because addNode always sets DBS on an open or both install. It would happen if a node arrives without a modelId (a template, the API, or a model id that later leaves the catalog). The error message ('Switch to Open source') is also wrong on an open board. Suggest: in cleanGraph, check split edges by handle id only (no engine or model gating), or default to SPLIT_MODEL when modelId is missing.",
+ "verified": "tsx probe against the worktree: cleanGraph(no-model split).edges.length === 1 (the stem edge was dropped)"
+ },
+ {
+ "severity": "low",
+ "file": "src/components/canvas/canvas-editor.tsx",
+ "line": 800,
+ "title": "'Use result as an input' on a split node can't pick a stem, and the new takeOver branch is never used",
+ "detail": "toInput() takes the first output (whichever stem comes first) and labels it 'From Split soundtrack' with no stem name. The new 'moves only Dialogue edges' logic in addInput only runs when takeOver is true, and only the Translate node's dub chip passes that, so for split it never runs. This is a UX gap, not a regression."
+ },
+ {
+ "severity": "low",
+ "file": "src/components/canvas/nodes.tsx",
+ "line": 952,
+ "title": "After a successful split the stem rows replace Results, so the node has no thumbnail/open path",
+ "detail": "Results is hidden once the run succeeds, and the inline <audio> players are the only view, so the node itself loses the click-to-open viewer that other generators have (and its download path through it). Also, in SourcePreview, when an Output is wired to a stem the result doesn't have, it falls through to the compact Results grid of every stem instead of saying that stem is missing. Minor."
+ },
+ {
+ "severity": "info",
+ "file": "src/lib/catalog/canvas.ts",
+ "line": 1424,
+ "title": "A split node holding a cloud separator (e.g. demucs) is told 'Switch to Open source', even on an open board",
+ "detail": "splitProblem runs before the SPLIT_STEMS check, so a cloud model gets CLOUD_SPLIT_PROBLEM instead of 'pick DBS'. The tests pin this on purpose. It can only happen with a hand-edited or legacy board."
+ }
+ ],
+ "checks": [
+ "Read the full diff claude/fuobe-parity-4...o/dbs-d8 (7 files, +568/-42): canvas.ts, nodes.tsx, canvas-editor.tsx, canvas-context.tsx, server/canvas.ts, tests/canvas-split.test.ts, tests/e2e/comfyui-canvas-split.mjs. All changes are additive. No hot files, admin, db migrations, deploy or preview media touched.",
+ "Owner rule samAudioCloud=false is respected: SPLIT_STEMS has only oss-dbs-separate. defaultModelForNode(split, cloud) is undefined, and Demucs never stands in. The palette disables the node on a cloud board (CLOUD_SPLIT_PROBLEM) and on a cloud-only install (CLOUD_ONLY_PROBLEM). addNode refuses disabled items. convertEngine keeps the node on DBS (listed as missing).",
+ "Stem chaining traced end to end: buildRequest/sourceOf put ChainSlot.stem on the slot. runCanvas passes the request to createGenerations with dependsOn. pickOutput (generations.ts:1039) matches meta.stem through STEM_ALIASES. recipe ChainSlotSchema already allows stem. A duplicate dependsOn (two stems of one split into one node) is accepted by chains.ts and the JSON depends_on.",
+ "Backward compatibility: OUT, null and 'voice' all read as Dialogue. cleanGraph rewrites 'voice' to OUT, and its dedupe now treats OUT and null as one edge for every node type, which is harmless. Non-split nodes keep the same connectionError semantics.",
+ "server/canvas.ts NODE_TYPES gains split-soundtrack and the missing 'restore'. The test that every node type can be saved covers it.",
+ "No new route, model, LoRA, node pack or workflow, so no public sign-up, ESTIMATES/PREVIEWS, tenant/account-inputs, licence-data or pre-flight changes are needed. The existing separate-soundtrack-dbs graph is used.",
+ "Targeted vitest (--maxWorkers=2): canvas-split, canvas, canvas-plus, canvas-api, canvas-editor-state, canvas-models, canvas-comfy, split-soundtrack: 180/181 passed. The 1 failure is the known pre-existing split-soundtrack 'has no cloud route' (rule 8). soul-fixes, restore, public-signup: 87/87 passed.",
+ "npx next typegen + tsc --noEmit (6 GB heap): clean. eslint on all changed files: clean.",
+ "Live ComfyUI at 127.0.0.1:8188: /object_info/DBSLoader is present (DBS-TIGER-DnR, DBS-BSRNN-DnR). node scripts/comfy/validate-workflows.mjs separate-soundtrack-dbs --shared passes. The validator rewrote validation-state.json and object_info.subset.json, and I restored both with git checkout, so the worktree is clean. I did not re-run the 130 s CPU separation e2e; I relied on the implementer's report.",
+ "Edge-case probe (tsx scratch script): a split with no modelId drops its stem edges in cleanGraph (finding 1). DBS with data.engine 'cloud' still keeps all edges and plans cleanly on open and both installs.",
+ "UI review: StemPorts handles have aria-labels and titles. Disabled handles are not connectable. Keyboard users get a Connect menu with every stem ('Music → Node · Port'). Visitor copy has no jargon. I did not repeat the browser check; the implementer reported 1440/390 px in light and dark with no console errors."
+ ],
+ "verdict": "approve: the Split soundtrack node does what the brief asks on the open engine, follows the owner's samAudioCloud=false decision, keeps old boards working, and is well tested. The findings are low severity: an edge-loss case that needs a modelId-less node, and UX gaps. None blocks the merge."
+ },
+ "fix": {
+ "applied": [
+ "Finding 1 (low, confirmed with a test): a Split soundtrack node with no model, or with a model the catalog no longer has, lost every stem edge in cleanGraph/parseGraph. Changes in src/lib/catalog/canvas.ts: outputPorts() now disables a split node's handles only on a cloud-only install (CLOUD_ONLY_PROBLEM), or for a stem that a SPLIT_STEMS separator doesn't make. A node with no model keeps all its edges, and describeNode says 'Pick a model' or 'That model is no longer in the catalog — pick another'. Tests: cleanGraph and parseGraph keep every edge of a model-less split.",
+ "Finding 4 (info, confirmed): a split node on another separator (Demucs, or the two-stem oss-voice-separate) was told 'Switch to Open source' even on an open board. splitProblem() now returns CLOUD_ONLY_PROBLEM on a cloud-only install, '<model> can't split a soundtrack into its stems — pick DBS' for any separator not in SPLIT_STEMS, and null otherwise. The node's edges are kept, and Demucs still never runs in DBS's place. The test that pinned the old message is updated. The palette still disables the node on a cloud board (CLOUD_SPLIT_PROBLEM) and on a cloud-only install (CLOUD_ONLY_PROBLEM).",
+ "Finding 2 (low, confirmed): 'Use result as an input' on a split node took whichever stem came first and didn't name it. The node menu now lists one item per stem the node made ('Use music as an input'). toInput(id, stem?) picks that stem with stemOutput and labels the new input 'Music from Split soundtrack'. I also reverted the takeOver logic for 'only Dialogue edges move' in addInput, because nothing used it. canvas-context's toInput type changed to match.",
+ "Finding 3 (low, confirmed): after a successful split the node had no way to open a result. Each stem row in StemPorts now has an Open button (Maximize2, aria-label 'Open music stem') that opens the viewer at that output, and the download path goes through the viewer. When an Output node is wired to a stem the result doesn't have, SourcePreview now says 'No music in this result' instead of showing every stem."
+ ],
+ "rejected": [],
+ "checks": [
+ "Worktree /home/user/wt/o-dbs-d8 on o/dbs-d8. git log claude/fuobe-parity-4..HEAD lists only this package's commits and one earlier merge of the base, so nothing needed blocking. The current base is not an ancestor of the branch, but I did not merge it because the parent session's instructions say the parent merges it afterwards.",
+ "Targeted vitest (--maxWorkers=2, FUOBE_ACCOUNT_DISK_FREE_GB=1): canvas-split, canvas, canvas-plus, canvas-editor-state, canvas-models, canvas-api, canvas-comfy: 7 files, 144/144 passed.",
+ "npx next typegen, then pnpm typecheck (NODE_OPTIONS=--max-old-space-size=6144): exit 0.",
+ "pnpm lint: exit 0, with 0 errors and 3 warnings, all in files this package doesn't touch (scripts/comfy/library.spec.mjs, src/server/elements.ts).",
+ "Full vitest (--maxWorkers=2): the run was killed (background task terminated) before it printed its summary, so I don't have a complete pass count. Every failing file it reported is on the known pre-existing list (rule 8): soul-runs (2), dop-originals (1), preset-featured (1), comfy-reuse (1), split-soundtrack 'has no cloud route' (1). I did not re-run it because the stage allows one full run.",
+ "No browser check after these small UI additions (the Open buttons on stem rows, the per-stem menu items, and the missing-stem note). The implementer's browser check at 1440 and 390 px, light and dark, covers the node layout. I deleted .next, git status is clean, and o/dbs-d8 is pushed at 0a3d84c1."
+ ],
+ "finalSummary": "Split soundtrack is a Canvas utility node with Dialogue, Music, Effects and Music & effects outputs. Each output wires its stem (ChainSlot.stem) into the next node, and Dialogue stays as OUT, so old boards load unchanged. Open engine: runs with DBS (oss-dbs-separate) on your ComfyUI. The implementer verified it live on the CPU ComfyUI: a real DBS separation, then a mux of Music & effects. Downstream GPU steps such as Qwen3-ASR were planned only. Cloud engine: nothing, because samAudioCloud is false. The node is disabled with a reason on a cloud board or a cloud-only install, and Demucs never stands in for DBS. This fix keeps a node's stem edges when it has no model or an unknown one, tells a node on another separator to pick DBS, lets each stem open in the viewer or become a named input, and makes an Output say when its stem is missing. Public sign-up: there is no new route. Canvas runs follow the existing rules: guests browse read-only, and accounts run the node on their own GPU through the existing generations path, with the tenant and account-inputs checks. No keys are involved and no paid calls.",
+ "left": [
+ "The full vitest run did not finish in this session (it was killed before its summary). The integrator's full run after merging the base will confirm it. All failures it showed were the known pre-existing ones.",
+ "SAM Audio cloud route: not built (samAudioCloud is false). If the owner allows it, add 'sam-audio-separate' to SPLIT_STEMS; the per-stem disabled reasons are already in place.",
+ "There is no 'put back on the video' template; you connect it to Add soundtrack (oss-mux) by hand.",
+ "The branch needs the current claude/fuobe-parity-4 merged in, which the parent does."
+ ],
+ "blocked": ""
+ }
+}