VOID PQ5 Encode Quadmask
Snap your 4-level mask to the shape the VOID model demands
- quadmask
- encoded_quadmask
- mask_preview_video
The quadmask from VOID Combine Quadmask is a clean, 4-level mask at your video's native resolution. The VOID model doesn't want that - it wants the mask resized to its latent-friendly resolution, quantized to exactly the four levels its trimask mechanism understands, frame-padded to its temporal shape, and inverted to match its internal convention. This node is that transformation. It's the mask half of the encoder pair, mirroring VOID PQ5 Encode Video (which does the same reshaping for the video itself).
It's a fiddly-but-necessary node. The settings here are where "why does the sampler say the frame counts don't match" usually comes from, so it's worth understanding what each one controls.
How it works
Five steps, all deterministic:
- Quantize each pixel to one of four levels - ≤31 → 0, 32–95 → 63, 96–191 → 127, >191 → 255 - which turns your "black/both/grey/white" quadmask into the exact values the VOID model was trained on.
- Invert (
255 - x) to match the model's mask convention (this is the same object=dark convention the whole pipeline uses). - Resize to
sample_height×sample_width(default 384×672, matching the video encoder's config). - Temporal-pad to the model's length, mirroring frames, the same
(N // 4) * 4 + 1logic the video encoder uses. - Normalize to 0–1 and emit a
mask_preview_videoso you can eyeball the result.
The inputs that matter
quadmask(IMAGE) - fromVOID Combine Quadmask.sample_height/sample_width(INT, defaults 384×672) - should match the model's config, which is what the video encoder already used. The sampler will interpolate if they differ from the video's, but matching avoids surprises.max_video_length(INT, default 197) - the model's frame ceiling; must align with whatVOID PQ5 Encode Videoproduced.temporal_window_size(INT, default 85) - the minimum length the mask gets padded to. This one must match between the encode-video and encode-quadmask stages - the sampler hard-errors when the video and mask tensors have different frame counts, and a mismatch in these two settings is the usual cause.
Outputs: encoded_quadmask (PQ5_MASK_TENSOR) → the sampler's encoded_quadmask input, plus mask_preview_video (IMAGE) for checking.
Install & gotchas
Standard pack install (Manager → "ComfyUI-NetflixVoid", or clone into custom_nodes). No downloads; pure tensor work on the CPU side.
The practical gotchas: leave max_video_length and temporal_window_size at their defaults unless you know why you're changing them - they exist to be matched, not tuned. And if the sampler complains about resolution, remember it requires mask dimensions divisible by 8; the defaults are, so you have to go out of your way to break that. When the frame-count error does hit, check that this node and the video encoder are using the same length settings before touching anything else.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| quadmask | IMAGE | — | |
| sample_height | INT | 38464–2048 | — |
| sample_width | INT | 67264–4096 | — |
| max_video_length | INT | 1971–2048 | — |
| temporal_window_size | INT | 851–2048 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| encoded_quadmask | PQ5_MASK_TENSOR | — |
| mask_preview_video | IMAGE | — |