Install any skill in seconds. Free to start, no credit card required.
Get Started Free →SCAIL-2 in-video character replacement on WAN 2.1 — WanSCAILToVideo + SCAIL2ColoredMask + SAM3, the reference-image framing→scale rule, and the tuning/compositing pitfalls
.claude/skills/artokun-wan-scail-replacement/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -20% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -4% | 0% |
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.
In replacement_mode: true, the reference image's FRAMING controls the output character's SIZE — not just 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/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.
Why it's a trap: this isn't stated in the template's on-canvas notes, and it does not surface in the popular Civitai motion-transfer workflows — those run animation mode, where the reference legitimately fills the frame.
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 — but 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.
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:
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.
The template's int8 build was exercised with:
wan2.1_14B_SCAIL_2_int8_convrot — SCAIL-2 modelwan2.1_SCAIL_2_DPO_lora_bf16 — DPO LoRAlightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16 — distill LoRA (see tuning note)Wan2_1_VAE_bf16umt5_xxl_fp8_e4m3fn_scaled — text encoderclip_vision_hsam3.1_multiplex_fp16 — SAM3 mask modelVRAM: ~22.2 GB peak at 576x1024 / 81-frame chunks on a 24 GB card.
wan-t2v-video, wan-flf-video — other WAN 2.x video pipelinesdirector — multi-shot scene direction for video pipelines| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,043 | 4,409 | -73% | 1 | 1 | 0% | 2,484 | 1,996 | -20% | 0 | 0 | — |
case-02 | fail→pass | 13,284 | 4,562 | -66% | 1 | 1 | 0% | 1,971 | 1,906 | -3% | 0 | 0 | — |
case-03 | pass→pass | 12,269 | 4,218 | -66% | 1 | 1 | 0% | 1,821 | 1,919 | +5% | 0 | 0 | — |
case-04 | pass→pass | 13,693 | 4,991 | -64% | 1 | 1 | 0% | 2,247 | 2,112 | -6% | 0 | 0 | — |
case-05 | pass→pass | 14,518 | 4,208 | -71% | 1 | 1 | 0% | 2,221 | 1,898 | -15% | 0 | 0 | — |
case-06 | fail→pass | 14,061 | 6,636 | -53% | 1 | 1 | 0% | 1,995 | 2,222 | +11% | 0 | 0 | — |
case-07 | fail→pass | 11,005 | 5,260 | -52% | 1 | 1 | 0% | 1,597 | 2,085 | +31% | 0 | 0 | — |
case-08 | fail→pass | 9,575 | 1,423 | -85% | 1 | 1 | 0% | 1,472 | 1,412 | -4% | 0 | 0 | — |
case-09 | fail→pass | 10,878 | 2,749 | -75% | 1 | 1 | 0% | 1,526 | 1,636 | +7% | 0 | 0 | — |
case-10 | fail→pass | 12,454 | 5,704 | -54% | 1 | 1 | 0% | 2,138 | 2,160 | +1% | 0 | 0 | — |
case-11 | fail→pass | 15,132 | 7,116 | -53% | 1 | 1 | 0% | 2,207 | 2,311 | +5% | 0 | 0 | — |
case-12 | pass→pass | 14,807 | 8,585 | -42% | 1 | 1 | 0% | 2,293 | 2,302 | +0% | 0 | 0 | — |
case-13 | fail→pass | 7,258 | 2,150 | -70% | 1 | 1 | 0% | 1,322 | 1,578 | +19% | 0 | 0 | — |
case-14 | fail→pass | 7,036 | 2,418 | -66% | 1 | 1 | 0% | 1,195 | 1,602 | +34% | 0 | 0 | — |
case-15 | fail→pass | 8,805 | 1,532 | -83% | 1 | 1 | 0% | 1,642 | 1,458 | -11% | 0 | 0 | — |
case-16 | fail→pass | 10,575 | 5,212 | -51% | 1 | 1 | 0% | 1,744 | 2,099 | +20% | 0 | 0 | — |
case-17 | fail→pass | 15,692 | 3,421 | -78% | 1 | 1 | 0% | 2,187 | 1,766 | -19% | 0 | 0 | — |
case-18 | fail→pass | 11,297 | 2,306 | -80% | 1 | 1 | 0% | 2,090 | 1,604 | -23% | 0 | 0 | — |
case-19 | fail→pass | 13,939 | 5,201 | -63% | 1 | 1 | 0% | 2,202 | 2,152 | -2% | 0 | 0 | — |
case-20 | pass→pass | 13,038 | 4,065 | -69% | 1 | 1 | 0% | 1,985 | 1,850 | -7% | 0 | 0 | — |
case-21 | pass→pass | 11,178 | 4,789 | -57% | 1 | 1 | 0% | 1,866 | 2,029 | +9% | 0 | 0 | — |
case-22 | fail→pass | 12,880 | 2,295 | -82% | 1 | 1 | 0% | 2,445 | 1,562 | -36% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +73 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.