ApplyMaskLatentConditional
Latent compositing, gated by frame number
- destination
- source
- mask
- LATENT
Take the latent-space compositing of ApplyMaskLatent, add the frame-number gate of ApplyMaskConditional, and you get this node: it blends two LATENTs with a mask, but only on frames you specify. Everywhere else it passes the destination latent through unchanged. It's the most specific tool in the ApplyMask family, and it exists for one scenario - a per-frame loop where you want a latent composite to happen only inside a window of frames.
The gating inputs are identical to the pixel-space conditional: current_frame_number (wire your loop counter), apply_at_frames (a comma-separated list like 0, 15, 30), and don_not_apply_at_frames (boolean - invert the gate so it applies everywhere except the listed frames; the typo in the name is from the author, it's in the schema). Then destination, source, and the optional mask, with a LATENT output.
The mechanism: on a gated frame, the mask is resized to the latent's spatial resolution (latents are ~8× down from pixels) and the blend runs as destination × (1−mask) + source × mask on the samples. Off the gated frames, the destination latent is returned verbatim - same object, no composite, no wasted compute. The mask-resize handles dimension mismatches gracefully, so the mask doesn't have to arrive at exact latent resolution.
When it's worth it (and when it isn't)
Use it when you have a latent-space effect that should only touch part of a sequence - a style pass on frames 30–60, a latent blend that opens the shot and then stops, an effect that would otherwise need a branch in the graph. That's genuinely useful and hard to express cleanly any other way.
But be honest about whether you need it: if the composite is meant to run every frame, ApplyMaskLatent is the simpler node. If you're working in pixels, ApplyMaskConditional avoids the latent decode entirely. And mixing both conditionals in one graph - pixel on some frames, latent on others - is a recipe for confusion because you now have two different gates to keep in sync. Pick one space, pick one gate, and the node that best matches that pair. This one is the pair "latent space + selected frames," and when that's what you're building, it does exactly the job with no moving parts.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| destination | LATENT | — | |
| source | LATENT | — | |
| current_frame_number | INT | — | |
| apply_at_frames | STRING | — | |
| don_not_apply_at_frames | BOOLEAN | — | |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |