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
Handoff: dbs-d9 reports
Claude95727632838f
diff --git a/docs/handoff/reports/dbs-d9.json b/docs/handoff/reports/dbs-d9.jsonnew file mode 100644index 00000000..619620cd--- /dev/null+++ b/docs/handoff/reports/dbs-d9.json@@ -0,0 +1,112 @@+{+ "key": "dbs-d9",+ "impl": {+ "branch": "o/dbs-d9",+ "summary": "Assist and MCP gain split_soundtrack and remove_dialogue (DBS D9). Both run the Audio hub's and Video tools' own plans (planSplit / planRemoveDialogue through a now-exported, synchronous planAudioTool in src/server/audio-tools.ts), so a call reads the file's header, picks stems, the mux and the time estimate exactly as the pages do; they are gated, priced first (estimate_job / the approval card: Free on the open engine, with a time estimate), open engine only (owner decision samAudioCloud false: no SAM Audio route, today's cloud dub unchanged). split_soundtrack returns all four stems, one stem (music + effects = the background stem) or one remix at given levels through the new graph C soundtrack-remix-dbs. Offline planner suggestions for 'remove the dialogue', 'just the dialogue', 'just the music', 'lower the music', 'split the soundtrack'. MCP version 1.3.0 -> 1.4.0 with a separate instructions sentence.",+ "built": [+ "Graph C scripts/comfy/hand-built/soundtrack-remix-dbs.json (LoadAudio, DBSLoader, DBSSeparate, 3x core AudioAdjustVolume, 2x AudioMerge add, SaveAudioAdvanced FLAC) with its library.spec.mjs entry, binding keys voiceDb/musicDb/effectsDb (build-library.mjs BINDING_KEYS + spec header), built into workflows/comfyui (manifest sizes kept, no \\u escapes), validated on the live CPU ComfyUI (validate-workflows --shared: separate-soundtrack-dbs and soundtrack-remix-dbs pass); requirements.json rebuilt (no new pack or model: ComfyUI-DBS and the 4 DBS files already pinned)",+ "Real CPU runs of graph C on a 12 s stereo clip (speech over tones + noise): dialogue-only remix ('each channel') took 61 s including model load, 12 s stereo FLAC out, correlation 0.997 with the clean speech (source mix 0.978); a second remix with levels -6/-12/0 ran in 3 s from ComfyUI's cache",+ "src/lib/comfy-variants.ts DBS_REMIX_GRAPH: separate-soundtrack-dbs runs soundtrack-remix-dbs for params.extra.remix (so the GPU pre-flight gate checks the graph that runs); mock provider returns one audio for a remix",+ "src/lib/av/split.ts: KeepStem / splitOutcome / remixWords / REMIX_* and SplitInput.remix (a remix splits every channel of a stereo source unless told otherwise; title 'Mix (…)')",+ "src/server/audio-tools.ts: planAudioTool exported (sync), optional remix field on the split body (also accepted by POST /api/audio-tools; owner-only Assist/MCP use it today)",+ "src/server/assist/studio-tools.ts: own block with split_soundtrack and remove_dialogue (schemas, splitSoundtrackBody / removeDialogueBody, plan with time note from comfyDeviceSeen, run = previewAudioTool check then runAudioTool), exported as SOUNDTRACK_TOOLS and registered by its own TOOLS.push line in tools.ts (STUDIO_TOOLS and run_skill's lists untouched); estimate_job lists them automatically",+ "src/server/providers/comfyui.ts comfyDeviceSeen(): the last device read without asking (Assist cards are planned synchronously)",+ "tools.ts: stems documented on search_models' task (separate-audio: voice/background, DBS music/effects) and on background_audio; agent.ts: one system-prompt line, offlineSoundtrack() used by offlinePlan and, for a request with no file attached, a question asking for the file",+ "mcp.ts: version 1.4.0 and its own instructions sentence (tests/mcp.test.ts and tests/assist-studio-routes.test.ts version assertions updated to 1.4.0)"+ ],+ "tests": "New tests/assist-soundtrack-tools.test.ts (20 tests: splitOutcome, remix plan, graph C variant and bindings via prepareWorkflow, manifest/requirements entry, tool schemas, MCP listing + estimate_job + version, price-first plans, cloud and paid-only refusals with nothing queued, page refusals (silent video, image, keep bed + music_db, gone file), demo runs of a split, a remix and Remove dialogue, offline planner suggestions, public sign-up: Assist changes and /api/mcp are owner-only). tsc clean (after next typegen), pnpm lint 0 errors (3 pre-existing warnings). Full vitest (one run, --maxWorkers=2): 9 failures in 8 files, all pre-existing or flaky except gpu-requirements (mine: requirements.json was stale after the output change; rebuilt, passes): pre-existing per rule 8 split-soundtrack ('has no cloud route'), dop-originals, soul-runs x2, comfy-reuse, preset-featured; flaky per rule 12 preset-covers and moderation-hook (pass alone). Browser: Assist 'Remove the dialogue from this video' with a sounded video attached, demo mode, at 1440 and 390 px in light and dark: card shows the two steps priced 'Placeholder run · free', Run starts both steps, no console errors, no sideways scroll; the demo sample video (no sound) correctly gets 'This clip has no sound' on the card. Dev server stopped and .next deleted.",+ "left": [+ "Cloud routes (SAM Audio passes + loudnorm + compose) not built: samAudioCloud is false; both tools refuse on the cloud engine",+ "remove_dialogue refuses on the cloud with D2's CLOUD_REMOVE_PROBLEM (the brief said CLOUD_SPLIT_PROBLEM for both; that text names Split soundtrack, so the planner's own message was kept); split_soundtrack uses CLOUD_SPLIT_PROBLEM",+ "Engine choice: the tools default to the open engine when the call doesn't name one (MCP's context is 'cloud' whenever Engine mode is both); an explicit engine 'cloud' is refused",+ "Graph C's mix can't keep a remix's levels exact on a loud master (AudioMerge scales the whole sum under 1.0); said in the plan's notes and the tool description",+ "No new Audio hub UI for remixes (the page's own live mixer exports mixes); the API body accepts remix but no page sends it",+ "GPU timings not measured (CPU only here); paid calls not applicable"+ ],+ "docsNotes": [+ "docs/research/dbs-separation-7.md §4.4 graph C / §9 D9: 'As built (D9)': graph C built and validated as described (output has no 'mix' role: comfy-library-4 checks roles against a fixed list, so it is a plain audio output); it runs as separate-soundtrack-dbs's variant for params.extra.remix; a remix splits each channel of a stereo source; measured 61 s for 12 s stereo on the CPU host including model load. D9 open half only (samAudioCloud false).",+ "STATUS/ARCHITECTURE: Assist and MCP have split_soundtrack and remove_dialogue (open engine only); MCP server version 1.4.0.",+ "Brief line refs out of date: studio-tools open dub is now dubSteps ~L278; tools.ts 'L93' is search_models' task description (~L102), background_audio note ~L269; agent.ts offlinePlan ~L1000."+ ],+ "blocked": ""+ },+ "review": {+ "findings": [+ {+ "severity": "medium",+ "file": "src/server/assist/agent.ts",+ "line": 1088,+ "title": "The offline soundtrack matcher runs before every other offline intent and takes over unrelated requests, sometimes doing the opposite of what was asked",+ "detail": "offlineSoundtrack() runs at the top of offlinePlan (right after 'remember'), before translations, captions, lipsync and generate. Its regexes are loose: ONLY includes 'keep', REMOVE_SPEECH matches any 'remove/drop/... <anything> voice' and 'no vocals', and LOWER_MUSIC matches 'turn down ... background'. Verified by calling offlinePlan with a video or audio file attached (scratch vitest, no repo edits): 'Remove the background noise from my voice' + audio -> split_soundtrack keep [music, effects] (keeps the noise and drops the voice, the opposite of what was asked); 'Translate this video to French and keep the voice' -> remove_dialogue keep dialogue (on the base this reached the translate branch at L1170); 'Dub this video into Spanish but keep the music' -> split_soundtrack keep [music]; 'Extend this video and keep the music' -> split_soundtrack; 'Upscale this video, no voice changes' -> remove_dialogue; 'Add captions to this video, keep the voice' and 'Lip sync this video to the audio, keep the voice' -> remove_dialogue keep dialogue; 'Make a music video for this song with no vocals' / 'Write a song like this, no vocals' / 'Generate a video with this audio, no talking' + audio -> split_soundtrack. The make/create/write guard only applies when no file is attached. The tests in tests/assist-soundtrack-tools.test.ts cover only the positive phrases, so none of these false positives is tested.",+ "fix": "Either move the soundtrack check after the existing intents (translate/dub/captions/lipsync/generate), or require the soundtrack words to be the request's main verb (e.g. anchor at the start, '^(?:please )?(remove|take out|...)'), drop 'keep' from ONLY unless the sentence names no other operation, skip a remove/lower match when the sentence also names 'noise|echo|hiss|hum' (Clean up voice's job) or another op verb (translate, dub, caption, lip ?sync, extend, upscale, animate, make, create, generate, write), and apply the make/create guard when a file is attached too. Add negative tests for these phrases."+ },+ {+ "severity": "low",+ "file": "src/server/assist/studio-tools.ts",+ "line": 878,+ "title": "The card's time estimate assumes a CPU until something else has read the device, and always says 'on your GPU'",+ "detail": "soundtrackTime uses comfyDeviceSeen(), which only reads the cache that comfyDevice() fills. In a fresh server process (or after the one-minute cache entry, which is still read since 'at' isn't checked), a CUDA host's first Assist/MCP card is priced at CPU speed (DBS_SPEED cpu 0.27x vs cuda 22.4x; hostPick(undefined) = fast), so the time is about 80x too long. The wording is always '… on your GPU', even when the device is a CPU. The run's own reply uses previewAudioTool's live device, so only the card is off.",+ "fix": "Fire comfyDevice() without awaiting it when planning (so the next card is right), or leave the time out when the device is unknown; say 'on your computer' or 'on your ComfyUI' when the device is a CPU."+ },+ {+ "severity": "nit",+ "file": "src/server/providers/comfyui.ts",+ "line": 721,+ "title": "comfyDeviceSeen was inserted between comfyDevice's JSDoc and comfyDevice",+ "detail": "comfyDevice's doc block (L721-724) now sits right above comfyDeviceSeen's own doc block, so comfyDevice has no JSDoc and the orphaned block reads as part of comfyDeviceSeen.",+ "fix": "Move comfyDeviceSeen above the existing comment, or below comfyDevice."+ },+ {+ "severity": "nit",+ "file": "tests/assist-soundtrack-tools.test.ts",+ "line": 304,+ "title": "There is no test for the new remix field on POST /api/audio-tools for accounts",+ "detail": "The new remix field is accepted on the public route (src/server/audio-tools.ts L59), but no test runs it as an account (own GPU / tenant). It adds no new file input, so the existing account-inputs checks still cover media. The risk is low, but nothing tests that a remix body from an account stays on its own GPU.",+ "fix": "Add an account-style remix case beside the existing audio-tools account tests."+ }+ ],+ "checks": [+ "Read the review prompt and binding rules. owner-decisions.json on claude/fuobe-parity-4 has samAudioCloud false: the diff adds no SAM Audio or cloud route, and cloud dub is untouched (no diff in the dub or cloud catalog).",+ "The branch contains the current claude/fuobe-parity-4 (85be87db). 19 files changed. No hot files, admin, deploy, public/previews, LoRA, Higgsfield media or Higgsfield API use.",+ "Graph C scripts/comfy/hand-built/soundtrack-remix-dbs.json matches the manifest bindings (audio 1.audio, separationModel 2.model, channels 3.channels, voiceDb/musicDb/effectsDb 4/5/6.volume, filenamePrefix 9). DBSSeparate output indexes 0 music / 1 sfx / 2 speech are wired correctly. The licence is recorded as data (DBS Apache-2.0, DnR CC BY 4.0, ComfyUI-DBS MIT). requirements.json has the graph with its pack and the 4 DBS files. No new pack or model.",+ "dbsSurroundBed only rewires a subtract AudioMerge, so a >2-channel remix is left alone. The extra.remix flag routes to graph C through resolveWorkflowId, which the GPU pre-flight gate (src/server/gpu/gate.ts) also uses.",+ "Live CPU ComfyUI at 127.0.0.1:8188 (before the restart): object_info has DBSLoader, DBSSeparate, AudioAdjustVolume (INT dB -100..100), AudioMerge, SaveAudioAdvanced. Ran workflows/comfyui/soundtrack-remix-dbs.json on a 5 s stereo clip (voice -100, music -6, effects 0, each channel): success, 5.0 s stereo FLAC. The input and output files were then deleted. After the coordinator's restart the server was not answering yet, and nothing further needed it.",+ "Core AudioAdjustVolume read from ComfyUI's source: gain = 10^(dB/20), so -100 dB is effectively silent, as the code assumes.",+ "Read studio-tools, split.ts, audio-tools.ts, mcp.ts, tools.ts and agent.ts. The new tools are additive (own SOUNDTRACK_TOOLS push; STUDIO_TOOLS and run_skill untouched). MCP is 1.4.0 everywhere with its own instructions sentence. Paid-only installs and an explicit cloud engine are refused in words before anything is queued.",+ "Public sign-up: Assist changes (isAssistChange) and /api/mcp (ownerOnly) are owner-only, so visitors can't run the tools. POST /api/audio-tools's remix adds no new file input.",+ "Probed offlinePlan / offlineSoundtrack with 19 phrases through a scratch vitest config outside the repo (finding 1).",+ "Targeted tests: assist-soundtrack-tools, mcp, assist-studio-routes, split-soundtrack, comfy-library-4, gpu-requirements, public-signup-tools, remove-dialogue*, comfy-variants*: 207/208 pass. The one failure is split-soundtrack 'has no cloud route' (pre-existing, rule 8).",+ "tsc --noEmit clean after next typegen. pnpm lint: 0 errors, 3 pre-existing warnings. .next deleted afterwards.",+ "Full vitest (FUOBE_ACCOUNT_DISK_FREE_GB=1 --maxWorkers=2; the first run was killed by the worker restart, so it ran once more): 9 failed / 5075 passed in 8 files. comfy-reuse, dop-originals, preset-featured, soul-runs x2 and split-soundtrack are pre-existing (rule 8). moderation-hook, picker-covers and preset-covers failed under load and pass when run alone (rule 12). gpu-requirements passes. Nothing new fails.",+ "No browser re-check by the reviewer: the implementer reported Assist 'Remove the dialogue from this video' in demo mode at 1440/390, light/dark. The demo paths are covered by the new tests. No dev server was started. The worktree is clean and .next is absent."+ ],+ "verdict": "changes-requested: the tools, graph C, routing, pricing-first, engine refusals and public sign-up handling are correct and verified (graph C runs on the live CPU ComfyUI; no new test failures). Before merging, fix the offline planner's soundtrack matcher: it runs ahead of every other offline intent and takes over translate/dub/caption/lipsync/extend/upscale requests that mention 'keep the voice/music' or 'no vocals', and turns 'remove the background noise from my voice' into a split that drops the voice. Add negative tests for it. The other findings are minor."+ },+ "fix": {+ "applied": [+ "medium (agent.ts offline soundtrack matcher hijacking other intents): confirmed. Added OTHER_JOB guard in offlineSoundtrack: a request naming another job (translat*, dub*, captions/subtitles, lip sync, extend, upscale, animate, make (except 'make it/the/this/that ...'), create, generate, write, compose, record, restyle, enhance, clean up) or noise/echo/hiss/hum/reverb/denoise (Clean up voice's job) returns null, with or without a file attached (the make/create guard now applies when a file is attached too). Dropped bare 'keep' from ONLY ('keep only/just the X' still reads through only/just). New negative test covering all 10 reviewer phrases plus 'Keep the voice and make it 9:16': offlineSoundtrack is null and offlinePlan never picks split_soundtrack/remove_dialogue; positives 'keep only the music', 'make it just the music', 'turn down the music under the dialogue' still route.",+ "low (studio-tools.ts card time assumes CPU and always says 'on your GPU'): confirmed. soundtrackTime (now exported for tests) leaves the time out when no device has been read yet and fires comfyDevice() in the background so the next card has it; says 'on your computer' when the device is a CPU, 'on your GPU' otherwise. Test: null with no device, CPU wording, CUDA wording.",+ "nit (comfyui.ts comfyDeviceSeen between comfyDevice's JSDoc and comfyDevice): moved comfyDeviceSeen above the comment so comfyDevice keeps its doc.",+ "nit (no account test for the remix field on POST /api/audio-tools): added to tests/public-signup-tools.test.ts's Split soundtrack price-check case: an account's remix body is priced on its own GPU (costUsd 0, not a demo), and the owner's file answers it as gone (422). Accounts' runs on /api/audio-tools already answer own-gpu-tool (existing test)."+ ],+ "rejected": [],+ "checks": [+ "Worktree /home/user/wt/o-dbs-d9 on o/dbs-d9: only this package's commits plus a merge of claude/fuobe-parity-4; base not re-merged in this stage per coordinator.",+ "Targeted: tests/assist-soundtrack-tools.test.ts (22) and tests/public-signup-tools.test.ts pass (38/38); assist-studio-routes and mcp pass.",+ "npx next typegen; tsc --noEmit exit 0 (pnpm typecheck OOMed at default heap; reran with NODE_OPTIONS=--max-old-space-size=8192, clean).",+ "pnpm lint: 0 errors, 3 pre-existing warnings.",+ "Full vitest (FUOBE_ACCOUNT_DISK_FREE_GB=1 --maxWorkers=2, one run): 7 failed / 5079 passed in 6 files. Pre-existing per rule 8: comfy-reuse, dop-originals, preset-featured, soul-runs x2, split-soundtrack 'has no cloud route'. computer-relay ('finds ComfyUI on another port') failed under load and passes alone (18/18); untouched by this change.",+ "No browser check needed (planner/server-only changes); .next deleted; git status clean. Committed c1927a0b, not pushed."+ ],+ "finalSummary": "Open engine: Assist and MCP split_soundtrack and remove_dialogue run the Audio hub's and Video tools' own plans on the user's ComfyUI (graph C soundtrack-remix-dbs for remixes), priced first (free, with a time estimate once the GPU's device is known; 'on your computer' on a CPU); verified on the CPU ComfyUI in impl/review, needs a GPU for real speed. Cloud engine: both tools refuse in words (samAudioCloud false: no hosted DBS, no SAM Audio stand-in); today's cloud dub unchanged. Offline planner now suggests the soundtrack tools only when the request is about the soundtrack itself, leaving translate/dub/captions/lip sync/extend/upscale/generate/noise clean-up requests to their own plans. Public sign-up: guests and accounts cannot run the tools (Assist changes and /api/mcp are owner-only); an account's POST /api/audio-tools?preview=1, remix included, is priced for its own GPU on its own files, and its runs answer own-gpu-tool. No key needed.",+ "left": [+ "Cloud routes (SAM Audio) not built while samAudioCloud is false; both tools refuse on the cloud engine.",+ "remove_dialogue refuses on the cloud with D2's CLOUD_REMOVE_PROBLEM (brief said CLOUD_SPLIT_PROBLEM for both).",+ "Graph C's AudioMerge scales the sum under 1.0, so remix levels aren't exact on a loud master (stated in notes).",+ "No Audio hub UI sends a remix; the run reply's 'takes … on your GPU' still uses that wording on a CPU (the card is fixed).",+ "GPU timings not measured (CPU host only).",+ "Base merge of origin/claude/fuobe-parity-4 left to the coordinator at FINISH."+ ],+ "blocked": ""+ }+}