AD_scail2_generate
SCAIL-2 segments that only carry five frames forward
- context
- stage_info_data1
- pose_video
- reference_image
- pose_video_mask
- reference_image_mask
- context
- bridge_image
- segment_video
- merged_video
SCAIL-2 is the interesting one out of Z.ai: a human motion-transfer model built on a Wan 2.1 base that threw away the pose skeleton. You hand it a reference image, a driving video and colored masks, and it does the transfer - which is why it works on animals and multiple characters where the skeleton-based tools don't. It also shipped into ComfyUI core (comfy_extras/nodes_scail.py), not into someone's node pack, which is the reason AD_scail2_generate is thin rather than enormous: it's orchestration on top of core's WanSCAILToVideo.
What it adds on top of core
Length. One SCAIL-2 call gives you one clip, and long clips fall apart or don't fit. This node runs a stage loop: each execution generates one segment, and instead of dragging the whole previous clip into the next one, it carries only the tail frames - previous_frame_count, five by default, because that's what SCAIL-2 was trained with. Every segment is written out as its own MP4 under .apt_stage_bridge/<run_id>/segments/, and on the final stage the node concatenates them all into a _final.mp4. That's the whole pitch, and it's a good one: the memory cost stays flat as the clip gets longer.
The stage bookkeeping lives in the pack's other nodes. flow_stage_begin hands out a FLOW_STAGE_INFO telling each run which stage it is and how many there are; this node reads that, and optionally reports back with stage_info_data1.
The inputs you'll actually touch
The node refuses to start without a populated RUN_CONTEXT (model, clip, vae, width, height, steps, cfg, sampler, scheduler) - that's the pack's whole design, one wire instead of forty. Then:
positive/negative- text.positivedefaults to"reference motion ", which is a SCAIL-style hint, not a prompt you should keep.length- output frames per segment, step 4. Reads 81 out of the box.segment_count- leave it at 1 and it takes the stage total fromflow_stage_begin; set it above 1 and it must match that total or the node throws.previous_frame_count- the carry-over. Five is the trained value; if you grow the clip with multi-segment runs,lengthmust be at least this.replacement_mode- the black-vs-white mask background switch.Falseis animation mode,Trueis replacement mode.clip_vision_name,seed,fps,transfer_color,pose_strength- the usual. Color transfer (reinhard_labby default, ormkl_lab/histogram) only applies when you've connected a reference image, and the node will tell you so if you enable it without one.
On the optional side: pose_video and pose_video_mask take either an IMAGE batch or a file-backed VIDEO - and the VIDEO path is the one you want, because the node decodes only the window each stage needs instead of a whole driving clip into VRAM at once. reference_image takes the identity view (followed by any extra angles), reference_image_mask takes its colored masks, and stage_info_data1 wires to the stage scheduler.
Four outputs: context (into the next stage), bridge_image (the tail frames, as an image), segment_video (this stage's segment), and merged_video - which only produces anything on the last stage. Earlier stages block it, deliberately.
Installing it
ComfyUI Manager → ComfyUI-Apt_Preset, or:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r ComfyUI-Apt_Preset/requirements.txt
Restart after. Two of the pack's dependencies matter here specifically: SCAIL-2 support comes from ComfyUI core, so you need a build recent enough to have comfy_extras.nodes_scail and the comfy_api.latest module this file imports - otherwise the node just doesn't appear. And if you're using a reference image, you need clip_vision_h.safetensors in your models folder, which is a plain git clone away from most people's already-downloaded Wan stash.
Where people get burned
Replacement mode. The most common confusion around SCAIL-2 in the wild is exactly the toggle this node exposes: flip it the wrong way and the character gets replaced instead of animated, and the background either survives or turns to mush depending on which mode you meant. If your background looks degraded after a replacement-mode run, you're in the wrong mode, not in a broken workflow.
Indexing math. Because segment_count and flow_stage_begin.total have to agree, changing the total on one node and forgetting the other produces a validation error rather than a nice long video. Same for length vs previous_frame_count on multi-segment runs.
Source frames run out. If a stage has no source frames left - because your driving video is shorter than length × total - the node says so and tells you to reduce the total. That's a feature; the alternative is a frozen final segment.
Payload types. Pose inputs must be IMAGE tensors or file-backed VIDEO objects; an in-memory video object from some other node raises a TypeError instead of quietly working. And merged_video is only live on the last stage, so if you queue stage 1 of 6 and nothing comes out of it, nothing is wrong.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| context | RUN_CONTEXT | — | |
| positive | STRING | reference motion | — |
| negative | STRING | bad | — |
| length | INT | 811–16384 | Final output frames per segment. The last segment uses its actual remaining source frames. |
| segment_count | INT | 11–4096 | 1 uses flow_stage_begin.total automatically. Values above 1 must match total. |
| fps | FLOAT | 241–120 | — |
| clip_vision_name | COMBO | clip_vision_h.safetensors | 0 options: |
| seed | INT | 00–18446744073709550000 | — |
| transfer_color | COMBO | reinhard_lab | 4 options: none, reinhard_lab, mkl_lab, histogram |
| pose_strength | FLOAT | 1.000–10 | Strength of the pose latent. |
| previous_frame_count | INT | 51–16384 | Tail frames of previous_frames to anchor. SCAIL-2 was trained with 5. |
| replacement_mode | BOOLEAN | false | False: Animation Mode with a black pose mask background. True: Replacement Mode with a white pose mask background. |
| stage_info_data1opt | FLOW_STAGE_INFO | — | |
| pose_videoopt | IMAGE,VIDEO | Pose conditioning. Connect Load Video's VIDEO output for per-stage window decoding; IMAGE batches are sliced after upstream decoding. | |
| reference_imageopt | IMAGE | Primary reference followed by optional additional identity views. | |
| pose_video_maskopt | IMAGE,VIDEO | SCAIL-2 colored mask video. File-backed VIDEO is decoded per stage; IMAGE batches are sliced after upstream decoding. | |
| reference_image_maskopt | IMAGE | Colored reference masks matching reference_image. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| context | RUN_CONTEXT | — |
| bridge_image | IMAGE | — |
| segment_video | VIDEO | — |
| merged_video | VIDEO | — |