Repository navigation
[feat] canvas: character replacement as a node workflow (mask, depth, composite, FastH3 structure control) - #479
Merged
Conversation
… composite, FastH3 structure control)
Builds person/costume replacement from canvas nodes instead of one opaque
tool:
source video ─ 视频抠像 (SAM 3, new 遮罩 output) ──────────┐
└ 深度动作捕捉 (Video Depth Anything) ─ 遮罩合成 ─┐
reference image ─────────────────────────────────── FastH3 视频节点 (结构控制)
- video-matting gains background=mask: white tracked objects on black.
- video-mask-composite (遮罩合成, local): keeps the first video inside the
white area of the second, black elsewhere; optionally stretches the
masked brightness to 50..255 so a person's depth uses the full control
range. Its results draw provenance edges from both the content and the
mask node.
- FastH3 video nodes gain videoMode=control (结构控制) with reference role
control: the one connected video is sent as control_reference with
control_type=depth (Fun ControlNet), images stay Ref2VA references, and
the output follows the control video: longest 17n+5 frames it covers,
nearest H3 768P/480P bucket, long_video_mode=full beyond one window,
4-30 s. The control clip is not a <Video N> reference and is exempt from
the 15 s reference budget.
- Frontend: 结构控制 mode in the composer and a 跟随控制视频 toggle in the
duration popover, control role/validation in rules, mask picker and
stretch option in the video tool panel, i18n, regenerated contracts and
rule facts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions
Bot
requested review from
FayeSpica,
Probiotics5333,
allendyu and
nikiwang-125
November 24, 2026 01:05
Mask composite pairs content and mask frames by index. A mask with another frame rate or length (not made from the same source clip) drifted off the person silently and was truncated to the shorter clip. It now fails with a clear message when the frame rates differ or the frame counts differ by more than one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Person or costume replacement in a video becomes a chain of canvas nodes, each one inspectable and re-runnable, instead of one opaque tool:
video-mattingacceptsbackground=maskand returns white tracked objects on black.video-mask-composite(遮罩合成). It keeps the first video inside the white area of the second and makes everything else black. Optionally it stretches the masked brightness to 50..255, so a person's depth uses the full control range. Results draw provenance edges from both the content node and the mask node.videoMode=control(结构控制) with a new reference role,control.control_referencewithcontrol_type=depth(Fun ControlNet). Images stay Ref2VA references.long_video_mode=fullbeyond one window. The allowed range is 4–30 s.<Video N>reference and does not count toward the 15 s reference budget.Control needs a FastH3 server started with the Fun ControlNet, i.e. TP8 and
--controlnet-model-path(vllm-project/vllm-omni#10958). Control cannot be combined with continuation, so structure-control output is capped at 30 s.Linked issue
Labels
type:feat,area:canvas,area:provider,modality:video)Test plan
npm test: 963 passed.npx tsc --noEmit,vite build,npm run check:i18n,npm run check:browser-manifestandscripts/generate_contracts.py --checkall pass.python -m pytest tests -k "not live": 2875 passed, 112 skipped.tests/test_fasth3_inputs.py: control parameters (bucket, 17n+5 frames,long_video_mode=full) and the request fields.tests/test_tool_tasks.py: mask background and mask composite.tests/test_rule_facts.py,tests/backendRules.test.ts: control-mode rules and the Python and TypeScript rule mirrors.tests/toolCatalog.test.ts,tests/canvasLinkedResults.test.ts: the tool entry and the two-parent provenance edges.tests/browser/composer_duration.mjs: the 跟随控制视频 toggle.lint-imports(not installed locally) and the browser lanes, including the updatedcomposer_durationjourney.Evidence that it works
control_type=depth, and all succeeded.Provider verification
Bilingual UI
zh-CNanden-US.🤖 Generated with Claude Code