Nodes/genereti/ꘇ perception.regions
ComfyUI Node

ꘇ perception.regions

Perception.regions

By languel·Created 19 days ago·Updated a day ago· 1
ꘇ perception.regions
  • image
  • regions
  • preview
◄region_streamstage►
◄boxes{"version":1,"boxes":[{"name":"center","box":[0.25,0.25,0.5,0.5]}]}►

Anything regional in ComfyUI comes down to four numbers: x, y, width, height. Regional prompts, crops for a detailer pass, a spot to paste a fix into - the graph wants a rectangle, and you're left typing normalized floats into a widget and guessing whether 0.25, 0.25, 0.5, 0.5 lands on the face or on the wall behind it.

ꘇ perception.regions is the small, sensible fix for that. It's a node with a box editor inside it: drag to move, grab a corner handle to resize, name the box, done. No model, no inference, no download. You define named global normalized boxes and other Genereti nodes read them by name.

What it's for

It's one of the pack's "perception" nodes and the one that needs the least explanation. Genereti's framing is a shared coordinate space: one live image, several nodes that reason about where things are in it, and named streams so they can find each other. Regions contributes the deliberately dumb half - a box you drew with a mouse, held in a versioned JSON document, published under a name (default stage).

That's useful well outside the pack's live-visual agenda. Set your frame up once, name three boxes face, hands, background, and the shapes become a thing in the graph instead of a magic number repeated in four widgets. In a pack full of browser-audio and shader toys, this is the node you use on a Tuesday.

How it works, and the catch

The boxes widget is the whole state: a versioned document, {"version":1,"boxes":[{"name":"center","box":[0.25,0.25,0.5,0.5]}]}, where each box is [x, y, width, height] in normalized image coordinates - origin top-left, x right, y down, the convention the pack uses everywhere. The frontend renders it as draggable handles over your optional image, writes coordinates back as you drag, and publishes the result under region_stream.

Outputs are a regions DAT (the structured boxes, for inspection or for other Genereti nodes to consume) and a preview IMAGE with the boxes drawn on it - check your framing visually instead of trying to eyeball floats.

Here's what a beginner trips over within ninety seconds: this node does not run on the queue. Its Python execute deliberately raises:

Global region definitions are browser Live state; save the workflow or export JSON.

Not a bug, not a missing dependency - the box state lives in the browser, so there's nothing for a headless run to evaluate. Failing loudly beats silently handing you an empty regions output, so I'd call it the right call. It does mean your mental model is "editor overlay, live", not "node that computes when I hit Queue".

The inputs you actually touch

region_stream is the name the boxes publish under - stage by default. Keep it distinct from your provider stream names; a collision is a confusing way to spend an evening.

boxes is the document. Use the editor, but knowing the shape of the JSON is what lets you copy a set of regions between workflows, or hand-edit one when dragging gets fussy.

The optional image is the underlay: connect the frame your other perception nodes see, and the boxes you drag are in that image's coordinates. Without it you're drawing on nothing and guessing. Because coordinates are normalized, a box survives a resolution change - the same box describes the same relative patch at 512×512 and 1024×1024. Think fractions of the frame, not pixels.

Installing it

Manager, search Genereti, install, restart, refresh the browser tab. Manually:

cd ComfyUI
git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

The only real pip requirement is comfyui-frontend-package>=1.53.6; torch, numpy, pillow and aiohttp are expected to be ComfyUI's own. No model files are needed here - MediaPipe assets only download if you use the provider, which is a separate optional step.

Troubleshooting

Queue fails with the "browser Live state" error. Expected. Don't queue this node; open the editor and read the outputs live, or keep the boxes in the saved workflow and let the things downstream consume them there.

The editor shows boxes but no picture. You didn't connect image. The preview is the only way to check that [0.25,0.25,0.5,0.5] is on the subject.

A renamed box broke something downstream. Names are the API here, same as any named-stream design in the pack - renaming center to face is a breaking change for whatever is reading it. Name boxes once, deliberately.

Boxes look right in the preview but wrong after a render. Normalized coordinates are relative to the frame. If the consumer works on a crop, the numbers no longer mean the same thing - box against the frame you generate, or against the crop once you've made it.

Last thing: the pack is explicitly super alpha, "early classroom testing", and the author asks you to back up workflows before updating. An editor whose state lives in a JSON widget is exactly the kind of thing that gets a schema bump.

CategoryGenereti / Perception

Inputs (3)

NameTypeDefaultDescription
region_streamSTRINGstage—
boxesSTRING{"version":1,"boxes":[{"name":"center","box":[0.25,0.25,0.5,0.5]}]}—
imageoptIMAGE—

Outputs (2)

NameTypeDescription
regionsGENERETI_DAT—
previewIMAGE—