Nodes/ComfyUI_HBH-image_overlay/HBH Image Coordinate Picker
ComfyUI Node

HBH Image Coordinate Picker

The picker that hands you pixel coordinates — and doesn't draw a dot

By wings6407·Created about a year ago·Updated about a year ago· 1
HBH Image Coordinate Picker
  • image
  • image
  • x_coordinate
  • y_coordinate
  • coordinates_json
initial_x0
initial_y0
point_color
point_size10

HBH_ImageCoordinatePicker is the first half of a two-node trick: you point at a spot on an image and it hands you that spot as numbers. It comes from wings6407's ComfyUI_HBH-image_overlay pack, a tiny collection whose whole job is placing one image on top of another. This node is the "where" - HBH_ImageOverlay is the "there it goes."

Honest framing up front: the name slightly oversells it. This node doesn't let you click on an image. You type a position into initial_x and initial_y, and it returns those coordinates (clamped to the image bounds, so a value past the edge just snaps back in) plus a JSON blob. What makes it useful is that the numbers come out as outputs, not just widgets - so something downstream can actually consume them in the graph.

One thing that trips people: the image output here is a passthrough. No dot is drawn on it. The point_color and point_size inputs exist because the companion node HBH_ImageCoordinatePreview reads them out of the JSON and draws the marker for you. Feed this node's image and coordinates_json into that preview node and you finally see where your point landed.

The inputs that actually matter:

  • initial_x / initial_y (0–4096, default 0) - your starting point; anything outside the image gets clamped to the edge.
  • point_color and point_size (1–50, default 10) - don't change this node's output at all, but they get baked into coordinates_json so the preview node knows how to draw.

Outputs: image (unchanged passthrough), x_coordinate and y_coordinate as plain INTs, and coordinates_json - a STRING holding {"x": ..., "y": ..., "width": ..., "height": ..., "point_color": ..., "point_size": ...}.

The gotcha that actually bites is a JSON shape mismatch. The picker emits a flat object, but HBH_ImageOverlay wants a list, [{"x": 0, "y": 0}], and only reads the first entry. Pipe the picker's JSON straight into the overlay and your overlay lands at (0,0) instead of where you pointed. The README's workaround is to use KJNodes' point editor (PointsEditor) for the round trip, which outputs the list format natively - you can also just wrap the numbers yourself with any JSON-building node.

Install is the standard two-lane route. ComfyUI Manager: search for ComfyUI_HBH-image_overlay and install. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/wings6407/ComfyUI_HBH-image_overlay

then restart ComfyUI. There's no requirements.txt in the pack - it only uses numpy, torch and Pillow, which are already part of your ComfyUI environment - and no model files to download anywhere.

Troubleshooting: this is a small, low-traffic pack from a solo dev (the repo has a single commit, README and comments in Chinese), and there's essentially zero community discussion of it - don't go hunting for fix threads, there are none. The two things that bite are the JSON shape mismatch above and the README's note to run images through an RGB conversion node (like WAS Suite's Images to RGB) before wiring the pack into a bigger graph. If the placement looks wrong, check both.

Categoryimage/interactive

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
initial_xINT00–4096
initial_yINT00–4096
point_colorCOMBO5 options: red, blue, green, yellow, white
point_sizeINT101–50

Outputs (4)

NameTypeDescription
imageIMAGE
x_coordinateINT
y_coordinateINT
coordinates_jsonSTRING