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: Clean the voice first's build reports
Claude6e58717dd0d7
diff --git a/docs/handoff/reports/dbs-d6.json b/docs/handoff/reports/dbs-d6.jsonnew file mode 100644index 00000000..685f8bea--- /dev/null+++ b/docs/handoff/reports/dbs-d6.json@@ -0,0 +1,114 @@+{+ "key": "dbs-d6",+ "impl": {+ "branch": "o/dbs-d6 (worktree /home/user/wt/o-dbs-d6, 5 commits on claude/fuobe-parity-4 at 85be87db, not pushed)",+ "summary": "Clean the voice first. Requests take a new voiceFirst flag. createGenerations turns it into one batch of steps, so every caller gets it. Open engine: DBS (oss-dbs-separate) runs first, then Qwen3-ASR, InfiniteTalk or LatentSync reads its voice stem. For a lip re-sync of a clip that has sound, the clip is split too, and oss-mux puts the clean voice over the clip's background at 0 dB, with the picture copied. Cloud: ElevenLabs Voice Isolation runs before Scribe v2 or the lip sync model, with no put-back because samAudioCloud is false, and the switch says so. previewGeneration adds the step's price and checks it. The Transcribe, Lipsync & avatars, Captions, Genjutsu 'Use the clip's words' and Character Swap Studio transcript screens each have a switch. It shows the time it adds on your GPU or its price in the cloud. It is on by default for video sources and off for audio-only ones. Already there before this package: DBS graph A, oss-dbs-separate, the STEM_ALIASES voice/background, the oss-mux two-track mux (D2), and elevenlabs-voice-isolation in the catalog. No new graph, model, migration or route was needed.",+ "built": [+ "src/lib/av/voice-first.ts (pure): planVoiceFirst gives voice → main → (open lip re-sync of a clip with sound) bed + film steps. Also voiceSource, voiceFirstApplies, voiceFirstDefault (on when the speech comes with a video), putsBedBack, voiceFirstCost (catalog price, or ISOLATION_USD_PER_MINUTE = 0.10 for pages without the catalog; a test keeps the two equal), voiceFirstTime (splitTime, the host's DBS pick, mono; doubled plus the mux with the put-back), voiceFirstLine, and the hint and BED_NOTES copy per engine",+ "src/server/voice-first.ts: voiceFirstPlanFor reads the speech's and the clip's headers through storedMedia, so an account's run sees only its own files. It skips the put-back for a silent clip and the step for a silent recording. createVoiceFirstRun builds a createPipeline batch, puts the result first, keeps the asked request through withAsked (now exported from chains.ts) so Reuse and skills rerun it, and rewords a failing step as 'Clean the voice first can't run (…): …. Turn it off to run without it'",+ "generations.ts: createGenerations expands voiceFirst when nothing waits on it (it also works as a pipeline step, which Swap Studio uses). previewGeneration adds the extra steps' cost and notes and refuses in the switch's words",+ "GenerationRequest.voiceFirst in types.ts, request-schema.ts (zod) and the recipe-builder KEEP list",+ "UI: VoiceFirstSwitch (src/components/studio/voice-first-switch.tsx) has the switch, a hint per engine, the time or price line (under the words on a phone), and for a lip re-sync of a clip what happens to its music and effects. Composer: StudioConfig.voiceFirst on TRANSCRIBE_STUDIO and LIPSYNC_STUDIO. A pick holds per speech file. The probe gives the length and whether the clip has sound. The client cost estimate includes the step, and submit sends voiceFirst",+ "Captions: transcribeRequest({ voiceFirst, seconds }) and the switch under 'Transcribe the speech'. Genjutsu: TranscribeSchema.voiceFirst, the switch under 'Use the clip's words', and the cached transcript is keyed by the switch. Character Swap Studio: planTranscribe(clip, engine, voiceFirst), the route takes voiceFirst, StudioEstimate.cleanVoice holds the added price per clip, and the button's price follows the switch",+ "Live on the CPU ComfyUI (DBSLoader present, both DBS models on disk) through a dev server, POST /api/generations with voiceFirst on an 11 s H.264+AAC clip (JFK's public-domain speech over sine chords and pink-noise bursts): DBS-BSRNN mono took 41 s with the load and gave voice, music, effects and background. Qwen3-ASR 0.6B on the voice stem took 68 s and its transcript was word-perfect. Without the switch the transcript was also word-perfect (17 s), so this clip shows no gain; measuring one is D4's job",+ "docs/research/dbs-separation-7.md §9 D6: 'As built (D6)' note with the live numbers (a research correction)"+ ],+ "tests": "New: tests/voice-first.test.ts (22) covers where the switch applies and its defaults; the plans per engine and studio (stems, chain slots, inputs removed, step indexes, the put-back mux at 0 dB from the right steps, a silent clip, avatar, cloud); the prices ($0.05 for 30 s, $0.10 a minute, list price = catalog) and times; and in demo mode createGenerations for transcript, lipsync with put-back (run to success), cloud, without the switch, as a pipeline step, and with DBS switched off; previewGeneration price and notes; Genjutsu transcribeClip; Swap planTranscribe. New: tests/account-voice-first.test.ts (2): an account is refused the owner's recording with input-not-yours before anything is queued, and its own run stamps every step with the account and the open engine. Targeted runs passed: voice-first, account-voice-first, recipe-builder, swap-studio, swap-studio-api, genjutsu-api, remove-dialogue, chains, composer, public-signup, hosted-runs, assist-skill-tools, account-tenant. Typecheck passes (tsc needs NODE_OPTIONS=--max-old-space-size=8192 here) and eslint is clean on every changed file. Browser: tests/e2e/voice-first.mjs on a demo dev server covers Transcribe (video on, recording off), Lipsync (re-sync models via ?model=, on, with the bed note per engine) and Captions, at 1440 and 390 px, light and dark, on both engines. All good: toggling moves nothing, no horizontal scroll, no console errors. Server stopped, .next deleted. Not run as instructed: the full vitest suite and pnpm build.",+ "left": [+ "Not verifiable here: a lip sync with the put-back on a GPU (InfiniteTalk or LatentSync need one; the mux is the one D2 verified on the CPU), and paid ElevenLabs Voice Isolation calls",+ "The GPU pre-flight board (STUDIO_ROWS) still lists only the Transcribe and Lipsync defaults. The DBS step's pack and weights are already covered by the Split soundtrack and Remove dialogue rows, so a missing ComfyUI-DBS shows up when the run fails, not as a badge on those studios",+ "The switch's default (on for video, off for audio) is a guess until D4 measures WER with and without it. On the synthetic clip both transcripts were identical",+ "The time line uses the CPU estimate unless the viewer's GPU device is known (ownGpuOf(status).device)",+ "Genjutsu and Character Swap Studio switches were type- and unit-checked but not browser-checked (the brief asks for Transcribe, Captions and Lipsync)",+ "Hosted runs: no new model or op, so poolQuote is unchanged. A voiceFirst pool run plans and prices its main step there, and the DBS step is free"+ ],+ "docsNotes": "STATUS/ARCHITECTURE (left for the docs pass): 'Clean the voice first' (DBS D6). A voiceFirst flag on a generation request runs the speech alone through the transcript or lip sync: DBS voice stem on your GPU, ElevenLabs Voice Isolation ($0.10/min) in the cloud. A lip re-sync of a clip on your GPU gets the clip's music and effects back through oss-mux at 0 dB; the cloud keeps the clean voice only, because samAudioCloud is false. Switches in Transcribe, Lipsync & avatars, Captions, Genjutsu 'Use the clip's words' and Character Swap Studio's transcript. On by default for video, off for audio. Code: src/lib/av/voice-first.ts and src/server/voice-first.ts (expanded inside createGenerations), src/components/studio/voice-first-switch.tsx. Brief out of date: the line numbers (TRANSCRIBE_STUDIO is now ~L283, LIPSYNC_STUDIO ~L113, STEM_ALIASES ~L1039, swap transcribe ~L731); STEM_ALIASES already had music and effects from D1. The Lipsync studio opens on talking-avatar models (InfiniteTalk, Kling Avatar 2), so the put-back applies only when a re-sync model (InfiniteTalk Lip Re-sync, LatentSync, Sync Lipsync) is picked; the switch is on by default whenever a clip is attached. No migration, no new route, no new graph or node pack.",+ "blocked": ""+ },+ "review": {+ "findings": [+ {+ "severity": "medium",+ "title": "Hosted runs: Clean the voice first's extra steps run on the install's GPUs unpriced and past the pool policy",+ "where": "src/server/generations.ts createGenerations (voiceFirst branch) + src/server/hosted-run.ts decidePlace/poolQuote + src/server/hosted.ts runFacts/poolAllows",+ "detail": "decidePlace and poolQuote check poolAllows only for planned.model.id (the transcriber or lip sync model), and runFacts sends the billing service only that model, op, jobs and seconds. With voiceFirst the run then queues oss-dbs-separate (and, for a lip re-sync of a clip with sound, a second DBS pass over the clip plus oss-mux) on the same pool. The billing service never sees those steps, and a policy that denies oss-dbs-separate or oss-mux on the pool cannot stop them. The brief says a model or op on that path 'plans and prices there too (poolQuote; test it in the style of tests/hosted-runs.test.ts)'. The implementer's 'left' says 'the DBS step is free', but no hosted-runs test covers voiceFirst. This only happens with FUOBE_HOSTED_RUNS=1 and a policy that allows audio or video uploads (off by default).",+ "verified": "Traced: previewGeneration's voiceFirstExtra adds only a USD cost, which is 0 on the open engine. runFacts (hosted.ts:139-165) carries no step list or voiceFirst. poolAllows (hosted.ts:55) is called with planned.model.id only.",+ "fix": "In decidePlace and poolQuote, when req.voiceFirst applies, check poolAllows for every voiceFirstPlanFor step model and add the steps to the facts sent for billing (or keep voiceFirst runs on the account's own GPU). Add a hosted-runs test."+ },+ {+ "severity": "medium",+ "title": "Lipsync default turns on cleaning of an uploaded voice file, against the brief's 'off for audio-only speech uploads'. In the cloud this costs money by default.",+ "where": "src/lib/av/voice-first.ts voiceFirstDefault (return !!req.inputs?.video for lipsync/avatar)",+ "detail": "For lipsync the file that gets cleaned is always inputs.audio, which is an audio upload (voiceSource). The default still turns on whenever a clip is attached. On the cloud engine there is no put-back, so the default adds paid ElevenLabs Voice Isolation ($0.10/min) to a voice that is usually already clean (a recording or TTS), and gives no benefit. On the open engine the default also adds two DBS passes. The brief's rule is 'on for video sources, off for audio-only speech uploads'. The bed put-back is a separate benefit that could be decided apart from cleaning the voice. The implementer flagged the choice in docsNotes but did not raise it as a deviation from the brief.",+ "verified": "Read voiceFirstDefault, and the composer's voiceFirstOn = vfApplies && (pick ?? voiceFirstDefault). tests/voice-first.test.ts asserts the on-by-default behaviour for a lip sync clip.",+ "fix": "Default off for a lipsync voice upload, at least on the cloud engine. Or make the put-back on the open engine its own default-on choice, and keep 'clean the voice' off for an uploaded voice."+ },+ {+ "severity": "minor",+ "title": "Two overlapping voice-cleaning switches in Lipsync & avatars and Transcribe",+ "where": "src/components/studio/composer.tsx: D5's CleanVoiceSwitch (hasCleanVoice, ~L1254/L1289; the slots in studios.ts L124 and L263 have cleanVoice: true) and the new VoiceFirstSwitch block",+ "detail": "Both studios now show D5's 'Clean up voice' (RE-USE on upload, remembered in the browser) next to 'Clean the voice first' (DBS or ElevenLabs at run time). Nothing explains how the two relate or stops both running, so a voice can be cleaned twice: RE-USE, then DBS. In the cloud, it would also pay for isolation of a file that was already cleaned. The e2e script does not look at the two switches together.",+ "verified": "Code trace. Not browser-checked by the reviewer.",+ "fix": "When the slot's file is already a clean-voice result, hide or default off the run-time switch. Or explain the difference in one line."+ },+ {+ "severity": "minor",+ "title": "Preview price understated when the clean-voice step's price is unknown",+ "where": "src/server/generations.ts previewGeneration: post = cost === null || voiced.costUsd === null ? post : post + voiced.costUsd",+ "detail": "When the voice step's cost is null (unknown), the preview returns the main step's price as if it were the total, instead of null or 'unknown'. Today this is unlikely in the cloud because isolation has a catalog price, but it hides the unknown.",+ "verified": "Read the code path.",+ "fix": "If voiced.costUsd is null, make costUsd null."+ },+ {+ "severity": "minor",+ "title": "GPU pre-flight board does not show the DBS requirement for Transcribe and Lipsync with the switch on",+ "where": "src/server/gpu/tools.ts STUDIO_ROWS",+ "detail": "The switch is on by default for video, but if ComfyUI-DBS is missing the run fails at queue time, and the Transcribe or Lipsync rows show no badge. The implementer acknowledged this in 'left'.",+ "verified": "Acknowledged by the implementer, and STUDIO_ROWS is unchanged in the diff.",+ "fix": "Add the DBS pack and weights to those rows' requirements, or say so as a soft requirement."+ }+ ],+ "checks": [+ "Read the stage prompt, binding rules and implementer report. Diff claude/fuobe-parity-4...o/dbs-d6: 27 files, 5 commits. The worktree is clean.",+ "Hot file src/lib/av/clean-voice.ts is not touched. No migrations, routes, graphs, node packs or models were added, so no new licence data is needed. No Higgsfield use. No SAM Audio in the cloud (samAudioCloud false is respected).",+ "Plan traced: open = oss-dbs-separate (mono) -> main with chain {audio, stem voice} (STEM_ALIASES resolves voice/vocals/speech) -> for a lip re-sync, a DBS pass over the clip -> oss-mux with video/audio(voice)/audio2(background) and backgroundVolumeDb 0, which matches the manifest's video-mux-audio params. Cloud = elevenlabs-voice-isolation (fal-ai/elevenlabs/audio-isolation, which maps video_url and audio_url, $0.10/min in the catalog) -> scribe-v2 or the lip sync model.",+ "createGenerations expands voiceFirst only when there is no dependsOn. The nested createPipeline drops voiceFirst from the main step, so there is no recursion. Swap Studio's outer pipeline takes made[0] = the result, because createVoiceFirstRun puts the result first through withAsked.",+ "Accounts: storedMedia header reads run inside the tenant. The inputs are the same URLs the route checked through account-inputs. tests/account-voice-first.test.ts covers input-not-yours and the account and open-engine stamp on every step.",+ "Targeted vitest: voice-first, account-voice-first, chains, swap-studio, genjutsu-api, remove-dialogue, recipe-builder: 7 files, 149 tests, all passed.",+ "eslint on the changed files: clean. npx next typegen, then tsc --noEmit (8 GB heap): exit 0. The .next directory was removed afterwards.",+ "CPU ComfyUI at 127.0.0.1:8188 is up and /object_info lists DBSLoader. The implementer's live DBS->Qwen3-ASR run was not repeated.",+ "Not done by the reviewer: browser checks (the implementer's tests/e2e/voice-first.mjs covers Transcribe, Lipsync and Captions at 1440 and 390 px, light and dark), the full vitest suite, and the GPU lipsync."+ ],+ "verdict": "approve-with-fixes: the core plan, the chain bindings, the account isolation and the tests are sound, and typecheck, lint and the targeted tests pass. Fix the hosted-runs pricing and policy gap (or keep voiceFirst runs off the pool), and revisit the Lipsync default (cloud especially) before merging. The rest are minor."+ },+ "fix": {+ "applied": [+ "Hosted runs (medium, confirmed): previewGeneration now returns steps [{model, op}] for the steps Clean the voice first adds (oss-dbs-separate, plus a second DBS pass and oss-mux for an open lip re-sync with its music put back). A new poolAllowsRun (src/server/hosted.ts) checks the main model and every step against the pool policy. decidePlace and poolQuote use it, so a policy that denies oss-dbs-separate or oss-mux keeps the whole run off the pool. runFacts sends the steps to the billing service as an optional RunFacts.steps field (src/server/billing.ts, documented in docs/billing-hook.md). New test in tests/hosted-runs.test.ts: the steps are planned, sent in the /v1/quote facts and left out without the switch, and a deny on oss-dbs-separate turns poolQuote to null and decidePlace to refuse.",+ "Lipsync default (medium, confirmed): voiceFirstDefault is now on only when the speech is a video's soundtrack (Transcribe with a video, which also covers Captions, Genjutsu and Swap Studio). It is off for any audio upload, including a lip sync's or avatar's voice. The open-engine put-back is unchanged: turning the switch on for a lip re-sync of a clip with sound still splits the clip and muxes its music and effects back at 0 dB. With the switch off on the open engine, the note under it says 'Turn it on to put the clip's music and effects back under it.' (BED_OFF_NOTE). The cloud note is unchanged. Tests and tests/e2e/voice-first.mjs were updated: Lipsync starts off with the off note, then turns on and shows the on note.",+ "Two overlapping switches (minor, confirmed): when the voice slot's file is already a 'Clean up voice' (D5) result (its slot value carries original), the composer starts Clean the voice first off and replaces its hint with 'Your voice was already cleaned when you added it'. The voice is then cleaned twice only if the person asks.",+ "Preview price (minor, confirmed): when the clean-voice step's price is unknown, previewGeneration's costUsd is now null instead of the main step's price. Tested in tests/voice-first.test.ts with demo mode off, a test fal key, and the isolation model's pricing removed for the test. The test fails on the old code.",+ "GPU pre-flight board (minor, confirmed): two new STUDIO_ROWS in src/server/gpu/tools.ts. 'Captions' (/video-tools/captions): DBS, Qwen3-ASR, captions burn-in. 'Lip re-sync, voice cleaned' (/lipsync?model=oss-infinitetalk-v2v): DBS, InfiniteTalk lip re-sync, oss-mux. A missing ComfyUI-DBS now shows on those rows. A test in tests/voice-first.test.ts checks their graphs are in the requirement index, that toolFor resolves them, and that hrefs stay unique."+ ],+ "rejected": [+ "Nothing was rejected. Partly left: Transcribe's own row stays the single-model config row. Its switch is on only for a video, and there is no Transcribe URL that opens with the switch on, so the DBS requirement is shown through the Captions row (same DBS + Qwen3-ASR steps) rather than a second Transcribe row."+ ],+ "checks": [+ "Worktree /home/user/wt/o-dbs-d6 on o/dbs-d6: only this package's commits, base is an ancestor. Base not merged in, as instructed.",+ "npx next typegen, then pnpm typecheck (tsc --noEmit, 8 GB heap): no errors.",+ "eslint on every changed file: exit 0.",+ "Targeted vitest (--maxWorkers=2, FUOBE_ACCOUNT_DISK_FREE_GB=1): voice-first, account-voice-first, hosted-runs, public-signup-tools, remove-dialogue, billing-hook, moderation-hook, composer, av-dub, clean-dialogue, chains, swap-studio, genjutsu-api. 277/278 passed. The one failure was moderation-hook's output-check test timing out under load (known flaky, rule 8). It passed 9/9 when rerun alone.",+ "Full vitest suite, pnpm build and the browser script were not run, as instructed. tests/e2e/voice-first.mjs was updated but not re-run. The CPU ComfyUI was not touched.",+ ".next deleted. git status is clean. Two commits (0a78966b, 677a0567), not pushed."+ ],+ "finalSummary": "Open engine (ComfyUI + ComfyUI-DBS): Clean the voice first runs DBS before Qwen3-ASR, InfiniteTalk or LatentSync, which read its voice stem. With the switch on, a lip re-sync of a clip with sound gets the clip's music and effects back through oss-mux at 0 dB. Verified live on the CPU ComfyUI by the implementer: DBS then Qwen3-ASR, word-perfect. Needs a GPU, not verified: the lip sync with the put-back. The switch is on by default for a video's soundtrack and off for audio uploads, now including the Lipsync voice. A voice already cleaned on upload starts off and says so. Cloud engine: ElevenLabs Voice Isolation ($0.10/min) runs before Scribe v2 or the lip sync model. There is no put-back, because samAudioCloud is false, and the switch says so. Built and unit-tested; the paid calls need a fal key. Unknown step prices now show as unknown. Public sign-up: guests browse the switch read-only. An account's clean-voice run reads only its own files and runs on its own GPU (tests/account-voice-first.test.ts). With hosted runs on, the extra steps are now checked against the pool policy and sent to the billing service as RunFacts.steps, so a denied DBS or mux keeps the run off the install's GPUs. The GPU pre-flight board shows the DBS graph on the new Captions and 'Lip re-sync, voice cleaned' rows.",+ "left": [+ "RunFacts.steps is a new optional field in the billing contract (docs/billing-hook.md). A billing service that ignores it prices only the main model, as before.",+ "Still needs a GPU: a lip re-sync with the put-back. Still needs a fal key: paid ElevenLabs isolation.",+ "The default (on for a video, off for audio) is still a guess until D4 measures WER with and without the switch.",+ "Browser check: tests/e2e/voice-first.mjs was updated for the Lipsync off-by-default flow and the off note, but not re-run here. The off note was kept about as long as the on note so the line count doesn't change when toggling. The cleaned-voice hint is not browser-checked.",+ "Transcribe keeps its single-model pre-flight row. The DBS requirement shows on the Captions row.",+ "Docs pass: mention RunFacts.steps, the Lipsync default (off for an uploaded voice), and the two new pre-flight rows in STATUS/ARCHITECTURE."+ ],+ "blocked": ""+ }+}