Nodes/ERPK Collection/Gemini Detect
ComfyUI Node

Gemini Detect

Object detection that names what it finds

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
Gemini Detect
  • image
  • client
  • regions
objects
seed-1
modelgemini-3.5-flash
temperature0.00
max_objects20

Here's the node that does something the rest of the pack can't: open-vocabulary object detection. Tell it "red car" and it finds the red car; tell it nothing and it finds everything prominent. Each detection comes back as a bounding-box region on an ERPK_REGIONS output that plugs straight into the pack's Regional Prompt Builder - which is how you get "put the hat on the man" layouts instead of "add a hat somewhere in the frame."

The mechanism is a vision call: the image goes to Gemini (default gemini-3.5-flash), which returns normalized box coordinates plus labels, and the node packages them into the pack's region format. No YOLO weights, no SAM download - just an API call that understands arbitrary nouns.

Inputs

  • image - required tensor to scan.
  • objects - the list, one per line (e.g. red car). Empty = detect all prominent objects.
  • model - default gemini-3.5-flash; other Gemini text/vision models available.
  • temperature - 0.0 default. The tooltip says it all: lower = more deterministic detection. Leave it at zero unless detections are being too rigid.
  • max_objects - cap on regions returned, default 20 (1–100). If a scene has clutter and you only care about three things, list them in objects instead of raising this.
  • seed - reproducibility, -1 randomizes.
  • client - optional; key from Settings if unconnected.

Output: one regions value (ERPK_REGIONS) - wire it into the Regional Prompt Builder's regions input. From there each region becomes an editable canvas box with a prompt line.

Install and gotchas

Part of the ERPK Collection:

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt

Restart (or ComfyUI Manager → search erpk), add a Google AI Studio key in Settings > ERPK > API Keys. Paid per detection call; Flash is cheap.

The recurring confusion is expecting a fixed set of classes like classic detectors - this is the opposite, and that's the feature. It'll happily find "the thing with the stripe" if you ask. The other gotcha is max_objects: at 20 with an empty objects field, a busy image gets 20 regions, and a Regional Prompt Builder canvas that crowded is a mess to read. Be specific in objects first, and treat max_objects as a safety valve, not a target.

CategoryERPK/Gemini

Inputs (7)

NameTypeDefaultDescription
imageIMAGEImage to detect objects in (ComfyUI tensor)
objectsSTRINGObjects to detect, one per line (e.g. 'red car'). Leave empty to detect all prominent objects.
seedINT-1-1–2147483647Seed for reproducible detection. Randomizes by default.
clientoptGEMINI_API_CLIENTGemini API client from Gemini API Config node (optional if API key is configured in Settings)
modeloptCOMBOgemini-3.5-flashGemini model to use for detection
temperatureoptFLOAT0.000–2Lower = more deterministic detection
max_objectsoptINT201–100Maximum number of regions to return

Outputs (1)

NameTypeDescription
regionsERPK_REGIONSDetected regions as JSON for the Regional Prompt Builder's regions input.