Nodes/D2 Nodes ComfyUI/D2 Create Point
ComfyUI Node

D2 Create Point

Drag a marker, get the coordinates — no calculator needed

By da2el-ai·Created 2 years ago·Updated 2 days ago· 66
D2 Create Point
  • canvas
  • image
  • width
  • height
  • x_1
  • y_1
marker_count1
modeabsolute
width1024
height1024
image
markers[]

Drag a dot, get the numbers

The unglamorous problem this node solves: your workflow needs an x/y position, and you don't want to compute it by hand. D2 Create Point is a little canvas with draggable markers. Drop in the image you're working on, drag the dots to where you actually want things, and it hands you clean coordinates - plus the image and its size, so everything downstream stays in sync.

It's from da2el's D2 Nodes pack, which the author bills as "slightly convenient, simple, versatile." This is that ethos in pure form: nothing heavy, just a nicety that saves you from typing x=136, y=512 into three nodes and hoping you got the math right. Use it anywhere a downstream node wants a position - a crop region, a paste coordinate, a point-driven compositing trick.

How it works

Under the hood it's a value node with a visual editor (the plumbing layer of ComfyUI, one source fanned out to many consumers). Markers live in a JSON string widget as relative coordinates from 0.0 to 1.0, no matter what. When you drag a marker on the canvas, the frontend writes the new position back into that JSON automatically. The mode input decides how the backend converts those relative values when you run:

  • absolute - outputs real pixel ints, round(relative * width).
  • relative - outputs the 0.0–1.0 floats themselves.

Because storage is always relative, switching mode or changing width/height never makes your markers jump around the canvas. That's the neat design decision here, and it's worth knowing before you panic that dragging a marker "broke" your layout.

The inputs that matter

Only a few things to touch:

  • marker_count - how many markers (1–16). The number of x_N/y_N outputs follows it.
  • mode - absolute pixels or relative 0–1. Pick absolute for pixel-position consumers, relative if you want the workflow to survive resolution changes.
  • image - drop an image on the node to make it the canvas background; its size fills width/height for you. Leave it blank for a plain black canvas of whatever width × height you set.

markers is the JSON the frontend maintains. You normally never touch it - and if you mangle it, every marker snaps back to the default layout (evenly spaced, left to right, vertically centered), which is a fun way to find out.

The outputs

  • image - the background image (or a black width×height canvas), so you can pass the same picture downstream.
  • width / height - the coordinate space size.
  • x_1 / y_1x_N / y_N - one pair per marker. They're typed ANY, so they'll plug into whatever coordinate-aware socket your node exposes.

One thing the source flags: in absolute mode the range is 0…size inclusive, so if your downstream node expects a 0-based pixel index, nudge by one there.

Install

Install the pack the usual way. In ComfyUI Manager, search "D2 Nodes" and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI

then restart ComfyUI. No model files to download. The pack's requirements.txt is just piexif and charset-normalizer (for the image/Eagle bits); Create Point itself is plain torch plus stdlib JSON.

The one real gotcha: since v32.0.0 the pack migrated to the ComfyUI V3 schema, so it needs a current ComfyUI. If the node doesn't appear at all after installing, that's the first thing to suspect - the README's fix is to pin a release before v32.0.0 on an older ComfyUI.

When it's not worth it

If you need one fixed position forever, typing a number into a primitive is faster than installing a pack for it. Create Point earns its place when you're iterating - eyeballing placement on the actual image beats guessing pixel values any day, and the relative mode means you can keep the same marker layout across a resolution change.

CategoryD2/Image

Inputs (7)

NameTypeDefaultDescription
marker_countINT11–16
modeCOMBOabsolute2 options: absolute, relative
widthINT10248–16384
heightINT10248–16384
imageCOMBO2 options: , example.png
canvasoptD2_MARKER_CANVAS
markersoptSTRING[]

Outputs (5)

NameTypeDescription
imageIMAGE
widthINT
heightINT
x_1*
y_1*