Coordinate_SplitIndex
Pulling one point out of a coordinates list as plain numbers
- Mark_image
- norm_x
- norm_y
- px_x
- px_y
The rest of Apt_Preset's coordinate family passes points around as a JSON blob - convenient for combining and storing, useless the moment a downstream node just wants a plain x and y number to plug into a math node or a crop input. Coordinate_SplitIndex is the exit ramp: give it a coordinates list and an index, get one point back out as four separate scalar values.
What it is and why you'd reach for it
This belongs to ComfyUI-Apt_Preset's ImgCoordinate group, the nodes that treat image points as portable data. If you've built up a set with Coordinate_Generator, pulled one automatically with Coordinate_fromMask, or merged several with Coordinate_pointCombine, at some point you need to hand a single number to something that isn't coordinate-aware - a crop node's x/y offset, a math node, anything expecting a plain float or int rather than a JSON string. That's this node's whole job.
How it works
You give it coordinates (the JSON list) and an index - which point you want. It also asks for Mark_image, an IMAGE input; despite the name looking like it should specifically be the output of Coordinate_MarkRender, the type is just IMAGE, so any image works there - the name is very likely just a naming carryover from its sibling node rather than a strict requirement.
Worth flagging explicitly: index here starts at 1, not 0. That's inconsistent with Coordinate_fromMask elsewhere in this same pack, whose index field starts at 0 - an easy way to grab the wrong point if you're used to one convention and switch to the other node mid-graph.
Inputs and outputs that matter
Mark_image(required, IMAGE) - an image input; any IMAGE works despite the name.coordinates(required, STRING) - the point list to pull from.index(required, default 1, min 1) - which point to extract, 1-based.
Outputs: norm_x / norm_y (0–1 floats, the normalized position) and px_x / px_y (ints, the pixel position) - the same point in both formats, so you can wire whichever a downstream node actually wants without a separate conversion step.
Installing it
Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
Run install.bat on Windows for dependencies; on Linux/Mac install the requirements by hand, since no equivalent script is bundled. No models needed - this is list indexing and unit conversion.
Common issues
The 1-based index is the single most likely source of confusion here - if you're pulling a point that came from Coordinate_fromMask (0-based) or a combined list where you're not sure how indexes shook out after merging, double-check you're asking for the point you think you are before wiring px_x/px_y into something that'll silently accept a wrong-but-valid number.
If the node errors on an out-of-range index (asking for point 5 in a 3-point list), that's expected - check the actual coordinates JSON to confirm how many points are really in it before assuming your upstream generation step worked.
As with the rest of this pack: ComfyUI-Apt_Preset is large and actively developed, and at least one user has reported an IMPORT FAILED error at ComfyUI startup. Check the console log if this node doesn't appear after installing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Mark_image | IMAGE | — | |
| coordinates | STRING | — | |
| index | INT | 1 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| norm_x | FLOAT | — |
| norm_y | FLOAT | — |
| px_x | INT | — |
| px_y | INT | — |