Nodes/ComfyUI-nhknodes/⏹️ Load 3x3 Grid Series (nhk)
ComfyUI Node

⏹️ Load 3x3 Grid Series (nhk)

Every file is a 3x3 grid — this node walks it cell by cell

By Enashka·Created 12 months ago·Updated 28 days ago· 23
⏹️ Load 3x3 Grid Series (nhk)
    • image
    • filename
    • current_index
    • total_images
    • grid_position
    • position_name
    mode
    path
    pattern*
    index0
    seed0
    labelGrid3x3_001
    resetfalse
    separator_width0

    Load3x3GridSeries is Load2x2GridSeries with nine cells instead of four. Same idea, same machinery: point it at a folder of images that are really 3x3 contact grids, and it hands you one cell per execution, in reading order - top-left, top-center, top-right, then the middle row, then the bottom - advancing automatically until it wraps around. If you batch-compose your generations into 3x3 sheets for review, this is the node that un-sheets them for processing.

    It sits in nhk/image next to its 2x2 sibling, and everything about the inputs and outputs carries over. If you've read that article, skip ahead to the separator section - that's the only place the two genuinely differ.

    How it works

    Each source file is divided into a 3x3 grid using thirds: cell_width = width // 3, cell_height = height // 3. The node keeps a per-label in-memory counter that steps through cells across all files - total_grid_cells = number_of_files × 9 - so index 0–8 are file 1's nine cells, 9–17 are file 2's, and so on, wrapping at the end.

    • single_image mode: loads by cell index, auto-advances one cell per run. index sets the start, reset jumps back to 0.
    • random mode: seeded RNG picks a cell between 0 and cells−1. Same seed, same cell, every time.
    • separator_width (default 0): a 3x3 grid has two horizontal and two vertical divider lines, and if your composites have visible gutters, naive thirds will slice through them. Set this to the line thickness and the crop boxes pull back from the divider pixels on every edge. (The math is a little more fiddly than the 2x2 version because there are interior lines on both sides of the middle cells, but the effect is the same: clean cells, no gutter bleed.)

    Outputs: image (the cell), filename (the source grid file), current_index (cell index across the whole sequence), total_images (total cells = files × 9), grid_position (0–8), and position_name - the 3x3 names are "top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right". The position outputs make it easy to build a "this file, this cell" log as you process.

    Installing

    Same routine as the rest of the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Enashka/ComfyUI-nhknodes
    

    or via ComfyUI Manager (search "NHK Nodes"), then restart. No models to fetch, no extra dependencies - it lives under nhk/image.

    Where people get burned

    • Slivers on cell edges. Your grids have gutters and separator_width is 0. Measure the divider and set it.
    • The counter doesn't match your mental model. It counts cells, not files. A "step" is one ninth of one image. Read position_name if you're ever unsure where the sequence actually is.
    • Repointing the folder without a new label. The counter carries on from the old sequence. Change the label or flip reset when you switch directories.
    • Odd dimensions. Thirds are integer divisions, so a grid whose dimensions aren't divisible by 3 silently drops edge pixels. Minor, but it's why your bottom-right cell can come out a pixel or two short.

    If your workflow is "3x3 contact sheets → individual frames," this is the node. And since the whole series family shares the same label-counter system, you can run a 2x2 loader and a 3x3 loader side by side for different sources without them colliding - just give each a unique label.

    Categorynhk/image

    Inputs (8)

    NameTypeDefaultDescription
    modeCOMBOsingle_image: load by index (use with control_after_generate=increment for sequences), random: load random grid cell by seed
    pathSTRINGDirectory path containing grid images to load
    patternSTRING*Glob pattern to filter files (e.g., '*.png', 'img_*.jpg', '**/*.png' for recursive)
    indexINT0Starting index for single_image mode (auto-increments with control_after_generate)
    seedINT0Seed for random mode (same seed = same random grid cell)
    labelSTRINGGrid3x3_001Unique identifier for tracking this sequence independently from others
    resetBOOLEANfalseReset counter back to index 0
    separator_widthINT00–100Width of separator lines between grid cells (in pixels). Excludes this many pixels from center lines.

    Outputs (6)

    NameTypeDescription
    imageIMAGE
    filenameSTRING
    current_indexINT
    total_imagesINT
    grid_positionINT
    position_nameSTRING