New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

SCAIL-2 in-video character replacement on WAN 2.1

SCAIL-2 In-Video Character Replacement (WAN 2.1)

by artokun · MIT license · ★ 759 on GitHub · updated Sep 21

SCAIL-2 In-Video Character Replacement (WAN 2.1) cover

SCAIL-2 in-video character replacement on WAN 2.1.

---
name: wan-scail-replacement
description: SCAIL-2 in-video character replacement on WAN 2.1. WanSCAILToVideo + SCAIL2ColoredMask + SAM3, the reference-image framing→scale rule, and the tuning/compositing pitfalls
globs:
  - "**/*.json"
---

# SCAIL-2 In-Video Character Replacement (WAN 2.1)

SCAIL-2 (zai-org, on WAN 2.1 14B) replaces the person in a driving video with a
character you supply as a reference image, end-to-end, with no pose maps, and
with multi-character support. It is the successor to WAN Animate / motion
transfer for the "swap the subject, keep the motion" job. The official ComfyUI
template is `video_wan21_scail2_character_replacement_int8`, built around
`WanSCAILToVideo` (+ `SCAIL2ColoredMask`) with a SAM3 mask driving where the
character goes.

This skill documents the non-obvious behaviours that cost a full multi-minute

Overview

SCAIL-2 (zai-org, on WAN 2.1 14B) replaces the person in a driving video with a character you supply as a reference image, end-to-end, with no pose maps, and with multi-character support. It is the successor to WAN Animate / motion transfer for the "swap the subject, keep the motion" job. The official ComfyUI template is video_wan21_scail2_character_replacement_int8, built around WanSCAILToVideo (+ SCAIL2ColoredMask) with a SAM3 mask driving where the character goes.

Manual install (npx, ZIP)
Claude Codenpx skills add artokun/comfyui-mcp --skill wan-scail-replacement -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/artokun/comfyui-mcp/tar.gz/1d5b12b1b499 \ | tar -xz -C ~/.claude/skills --strip-components=3 comfyui-mcp-1d5b12b1b499/plugin/skills/wan-scail-replacement
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/309cc32c49bde9fb72a1/wan-scail-replacement.zip" -OutFile "$env:TEMP\wan-scail-replacement.zip"; Expand-Archive "$env:TEMP\wan-scail-replacement.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md4.6 KB
Read the files here
artokun/1d5b12b1 file
SKILL.md
Show the full text101 lines

SCAIL-2 In-Video Character Replacement (WAN 2.1)

SCAIL-2 (zai-org, on WAN 2.1 14B) replaces the person in a driving video with a character you supply as a reference image, end-to-end, with no pose maps, and with multi-character support. It is the successor to WAN Animate / motion transfer for the "swap the subject, keep the motion" job. The official ComfyUI template is video_wan21_scail2_character_replacement_int8, built around WanSCAILToVideo (+ SCAIL2ColoredMask) with a SAM3 mask driving where the character goes.

This skill documents the non-obvious behaviours that cost a full multi-minute render to discover. It is not a from-scratch graph. Start from the official template and apply the guidance below.

The one rule that costs a re-render: reference framing controls SCALE

In replacement_mode: true, the reference image's FRAMING controls the output character's SIZE as well as its appearance. The SAM3 mask controls where the character is placed; the reference image controls how large.

Measured on a 720x1280 driving clip where the subject occupied ~30% of frame height (subject bbox 363 px):

Reference framing Person bbox in output vs driving subject
Full-bleed portrait (person ~93% of frame) 621 px 1.71x oversized
Reframed (person ~34% of frame) 364 px 1.003x — correct

After reframing, top/bottom registration matched the driving subject within 1 px (the character stands on the same ground plane at the same height). Pose transfer was correct in both cases. Only the scale was wrong, which makes it easy to misread as "the model works" until you A/B against the source.

Guidance: pad or reframe the reference before you render.

Pad/reframe the reference image onto a canvas at the working resolution so the person occupies roughly the same fraction of frame height as the subject in the driving video. A full-bleed portrait reference against a wide-shot driving clip renders the character oversized in proportion to the framing mismatch.

It is a trap because the template's on-canvas notes do not state it, and it does not show up in the popular Civitai motion-transfer workflows. Those run animation mode, where the reference legitimately fills the frame.

Tuning trade-off: distill LoRA strength / shift leaks driving-subject detail

Running the lightx2v distill LoRA at 0.8 with ModelSamplingSD3 shift 5 (the settings the popular Civitai workflow uses) improves colour and detail versus 1.0 / shift 8. It also increases adherence to the driving video enough that original-subject details bleed onto the replacement character. In one run the original golfer's neon-yellow shoe appeared on a replacement character who wears white shoes in the reference (same seed, same reference, only those two params changed). If you see source details you didn't ask for, raise the LoRA strength / shift back toward 1.0 / shift 8.

Don't "fix" colour with post-hoc compositing — it's a regression

The raw SCAIL-2 output shows a measurable colour error (background ~-5 per channel from the VAE round-trip; the character loses red ~2.4x faster than green, which reads as a slight green cast). It is tempting to composite the generated character back over the original plate through the SAM3 mask to "correct" it. Don't. It measures better but looks worse:

  • The mask boundary produces an obvious halo.
  • Layering the original plate's props (e.g. a golf club) over generated hands severs the grip relationship the model had solved coherently.

SCAIL-2 resolves colour, edges, grip and occlusion jointly; correcting any one of them in isolation breaks the others. Leave the raw output alone.

Models (reference set)

The template's int8 build was exercised with:

  • wan2.1_14B_SCAIL_2_int8_convrot, the SCAIL-2 model
  • wan2.1_SCAIL_2_DPO_lora_bf16, the DPO LoRA
  • lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16, the distill LoRA (see tuning note)
  • Wan2_1_VAE_bf16
  • umt5_xxl_fp8_e4m3fn_scaled, the text encoder
  • clip_vision_h
  • sam3.1_multiplex_fp16, the SAM3 mask model

VRAM: ~22.2 GB peak at 576x1024 / 81-frame chunks on a 24 GB card.

See also

  • wan-t2v-video, wan-flf-video for other WAN 2.x video pipelines
  • director for multi-shot scene direction for video pipelines

Sources

  • Official: none found.
  • Empirical: sampler values, wiring, and prompt notes from working graphs in packs/ and observed renders; not a vendor prompting guide.
1---
2name: wan-scail-replacement
3description: SCAIL-2 in-video character replacement on WAN 2.1. WanSCAILToVideo + SCAIL2ColoredMask + SAM3, the reference-image framing→scale rule, and the tuning/compositing pitfalls
4globs:
5 - "**/*.json"
6---
7 
8# SCAIL-2 In-Video Character Replacement (WAN 2.1)
9 
10SCAIL-2 (zai-org, on WAN 2.1 14B) replaces the person in a driving video with a
11character you supply as a reference image, end-to-end, with no pose maps, and
12with multi-character support. It is the successor to WAN Animate / motion
13transfer for the "swap the subject, keep the motion" job. The official ComfyUI
14template is `video_wan21_scail2_character_replacement_int8`, built around
15`WanSCAILToVideo` (+ `SCAIL2ColoredMask`) with a SAM3 mask driving where the
16character goes.
17 
18This skill documents the non-obvious behaviours that cost a full multi-minute
19render to discover. It is not a from-scratch graph. Start from the official
20template and apply the guidance below.
21 
22## The one rule that costs a re-render: reference framing controls SCALE
23 
24**In `replacement_mode: true`, the reference image's FRAMING controls the output
25character's SIZE as well as its appearance.** The SAM3 mask controls where the
26character is placed; the reference image controls how large.
27 
28Measured on a 720x1280 driving clip where the subject occupied ~30% of frame
29height (subject bbox 363 px):
30 
31| Reference framing | Person bbox in output | vs driving subject |
32|---|---|---|
33| Full-bleed portrait (person ~93% of frame) | 621 px | **1.71x oversized** |
34| Reframed (person ~34% of frame) | 364 px | **1.003x — correct** |
35 
36After reframing, top/bottom registration matched the driving subject within 1 px
37(the character stands on the same ground plane at the same height). Pose transfer
38was correct in both cases. Only the scale was wrong, which makes it easy to
39misread as "the model works" until you A/B against the source.
40 
41Guidance: pad or reframe the reference before you render.
42 
43> Pad/reframe the reference image onto a canvas at the working resolution so the
44> person occupies roughly the same fraction of frame height as the subject in the
45> driving video. A full-bleed portrait reference against a wide-shot driving clip
46> renders the character oversized in proportion to the framing mismatch.
47 
48It is a trap because the template's on-canvas notes do not state it, and it does
49not show up in the popular Civitai motion-transfer workflows. Those run
50animation mode, where the reference legitimately fills the frame.
51 
52## Tuning trade-off: distill LoRA strength / shift leaks driving-subject detail
53 
54Running the `lightx2v` distill LoRA at `0.8` with `ModelSamplingSD3 shift 5` (the
55settings the popular Civitai workflow uses) improves colour and detail versus
56`1.0` / `shift 8`. It also increases adherence to the driving video enough
57that original-subject details bleed onto the replacement character. In one
58run the original golfer's neon-yellow shoe appeared on a replacement character
59who wears white shoes in the reference (same seed, same reference, only those two
60params changed). If you see source details you didn't ask for, raise the LoRA
61strength / shift back toward `1.0` / `shift 8`.
62 
63## Don't "fix" colour with post-hoc compositing — it's a regression
64 
65The raw SCAIL-2 output shows a measurable colour error (background ~-5 per channel
66from the VAE round-trip; the character loses red ~2.4x faster than green, which
67reads as a slight green cast). It is tempting to composite the generated character
68back over the original plate through the SAM3 mask to "correct" it. Don't. It
69measures better but looks worse:
70 
71- The mask boundary produces an obvious halo.
72- Layering the original plate's props (e.g. a golf club) over generated hands
73 severs the grip relationship the model had solved coherently.
74 
75SCAIL-2 resolves colour, edges, grip and occlusion jointly; correcting any one
76of them in isolation breaks the others. Leave the raw output alone.
77 
78## Models (reference set)
79 
80The template's int8 build was exercised with:
81 
82- `wan2.1_14B_SCAIL_2_int8_convrot`, the SCAIL-2 model
83- `wan2.1_SCAIL_2_DPO_lora_bf16`, the DPO LoRA
84- `lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16`, the distill LoRA (see tuning note)
85- `Wan2_1_VAE_bf16`
86- `umt5_xxl_fp8_e4m3fn_scaled`, the text encoder
87- `clip_vision_h`
88- `sam3.1_multiplex_fp16`, the SAM3 mask model
89 
90VRAM: ~22.2 GB peak at 576x1024 / 81-frame chunks on a 24 GB card.
91 
92## See also
93 
94- `wan-t2v-video`, `wan-flf-video` for other WAN 2.x video pipelines
95- `director` for multi-shot scene direction for video pipelines
96 
97## Sources
98 
99- **Official:** none found.
100- **Empirical:** sampler values, wiring, and prompt notes from working graphs in `packs/` and observed renders; not a vendor prompting guide.
101 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 759
Checked
Source
artokun/comfyui-mcp ↗
Creator
artokun · 44 listings
View creator

Similar skills

See all →
SkillMake a polished video of an app or a featureMake a demo video with OpenScreengetopenscreen/openscreen · by getopenscreenMake a polished video of an app or a feature with OpenScreen's MCP tools, from storyboard to recording, editing and export, then either attach it to a pull request or draft a post on X. Use when the user asks for a demo, a demo video, a screen recording, a product video, a launch clip, a video for X/Twitter, LinkedIn or a README, or to show a change in a pull request ("add a video to the PR", "show the feature to reviewers"). Also use to set OpenScreen up for an agent, and to continue an OpenScreen demo in a new session.★ 4.5k GitHub starsSkillVideo and audio processing with FFmpegFFmpeg for Video Productiondigitalsamba/claude-code-video-toolkit · by digitalsambaVideo and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.★ 2.1k GitHub starsSkillTurn static SCREENSHOTS into a simulated screen recordingfake-screencast — screenshots → simulated screen recordinghassancs91/claude-youtube-editor · by hassancs91Turn static SCREENSHOTS into a simulated screen recording (TSX) — a fake screencast with an animated cursor that eases to targets and clicks, a browser URL bar that updates per page, hard-cut navigations, in-page filter crossfades, smooth scroll, and a ken-burns zoom onto the payoff. Use when a beat needs to show a walkthrough of a web app / dashboard / settings page and you'd rather build it from screenshots than get (or ask for) a real screen recording — "fake a screen recording", "turn these screenshots into a screencast", "simulate clicking through the dashboard", "animate this UI walkthrough", "cursor moving through the app". Built on remotion/src/lib/screencast.tsx. This is a technique WITHIN step 2 (make-tsx): defer timeline/render/bake orchestration to make-tsx and raw crash-free TSX rules to vidtsx-2d-generator. Not for a single static page clone (use WebBrowserFrame directly) and not when the point is genuine proof of real speed/output (use a real recording).★ 330 GitHub starsSkillA Khan Academy style explainer videoKhan explainerhaiderfarooq3/khan-explainer · by haiderfarooq3Use when the user wants a Khan Academy style explainer video, a blackboard or whiteboard lesson, a hand-drawn chalk-talk animation, a short narrated video that teaches a concept ("explain X in a video", "explainer video", "teach X in 30 seconds"), or a tutorial that draws hand-written arrows, circles and captions over product screenshots ("draw over the UI", "annotated walkthrough"), or clips cut from a YouTube video or podcast where the speaker's real audio plays under a blackboard drawn to it ("khanify this video", "clip this with the Khan visual"), especially when it must be free, local, and use no paid APIs or keys. macOS only.★ 113 GitHub starsSkillPick the output format that makes an explanation easiestUnderstanding ladderChangWenC/understanding-ladder · by ChangWenCPick the output format that makes an explanation easiest to understand, following Karpathy's understanding ladder — (1) plain controlled text, (2) diagram, (3) interactive HTML page, (4) 3Blue1Brown-style explainer video. Classify the content (definition/steps, process/causality, parameter→outcome, unfolding derivation), recommend the lowest rung that fully answers, then produce it. Works in English and Chinese. Use when the user says "explain this clearly", "help me understand", "draw a diagram", "make it interactive", "make an explainer video", "what's the best way to explain X", "understanding ladder", "Karpathy ladder", or 「讲清楚」「帮我理解」「画个图」「做个交互页」「做个讲解视频」「用哪种方式讲最好懂」「理解阶梯」; also when explaining a non-trivial concept, mechanism, algorithm, or an AI agent's output.★ 108 GitHub starsSkillAnimate first frames into A-roll talking head clipsAnimate (A-Roll)TheMattBerman/scrollclaw · by TheMattBermanAnimate first frames into A-roll talking head clips. Uses Sora 2 via fal.ai (primary) with Kling 3 auto-fallback when Sora is unavailable or sunset.★ 71 GitHub stars

More from artokun

SkillTrain custom LoRAs with ostris AI-ToolkitAI-Toolkit LoRA Trainer (WAN 2.2 & Z-Image)artokun/comfyui-mcp · by artokunTrain custom LoRAs with ostris AI-Toolkit. Covers WAN 2.2/2.1 (people, styles, video motion) and Z-Image (Turbo & Base, low-VRAM image LoRAs). Use when the user wants to train a WAN or Z-Image LoRA; covers local + RunPod setup, dataset prep, key params, and using the result in a ComfyUI workflow.★ 759 GitHub starsSkillAnime/illustration text-to-imageANIMA 1.0 (Anima Base Ultra) Text-to-Image Workflowsartokun/comfyui-mcp · by artokunAnime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT). Use for anime, manga, illustrated characters; accepts Danbooru tags + natural language; runs/trains on <6GB VRAM; includes anime inpainting via Anima-LLLite ControlNet★ 759 GitHub starsSkillAuthoring & Publishing ComfyUI Custom Nodesartokun/comfyui-mcp · by artokunAuthoring & publishing ComfyUI custom nodes to the Comfy Registry, covering node structure, pyproject.toml spec, comfy-cli publishing, and CI★ 759 GitHub starsSkillTrain a custom anime LoRA on the ANIMA base modelCitron Anima LoRA Trainerartokun/comfyui-mcp · by artokunTrain a custom anime LoRA on the ANIMA base model with Citron's local Gradio trainer (kohya sd-scripts), <6GB VRAM, character/style LoRAs; covers setup, dataset prep, training params, and using the result in the anima-base workflow★ 759 GitHub starsSkillDiscover Civitai models with the BUILT-IN downloadmodelCivitai + comfyui-mcpartokun/comfyui-mcp · by artokunDiscover Civitai models with the BUILT-IN download_model action:"search_civitai" and install/generate them locally. Find a checkpoint/LoRA/embedding on Civitai, download it into ComfyUI, and use its trigger words. Optionally pair the official Civitai MCP for community features (images browsing, posting, collections).★ 759 GitHub starsSkillDiagnose and fix video/image color OBJECTIVELYColor Correction (measure, don't eyeball)artokun/comfyui-mcp · by artokunDiagnose and fix video/image color OBJECTIVELY with the get_image (action:"analyze_color") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a contact sheet. Covers the "washed out" signature, why reference color-match (mkl/ColorMatch/ColorMatchAdobe) CAN'T add contrast a flat source lacks, the levels/contrast-stretch fix (core AdjustContrast / CurveEditor), the measure→fix→re-measure loop, the side-by-side sandbox pattern, and where to place the fix in a render graph (after decode, before save). Use when a render looks washed out / flat / dull / over-saturated / color-cast, or when deciding between a color-match and a contrast/levels fix.★ 759 GitHub stars