Find a file
teal024 3dee8c4808 important bug fix: drop ref_sam black->white reversal at inference
The masking previously forced black ref backgrounds to white when
ref_mask_flag=True, but the training pipeline (diffusion_video.py)
applies no such reversal. This silently destroyed the bg-color signal
the model was trained on (black bg = inactive, white bg = active),
making inference inconsistent with training and with Wan.
2026-06-11 02:38:16 +00:00
.vscode update plans 2026-05-28 12:37:04 +00:00
configs scail-2 code integration 2026-05-28 12:37:05 +00:00
eval Initial commit (no history) 2025-12-01 06:40:57 +00:00
notuse Initial commit (no history) 2025-12-01 06:40:57 +00:00
sat scail-2 code integration 2026-05-28 12:37:05 +00:00
scail_pose@0733e4f856 update submodules 2025-12-18 14:14:45 +00:00
scripts add sequence parallelism inference 2026-03-16 02:52:36 +00:00
sgm scail-2 code integration 2026-05-28 12:37:05 +00:00
.gitignore fix typos 2026-05-28 17:13:09 +00:00
.gitmodules turn scail pose into a submodule 2025-12-18 07:50:40 +00:00
arguments.py scail-2 code integration 2026-05-28 12:37:05 +00:00
data_video.py add citation and paper link 2025-12-08 02:39:18 +00:00
diffusion_video.py scail-2 code integration 2026-05-28 12:37:05 +00:00
dit_video_crossattn_sc_xc.py scail-2 code integration 2026-05-28 12:37:05 +00:00
gen_prompts_gemini.py add snippets 2025-12-16 18:48:53 +00:00
LICENSE update 2026-06-09 18:23:38 +08:00
POSE_INSTRUCTION.md add community works 2025-12-18 08:32:13 +00:00
README.md update 2026-06-09 18:23:38 +08:00
requirements.txt format 2025-12-05 16:19:15 +08:00
sample_video.py important bug fix: drop ref_sam black->white reversal at inference 2026-06-11 02:38:16 +00:00

SCAIL-2 (SAT Implementation)

This branch holds the original SAT-based implementation of SCAIL-2 used to produce the results reported in the paper. It is preserved for reproducibility. For day-to-day inference, use the streamlined wan-scail2 branch instead.

Checkpoints

ckpts Download Link Notes
SCAIL-2 🤗 Hugging Face
🤖 ModelScope
Trained with mixed resolutions and fps.
End-to-end driven supports both 512p and 704p.
Pose-driven performs better under 704p.
H and W should be both divisible by 32
(e.g. 704*1280) if using other resolutions.

The checkpoint integrates Wan VAE and T5; arrange the downloaded files as:

SCAIL-2/
├── Wan2.1_VAE.pth
├── model
│   ├── 1
│   │   └── fsdp2_rank_0000_checkpoint.pt
│   └── latest
└── umt5-xxl
    ├── ...

Environment

Python 3.103.12.

pip install -r requirements.txt

Driving Video & Mask Preparation

SCAIL-2 takes three driving signals in addition to the reference image: a driving video, a per-frame driving mask, and a reference mask. Use the scail_pose submodule to generate them:

git submodule update --init --recursive
cd scail_pose
# follow instructions in POSE_INSTRUCTION.md

Depending on the driving mode, the files produced differ:

  • End-to-end driven (recommended). rendered_v2.mp4 is a copy of driving.mp4 — the model consumes the raw driving frames directly. The pipeline still produces rendered_mask_v2.mp4 (per-frame foreground mask of the driver) and ref_mask.jpg (foreground mask of the reference image).
  • Pose-driven. rendered_v2.mp4 is an SMPL pose-rendered video derived from the driving video, paired with rendered_mask_v2.mp4 / ref_mask.jpg as above.
  • Cross-identity replacement. Instead of rendered_mask_v2.mp4, supply replace_mask.mp4 (the region to be replaced) together with ref_mask.jpg.

Each example directory should look like:

examples/
├── 001
│   ├── driving.mp4
│   ├── ref.jpg
│   ├── rendered_v2.mp4         # end-to-end: copy of driving.mp4; pose-driven: SMPL rendering
│   ├── rendered_mask_v2.mp4    # OR replace_mask.mp4 (cross-identity replacement)
│   └── ref_mask.jpg            # foreground mask of the reference image
└── 002
...

Inference

CLI input:

bash scripts/sample_sgl_14Bsc_xc_cli.sh

The CLI accepts entries in the form <prompt>@@<example_dir>, e.g. the girl is dancing@@examples/001. Results are written to samples/.

Txt input: set input_file in configs/sampling/wan_pose_14Bsc_xc_txt.yaml to a file with the same <prompt>@@<example_dir> format, then run:

bash scripts/sample_sgl_14Bsc_xc_txt.sh

The model is trained with long detailed prompts; short or empty prompts will run but produce weaker results. Sampling configurations (resolution, etc.) live in configs/sampling/; for custom sampling logic edit sample_video.py.

Acknowledgements

Built on Wan 2.1; project architecture inherited from SCAIL.

Citation

@article{yan2025scail,
  title={SCAIL: Towards Studio-Grade Character Animation via In-Context Learning of 3D-Consistent Pose Representations},
  author={Yan, Wenhao and Ye, Sheng and Yang, Zhuoyi and Teng, Jiayan and Dong, ZhenHui and Wen, Kairui and Gu, Xiaotao and Liu, Yong-Jin and Tang, Jie},
  journal={arXiv preprint arXiv:2512.05905},
  year={2025}
}

License

Apache License 2.0 — see LICENSE.