MiniMax H3 Masking · Grid Preview:
The MiniMaxH3ContexMaskGridPreview node is designed to facilitate the visualization and adjustment of video masks within the H3 grid framework. This node allows you to preview and align a video mask to the effective 32x32 source-pixel generation cells used by the H3 system. By providing a grid overlay and outlining the original mask, it helps you understand the differences between the unsnapped and snapped masks, ensuring precise mask alignment. This functionality is particularly beneficial for AI artists working with video content, as it offers a clear visual representation of how masks are applied and adjusted across frames, enhancing the accuracy and effectiveness of mask-based operations.
MiniMax H3 Masking · Grid Preview Input Parameters:
image
This parameter represents the exact resized H3 canvas used by the video VAE. It is crucial that the width and height of the image are divisible by 32 to ensure compatibility with the H3 grid system. This ensures that the grid overlay aligns correctly with the video frames, providing an accurate preview of the mask application.
mask
The mask parameter is a static or tracked ComfyUI mask that is interpreted using the specified mask_meaning. This mask serves as the basis for the snapping process, where it is aligned to the H3 grid cells. The interpretation of the mask can vary, affecting how the mask is applied to the video frames.
cell_selection
This parameter allows you to choose from a list of grid modes, with the default being the first option in GRID_MODES. It determines how the H3 latent reduction is matched during runtime, offering conservative or strict alternatives for mask coverage. This selection impacts the precision and coverage of the mask application.
cell_adjust
An integer parameter that allows you to grow or shrink the mask by complete 32x32 H3 cells. The default value is 0, with a range from -8 to 8. Adjusting this parameter can help fine-tune the mask's coverage, either expanding or contracting it to better fit the desired area.
preview_frame
This integer parameter specifies which frame is displayed in the grid preview. The default is 0, with a range from 0 to 10000. It allows you to focus on a specific frame within the video batch, providing a detailed view of the mask application at that point in time.
overlay_opacity
A float parameter that controls the opacity of the orange snapped-generation overlay in the grid preview. The default value is 0.38, with a range from 0.0 to 1.0. Adjusting this opacity can help you better visualize the overlay in relation to the underlying video content, ensuring clarity in the preview.
show_grid
A boolean parameter that, when enabled, draws the effective 32x32 H3 source-pixel cell grid over the preview. This visual aid helps you understand the alignment and coverage of the mask in relation to the H3 grid structure.
show_source_outline
This boolean parameter outlines the original unsnapped mask, making its difference from the effective mask visible. Enabling this option provides a clear comparison between the original and adjusted masks, aiding in precise mask adjustments.
mask_meaning
This parameter defines the interpretation of the mask, with the default being the first option in MASK_MEANINGS. It affects how the mask is applied, particularly in terms of which areas are preserved or altered during the snapping process.
MiniMax H3 Masking · Grid Preview Output Parameters:
snapped_mask
The snapped_mask output is a complete mask batch that has been snapped to H3's effective causal 32x32 source-pixel cells. It uses the selected white-pixel convention to determine which areas of the mask are preserved or altered, providing a finalized version of the mask that aligns with the H3 grid structure.
grid_preview
This output provides the selected source frame with the snapped mask and optional grid or source outline overlaid. It serves as a visual representation of the mask application, allowing you to see how the mask interacts with the video content and the H3 grid.
grid_info
The grid_info output is a string summary of the selected frame, grid dimensions, and snapped-mask coverage. It provides detailed information about the mask application, including the number of cells, the mode used, and any adjustments made, offering insights into the mask's alignment and effectiveness.
MiniMax H3 Masking · Grid Preview Usage Tips:
- To ensure accurate mask alignment, make sure your image dimensions are divisible by 32, as this is crucial for the H3 grid system.
- Use the
cell_adjustparameter to fine-tune the mask's coverage, expanding or contracting it to better fit your desired area. - Enable
show_gridandshow_source_outlineto gain a clear visual understanding of how the mask aligns with the H3 grid and how it differs from the original mask.
MiniMax H3 Masking · Grid Preview Common Errors and Solutions:
"Image dimensions not divisible by 32"
- Explanation: The image provided does not have dimensions that are divisible by 32, which is required for the H3 grid system.
- Solution: Resize your image so that both the width and height are divisible by 32 to ensure compatibility with the grid overlay.
"Invalid mask_meaning value"
- Explanation: The
mask_meaningparameter has been set to a value that is not recognized by the system. - Solution: Ensure that the
mask_meaningparameter is set to a valid option from theMASK_MEANINGSlist provided by the node.
"Frame index out of range"
- Explanation: The
preview_frameparameter is set to a value that exceeds the available frames in the video batch. - Solution: Adjust the
preview_frameparameter to a value within the range of available frames, ensuring it does not exceed the total number of frames in the batch.
