> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-custom-nodes-sdk-v2-frontend.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# WanSCAILToVideo - ComfyUI Built-in Node Documentation

> The WanSCAILToVideo node prepares conditioning and an empty latent space for video generation with SCAIL and SCAIL-2 video models.

The WanSCAILToVideo node prepares conditioning and an empty latent space for video generation with SCAIL and SCAIL-2 video models. It processes optional inputs like reference images, pose videos, CLIP vision outputs, colored identity masks, and previous frame chunks, embedding them into the positive and negative conditioning. The node outputs the modified conditioning and a blank latent tensor of the specified video dimensions, ready for sampling.

## Inputs

| Parameter              | Description                                                                                                                                                                                                                                                                 | Data Type            | Required | Range                 |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------- | --------------------- |
| `positive`             | The positive conditioning input.                                                                                                                                                                                                                                            | CONDITIONING         | Yes      | -                     |
| `negative`             | The negative conditioning input.                                                                                                                                                                                                                                            | CONDITIONING         | Yes      | -                     |
| `vae`                  | The VAE model used for encoding images and video frames.                                                                                                                                                                                                                    | VAE                  | Yes      | -                     |
| `width`                | The width of the output video in pixels (default: 512). Values step by 32.                                                                                                                                                                                                  | INT                  | Yes      | 32 to MAX\_RESOLUTION |
| `height`               | The height of the output video in pixels (default: 896). Values step by 32.                                                                                                                                                                                                 | INT                  | Yes      | 32 to MAX\_RESOLUTION |
| `length`               | The number of frames in the video (default: 81). Values step by 4.                                                                                                                                                                                                          | INT                  | Yes      | 1 to MAX\_RESOLUTION  |
| `batch_size`           | The number of videos to generate in a batch (default: 1).                                                                                                                                                                                                                   | INT                  | Yes      | 1 to 4096             |
| `pose_video`           | Video used for pose conditioning. Will be downscaled to half the resolution of the main video.                                                                                                                                                                              | IMAGE                | No       | -                     |
| `pose_video_mask`      | SCAIL-2 only. Colored per-identity SAM3 mask video at the same resolution as pose\_video.                                                                                                                                                                                   | IMAGE                | No       | -                     |
| `replacement_mode`     | SCAIL-2 only. False = Animation Mode (pose\_video\_mask should have black background). True = Replacement Mode (pose\_video\_mask should have white background). (default: False)                                                                                           | BOOLEAN              | No       | -                     |
| `pose_strength`        | Strength of the pose latent. (default: 1.0)                                                                                                                                                                                                                                 | FLOAT                | Yes      | 0.0 to 10.0           |
| `pose_start`           | Start step of the pose conditioning. (default: 0.0)                                                                                                                                                                                                                         | FLOAT                | Yes      | 0.0 to 1.0            |
| `pose_end`             | End step of the pose conditioning. (default: 1.0)                                                                                                                                                                                                                           | FLOAT                | Yes      | 0.0 to 1.0            |
| `reference_image`      | Reference image. The first image is the primary reference (composite all identities onto it). SCAIL-2: extra batch images are used as additional views (back view, close-up, occluded background), each needing a matching reference\_image\_mask in that identity's color. | IMAGE                | No       | -                     |
| `reference_image_mask` | SCAIL-2 only. Colored reference mask, batch matching reference\_image (first = primary reference mask, rest = identity masks for the additional reference\_image).                                                                                                          | IMAGE                | No       | -                     |
| `clip_vision_output`   | CLIP vision features for conditioning. Model is trained with stretch resize to aspect ratio.                                                                                                                                                                                | CLIP\_VISION\_OUTPUT | No       | -                     |
| `video_frame_offset`   | Cumulative output frame this chunk begins at. Wire from the previous chunk's video\_frame\_offset output. (default: 0)                                                                                                                                                      | INT                  | Yes      | 0 to MAX\_RESOLUTION  |
| `previous_frame_count` | Tail frames of previous\_frames to anchor. SCAIL-2 trained at 5 (81-frame chunks, 76-frame step). (default: 5)                                                                                                                                                              | INT                  | Yes      | 1 to MAX\_RESOLUTION  |
| `previous_frames`      | SCAIL-2 only. Full decoded output of the previous chunk. Only the last previous\_frame\_count are used as the extension anchor.                                                                                                                                             | IMAGE                | No       | -                     |

**Note:** The `pose_video` and `pose_video_mask` inputs are truncated together to the shorter of the two, and are processed only for the first `length` frames. If either input is shorter than or equal to `video_frame_offset`, it is ignored entirely. The `pose_video` is downscaled to half the resolution of the main video before encoding, and the encoded pose latent is multiplied by `pose_strength` and applied to the conditioning only between the `pose_start` and `pose_end` timestep steps. If `pose_video_mask` is provided, the colored mask video is downscaled to half resolution and converted into a 28-channel driving mask, which is added to both positive and negative conditioning.

**Note:** When `reference_image` is provided, each image in the batch is encoded individually into a latent and embedded into both positive and negative conditioning. The first image is the primary reference; additional images are used as additional views, each needing a matching `reference_image_mask`. `reference_image_mask` is only used when `reference_image` is also provided; when both are given, a 28-channel reference mask that binds the reference frames to identities is also built from the masks and added to the conditioning. In Replacement Mode (`replacement_mode=True`), the reference image is composited on a black background using the reference image mask as an alpha matte. When `clip_vision_output` is provided, it is applied to both positive and negative conditioning.

**Note:** When `previous_frames` is provided, only the last `previous_frame_count` frames are used as the extension anchor, and `video_frame_offset` is adjusted accordingly (reduced by the number of anchored frames, clamped at 0). The anchored frames are encoded and written into the beginning of the output latent, and a noise mask is included so those frames are kept unchanged during generation.

## Outputs

| Output Name          | Description                                                                                                                                                                                                                         | Data Type    |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `positive`           | The modified positive conditioning, potentially containing embedded reference image latents, CLIP vision output, pose video latents, driving masks, reference masks, or previous frame latents.                                     | CONDITIONING |
| `negative`           | The modified negative conditioning, potentially containing embedded reference image latents, CLIP vision output, pose video latents, driving masks, reference masks, or previous frame latents.                                     | CONDITIONING |
| `latent`             | An empty latent tensor of shape `[batch_size, 16, ((length - 1) // 4) + 1, height // 8, width // 8]`. When `previous_frames` is provided, the latent is partially filled with encoded previous frames and a noise mask is included. | LATENT       |
| `video_frame_offset` | Adjusted offset + length. Wire into the next chunk for sequential video generation.                                                                                                                                                 | INT          |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/WanSCAILToVideo/en.md)

***

**Source fingerprint (SHA-256):** `4a1a2201dfa94bd2f1330db02ec18a5e0a6aae9e9ac5ae97d456b7af1aa84b7b`
