Nodes/ComfyUI-AharaNodes/Get Frame at Index
ComfyUI Node

Get Frame at Index

Pick one grid cell, give it its own prompt, and mask it out for compositing

By chris-arsenault·Created 2 years ago·Updated 2 years ago· 0
Get Frame at Index
  • segments
  • clip
  • pos
  • neg
  • mask
  • mask_inverted
  • POS
  • NEG
segment_row0
segment_col0
pos_text
neg_text

Get Frame at Index is the consumer half of this pack's frame-segmenter pair. You feed it the grid from Frame Segmenter, pick one cell with segment_row and segment_col, and it hands you everything needed to generate that cell on its own: a mask of the cell, its mask_inverted, and POS/NEG conditioning that has been constrained to just that cell's area.

This is regional prompting, in grid form. The demand for it predates most ComfyUI packs: a single global prompt with two characters reliably smears their attributes together, and no amount of prompt wording fixes it. Splitting the canvas and giving each region its own conditioning is the standing answer - the technique Latent Couple and Regional Prompter popularized on A1111, that Forge Couple reimplemented, and that gets rebuilt for every new architecture. This node is a compact, grid-based take on it.

How it works, mechanically: it paints a white rectangle over the chosen cell (batched across frames, matching the grid), inverts it for the second mask, and constrains the conditioning using ComfyUI's native conditioning area mechanism with set_area_to_bounds=False - coordinates divided by 8, because conditioning areas live in latent space and 8 image pixels equal one latent pixel. If you wire pos/neg conditioning in, it uses those as-is; otherwise it encodes pos_text/neg_text through clip. Both, either, or neither prompt can be supplied - the author's own description says exactly that.

The inputs that matter:

  • segments (FRAME_SEGMENTS) - straight out of Frame Segmenter.
  • segment_row / segment_col (0–2): zero-based index into the grid. With a 2×2 grid that's rows 0–1 and cols 0–1.
  • pos_text / neg_text: the per-cell prompts (dynamic prompts supported).

Outputs: mask and mask_inverted (MASK), plus POS and NEG (CONDITIONING). Wire POS/NEG into your KSampler (or this pack's RepeatSampler) and use the masks to composite the generated cell back into the full frame - the mask to place it, the inverted mask to cut the rest of the base image down.

Two real gotchas. First, the validation: if you don't provide clip and you haven't wired both pos and neg, the node refuses and returns False for all four outputs - downstream that's a type error. In practice, wire a CLIP, or wire both conditionings. Second, the caveat every implementation of this technique carries: strict per-region conditioning held for the whole sample is exactly what produces collaged seams between regions, and this node's set_area_to_bounds=False is the strict end. Plan to composite with the seam mask from Frame Segmenter and feather the joins - or run the composited frame back through a low-denoise pass to unify it. Expect joins, and budget for hiding them.

Also worth knowing: the node's own description mentions a swap_dimensions option for tall orientation, but no such input exists in the schema - you get a tall frame by simply entering height > width. Sloppy doc drift, harmless in practice.

Install

Same for every node in this pack. ComfyUI Manager → Custom Nodes → search "ComfyUI-AharaNodes" → Install → restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/chris-arsenault/ComfyUI-AharaNodes
# then restart ComfyUI

No requirements.txt, no model files. Registered with the Comfy Registry.

Troubleshooting

If you get type errors on the four outputs, you tripped the validation - provide a CLIP or both conditionings. If your composited result shows hard seams, that's the regional-masking tradeoff, not a bug; blend with the seam mask or do a low-denoise unifying pass. And if all six nodes are missing from the menu, the pack failed to import: its frame_segmenter.py imports oauthlib and sympy at load time (both unused), so pip install oauthlib sympy into ComfyUI's Python usually fixes it.

CategoryAharaNodes/frame_segmenter

Inputs (8)

NameTypeDefaultDescription
segmentsFRAME_SEGMENTS
segment_rowINT00–2
segment_colINT00–2
pos_textSTRING
neg_textSTRING
clipoptCLIP
posoptCONDITIONING
negoptCONDITIONING

Outputs (4)

NameTypeDescription
maskMASK
mask_invertedMASK
POSCONDITIONING
NEGCONDITIONING