Nodes/ComfyUI_zura_nodes/Zura · Prepare H3 Frames and Mask
ComfyUI Node

Zura · Prepare H3 Frames and Mask

The boring arithmetic that makes MiniMax H3 accept your clip

By ZURAVFX·Created about a month ago·Updated a day ago· 2
Zura · Prepare H3 Frames and Mask
  • source
  • mask_video
  • guidance_audio
  • source_frames
  • performer_mask
  • speech
  • width
  • height
  • padded_frames
  • real_frames

MiniMax H3 does not accept arbitrary video. It wants a specific frame count on a specific temporal grid, a raster that divides by 32 in both directions, a mask that matches frame-for-frame, and an audio stream whose length lines up with the video latent. GenjH3FramePad ("Zura · Prepare H3 Frames and Mask") is the node that does that bookkeeping, and it does it without running any model at all - its own docstring says it "never performs model inference". It's arithmetic, validation, and padding.

Unglamorous. Also the difference between "H3 runs" and a cryptic shape error twenty nodes later.

What it checks, and what it pads

Validation first. It raises rather than guessing:

  • Prepare this shot at 24 fps before using H3. - either input's frame rate isn't 24.
  • H3 currently supports one continuous shot between 0.21 and 5 seconds. Choose a shorter clip or the two-second H3 preview. - the source is outside 5–124 frames.
  • H3 source dimensions must be multiples of 32. - 1280×720 is fine, 1281×721 is not.
  • The approved mask and source have different frame counts. Prepare the shot again.
  • The replacement mask is empty. Check the selection before rendering.

Then it pads. The target length is max(124, valid_length(count)), where valid_length is this pack's 5 + 17 × ceil((n − 5) / 17) - H3's 5-then-17-frame temporal grid. Extra frames are made by repeating the last real frame. Short takes get pushed up to at least 124 frames (about 5.1 s) because that's what the reference H3 examples use: the model keeps a full temporal context, and you trim the decoded result back afterwards. That's what the real_frames output is for.

The mask goes through a nearest-neighbour resize to the source raster and gets binarised at 0.5, so what reaches the sampler is a hard mask rather than a soft blob.

Then it fits the audio. If you wired guidance_audio it uses that; otherwise it takes the video's own audio, or synthesises silence if there isn't any. The waveform is padded or cut to exactly real_frames / 24 seconds of samples. GenjLoadH3Conditioning's own validation later checks that the audio latent length equals frames / 24 × 40, which is where this exactness pays off.

Inputs and outputs

Required: source (VIDEO - the reviewed clip) and mask_video (VIDEO - the approved mask rendered as frames, i.e. the performer_mask output of GenjLoadReviewedShot).

Optional: guidance_audio (AUDIO). In the pack's H3 graph this is fed from the guide video's own components, so it's the guide track rather than the source track.

Seven outputs, and every one gets used:

| Output | Wires into | | --- | --- | | source_frames (IMAGE) | the model patch / control-pixel branch | | performer_mask (MASK) | the sampler's mask input | | speech (AUDIO) | the audio VAE and the reference-audio lock | | width, height (INT) | ImageScale for the opening image and the depth guide | | padded_frames (INT) | the sampler's latent length | | real_frames (INT) | the crop after decoding - this is what stops your 96-frame shot from coming back 124 frames long |

In the H3 background-text-cleanup branch the pack instantiates this node twice: once on the combined edit mask, once on the genuine performer mask, so the two rasters and frame counts stay identical while only the combined mask is repaired.

Install

ComfyUI Manager → search Zura Nodes → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ZURAVFX/ComfyUI_zura_nodes
python -m pip install -r ComfyUI/custom_nodes/ComfyUI_zura_nodes/requirements.txt

This node needs nothing but PyTorch. The H3 route around it is the expensive part: minimax_h3_ref2va_pruned_int8_convrot.safetensors, the Qwen3-VL text encoder, the H3 video and audio VAEs and the union control patch - see INSTALL_STUDIO.md for the exact filenames, and note the H3 community licence's territory restriction before you start downloading tens of gigabytes.

Gotchas

Don't crop the padding away before sampling. real_frames exists so you trim after decoding. Trim the input to 96 frames and you're back to an invalid timeline.

The 32-multiple rule bites upscalers. Anything that produces 1366×768 or an arbitrary "1080p" will fail here. Round to a multiple of 32 upstream - 1280×704, 1408×768, and so on.

Audio from the wrong source. If your review used a reference track and you swapped the audio node out in Graph view, this node will happily fit the video's audio instead and your performance guide won't match what you heard in the review.

CategoryZura/Artist Studio

Inputs (3)

NameTypeDefaultDescription
sourceVIDEO—
mask_videoVIDEO—
guidance_audiooptAUDIO—

Outputs (7)

NameTypeDescription
source_framesIMAGE—
performer_maskMASK—
speechAUDIO—
widthINT—
heightINT—
padded_framesINT—
real_framesINT—