Mask Sequence From Mask
Turn one mask into a per-frame mask track
- mask
- MASK_SEQUENCE
Video workflows need a mask per frame, not just one mask. JWMaskSequenceFromMask is the little adapter that gets you there: hand it a single MASK and a length, and it repeats that mask into a MASK_SEQUENCE covering that many frames. Every frame gets the same mask. It's the fast way to say "mask this region for the whole clip," and it saves you from wiring up a mask a hundred times.
It's part of jamesWalker55's "Various ComfyUI Nodes by Type" pack, in the mask-sequence-ops group, which exists specifically for temporal masking, applying masks across a batch of latents the way per-frame video generation needs.
Where this fits
Temporal masking is the thing that made region-controlled video possible. The AnimateDiff era popularized it: to keep a subject locked or an area protected across a whole animation, you feed the sampler a mask for each frame. (These days you're more likely generating video on Wan or LTX than AnimateDiff, but the plumbing concept is the same, a mask that travels frame by frame.) The catch is that a lot of the time you don't want a different mask per frame, you want the same mask on all of them. Building that by hand is tedious. This node just stamps one mask across the length you give it.
The typical chain: make or load a MASK (a subject cutout, an inpaint region, a protected area), run it through JWMaskSequenceFromMask with the frame count of your clip, and feed the resulting MASK_SEQUENCE into the pack's JWMaskSequenceApplyToLatent so the mask is enforced on every latent in the batch.
The two inputs
- mask: the single MASK you want repeated. Whatever region is white gets masked on every frame.
- batch_size (default 1): how many frames long the sequence is. Set this to your clip's frame count. Leave it at 1 and you've technically made a one-frame sequence, which defeats the purpose.
The output is a MASK_SEQUENCE, a mask stack the length of batch_size.
Installing it
ComfyUI Manager: search "Various ComfyUI Nodes by Type" or jamesWalker55, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various
then restart ComfyUI. No models or extra dependencies.
The gotcha nobody warns you about
MASK_SEQUENCE is this pack's own custom type, not a standard ComfyUI mask. That matters more than it sounds. You can't feed a MASK_SEQUENCE into some random mask input on another node pack and expect it to work; it only interoperates with jamesWalker55's other mask-sequence nodes (JWMaskSequenceJoin to stitch two together, JWMaskSequenceApplyToLatent to actually use it). So treat these three as a set. If your masking needs live inside a different video framework (AnimateDiff-Evolved's own masking, or a Wan/VACE setup), that framework probably has its own per-frame mask handling and you may not need this pack at all.
Second, get batch_size to match your actual frame count. If the mask sequence length and the latent batch length disagree, the apply step won't line up the way you expect, and you'll get masking on the wrong frames or an error. Set it from the same number that drives your frame count so they can't drift apart.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| batch_size | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK_SEQUENCE | MASK_SEQUENCE | — |