Nodes/ComfyUI-NetflixVoid/VOID PQ5 Encode Quadmask
ComfyUI Node

VOID PQ5 Encode Quadmask

Snap your 4-level mask to the shape the VOID model demands

By jaskirat05·Created 5 months ago·Updated 5 months ago· 0
VOID PQ5 Encode Quadmask
  • quadmask
  • encoded_quadmask
  • mask_preview_video
sample_height384
sample_width672
max_video_length197
temporal_window_size85

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:

  1. 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.
  2. Invert (255 - x) to match the model's mask convention (this is the same object=dark convention the whole pipeline uses).
  3. Resize to sample_height × sample_width (default 384×672, matching the video encoder's config).
  4. Temporal-pad to the model's length, mirroring frames, the same (N // 4) * 4 + 1 logic the video encoder uses.
  5. Normalize to 0–1 and emit a mask_preview_video so you can eyeball the result.

The inputs that matter

  • quadmask (IMAGE) - from VOID 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 what VOID PQ5 Encode Video produced.
  • 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.

CategoryVOID/PQ5

Inputs (5)

NameTypeDefaultDescription
quadmaskIMAGE
sample_heightINT38464–2048
sample_widthINT67264–4096
max_video_lengthINT1971–2048
temporal_window_sizeINT851–2048

Outputs (2)

NameTypeDescription
encoded_quadmaskPQ5_MASK_TENSOR
mask_preview_videoIMAGE