Nodes/ComfyUI-TJ_NODE/Wan SCAIL Extend Sampler (TJ)
ComfyUI Node

Wan SCAIL Extend Sampler (TJ)

Long motion-transfer clips without hand-chaining samplers

By designloves2·Created 4 months ago·Updated 4 days ago· 13
Wan SCAIL Extend Sampler (TJ)
  • model
  • clip
  • vae
  • reference_image
  • pose_video
  • clip_vision
  • pose_video_mask
  • reference_image_mask
  • images
  • frame_count
positive
negativelowres, error, cropped, worst quality, low quality, jpeg artifacts, heterochromia, out of frame, disfigured, blurry, fat, (ugly:1.3), deformed, mutilated, fingers cut, face cut, head cut, bad anatomy, bad proportions, two heads, two faces, deformed hands, (twisted fingers:1.22), extra fingers, poorly drawn, grainy, poorly drawn face, mutation, poor facial details, cropped head, poorly drawn eyes, unclear eyes, cross-eyes, malformed limbs, poorly drawn hands, fused hands, mutated hands, malformed hands, (mutated fingers:1.4), (fused fingers:1.313), interlocked fingers, extra or missing fingers, (one hand with more than 5 fingers), (one hand with less than 5 fingers), one hand with more than 5 digits, one hand with less than 5 digits, extra digits, fewer digits, bad hair, poorly drawn hair, fused hair, poorly drawn feet, malformed feet, extra or missing feet, fused feet, missing or extra limbs, disfigured, mutilated hands, extra hands, extra arms, extra legs, missing arms, missing hands, missing legs, fingers of different thickness, pointed fingers, thick fingers, (long thumbs:1.35), sharp fingernails, (greyscale:1.3), grain, (monochrome:1.3), Text, Watermark
width512
height896
base_frames81
extend_segments0
seed1
steps6
cfg1.0
sampler_nameeuler
schedulersimple
shift5.00
previous_frame_count5
color_matchtrue
color_anchorfirst chunk
replacement_modefalse
pose_strength1.00
pose_start0.00
pose_end1.00
clip_vision_cropnone
extend_1_frames81
extend_2_frames81
extend_3_frames81
extend_4_frames81
extend_5_frames81
extend_6_frames81
extend_7_frames81
extend_8_frames81
frame_modetarget total
target_total_frames157
color_samplewhole chunk
color_match_strength1.00

The node that hides SCAIL-2's chunk arithmetic

Wan SCAIL Extend Sampler (TJ) folds the entire Wan 2.1 SCAIL-2 generate-then-extend graph into one node. SCAIL-2 is Z.ai's Apache 2.0 motion-transfer model - reference image + driving video in, animated video out - and the thing everyone hits is its hard 81-frame window: anything longer has to be rendered in chunks and stitched, with each chunk re-anchored on the previous one's tail. The stock ComfyUI workflow makes you hand-chain samplers and hand-calculate the overlap. This node does that for you.

If you've read the SCAIL-2 threads, the arithmetic is the recurring grumble: "divide the clip into 81-frame segments, hand-calculate the final segment against the 4n+1 frame requirement and the context overlap." That's exactly the tax this node removes. The author's own docstring counts it: at two extends it replaces roughly 22 core nodes - text encode ×2, CLIP vision encode, ModelSamplingSD3, scheduler, N+1 sampler/VAE-decode pairs, image-range slicing, color transfer, final concat - with one.

How it works

You feed it the usual model/clip/vae (SCAIL-2 needs a reference image + CLIP vision + the driving pose_video), a positive/negative prompt, and it samples the first chunk (base_frames, default 81 - Wan wants 4k+1 lengths like 65/81) then extends by extend_segments chunks. Each extend chunk re-anchors on previous_frame_count tail frames (SCAIL-2 is trained at 5) and trims the overlap off the output.

The color handling is the part the stock graph leaves to you, and it's genuinely thoughtful:

  • color_match - a Reinhard LAB color transfer on every extend chunk so colors don't drift.
  • color_anchor - anchor every chunk to the first chunk (stops the cumulative fade from repeated VAE round-trips) or to the previous chunk (smoothest seams, follows drift).
  • color_sample - whether the color target uses the whole anchor chunk or just its last frame, and color_match_strength (0–1) to dial the pull back when a scene legitimately changes color.

There are two frame-driving modes: target total (enter a goal, it auto-splits into chunks) or manual segments (drive each of up to 8 extend chunks yourself with extend_N_frames). replacement_mode and pose_strength/pose_start/pose_end handle the mask-based replacement variants.

Install it

No extra Python deps beyond the pack, but you need SCAIL-2 weights loaded via standard ComfyUI nodes feeding the model/clip/vae inputs:

cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE.git

Or ComfyUI Manager → search TJ_NODE, restart. Category: ✨ TJ_Node/Video.

Where people get burned

Be honest about compute: the KB's SCAIL-2 consensus is that generation cost is the wall - minutes to tens of minutes per clip, 16GB VRAM comfortable at fp8, 8GB only at low res with GGUF. Don't set target_total_frames to 1000 and wander off. Second, the overlap math is real: previous_frame_count is trimmed from each extend chunk, so the landed total won't be exactly your target - the readout exists because 4k+1 framing means it's never exact. Third, face drift across chunks is a known model limitation; the community's first move is dropping speed LoRAs and raising steps/CFG, not blaming the node. And if colors visibly shift down the video, you've almost certainly got color_match off or color_anchor set to "previous chunk" while scenes are changing.

Category ✨ TJ_Node/Video

Inputs (40)

NameTypeDefaultDescription
modelMODEL
clipCLIP
vaeVAE
reference_imageIMAGE
pose_videoIMAGE
positiveSTRING
negativeSTRINGlowres, error, cropped, worst quality, low quality, jpeg artifacts, heterochromia, out of frame, disfigured, blurry, fat, (ugly:1.3), deformed, mutilated, fingers cut, face cut, head cut, bad anatomy, bad proportions, two heads, two faces, deformed hands, (twisted fingers:1.22), extra fingers, poorly drawn, grainy, poorly drawn face, mutation, poor facial details, cropped head, poorly drawn eyes, unclear eyes, cross-eyes, malformed limbs, poorly drawn hands, fused hands, mutated hands, malformed hands, (mutated fingers:1.4), (fused fingers:1.313), interlocked fingers, extra or missing fingers, (one hand with more than 5 fingers), (one hand with less than 5 fingers), one hand with more than 5 digits, one hand with less than 5 digits, extra digits, fewer digits, bad hair, poorly drawn hair, fused hair, poorly drawn feet, malformed feet, extra or missing feet, fused feet, missing or extra limbs, disfigured, mutilated hands, extra hands, extra arms, extra legs, missing arms, missing hands, missing legs, fingers of different thickness, pointed fingers, thick fingers, (long thumbs:1.35), sharp fingernails, (greyscale:1.3), grain, (monochrome:1.3), Text, Watermark
widthINT51264–8192
heightINT89664–8192
base_framesINT815–1024Frames of the first chunk, and the per-chunk size auto mode extends with. Wan wants 4k+1 lengths (65, 81, ...).
extend_segmentsINT00–8
seedINT10–18446744073709550000Base noise seed. Each extend chunk uses seed + chunk index.
stepsINT61–100
cfgFLOAT1.00–30
sampler_nameCOMBOeuler44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOsimple9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
shiftFLOAT5.000–100ModelSamplingSD3 sigma shift. 0 keeps the model's own sampling.
previous_frame_countINT51–33Tail frames of the previous chunk each extend re-anchors on (SCAIL-2 is trained at 5). The overlap is trimmed from the extend output.
color_matchBOOLEANtrueReinhard LAB color transfer of every extend chunk so the colors stay consistent down the video.
color_anchorCOMBOfirst chunkWhich chunk color_match aims at. 'first chunk' anchors every chunk to the first chunk, stopping the cumulative fade that chunk-by-chunk VAE round-trips cause. 'previous chunk' matches each chunk to the one before it (smoothest seams, but follows the drift). See color_sample for which frames set the target.
replacement_modeBOOLEANfalse
pose_strengthFLOAT1.000–10
pose_startFLOAT0.000–1
pose_endFLOAT1.000–1
clip_vision_cropCOMBOnone2 options: none, center
extend_1_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_2_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_3_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_4_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_5_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_6_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_7_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
extend_8_framesINT819–1024Frames rendered for this extend chunk; the first previous_frame_count of them are the overlap and get trimmed.
frame_modeCOMBOtarget totaltarget total: enter a goal frame count; the node auto-splits it into base_frames-sized chunks and extends as needed (last chunk trims to fit). manual segments: drive each extend chunk yourself with the +/- slots.
target_total_framesINT1575–100000Goal output frames in 'target total' mode. The readout shows the actual landed total (4k+1 grid means it may differ by a few frames).
color_sampleCOMBOwhole chunkWhich frames of the anchor chunk set the color target. 'whole chunk' averages the chunk's color so a color-atypical tail (e.g. a blue close-up right before a zoom-out) can't drag the next chunk's color. 'last frame' matches the seam frame exactly (tightest seam, but vulnerable to that tail).
color_match_strengthFLOAT1.000–1How hard color_match pulls each chunk toward the target color. 1.0 = full transfer, 0.0 = none (same as turning color_match off). Lower it when scenes legitimately change color and full matching tints them.
clip_visionoptCLIP_VISION
pose_video_maskoptIMAGE
reference_image_maskoptIMAGE

Outputs (2)

NameTypeDescription
imagesIMAGE
frame_countINT