Coordinate_Index2Text
Attaching text labels to numbered coordinate points
- text_Coordinate
Numbered points are great for machines and useless for humans reading a graph six months later. Coordinate_Index2Text exists to close that gap - take the raw {x, y, index} JSON the rest of Apt_Preset's coordinate nodes pass around, and turn the index numbers into something you or a downstream text field can actually read.
What it is and why you'd reach for it
This is part of ComfyUI-Apt_Preset's ImgCoordinate family - nodes that treat points on an image as portable data rather than pixels. If you've built up a set of numbered points with Coordinate_fromImage or Coordinate_Generator and want to hand off something more legible than "point 1, point 2, point 3" - say, feeding a caption model, building a prompt that references specific regions, or just documenting a workflow for future-you - this is the node that bridges numeric indexes and text.
How it works
You feed it original_coordinate, a multiline JSON string in the same point-list format the rest of the family uses (the default example shows three points at index 1, 2, 3). Alongside it, index_replace is a multiline text field, empty by default, where you attach labels per index. The output, text_Coordinate, is the resulting labeled text. Because index_replace defaults to empty, leaving it blank is a safe no-op - you won't get an error, you just won't get any labeling either, so this node is easy to drop in and grow into as you figure out your labeling convention.
Inputs and outputs that matter
original_coordinate(required, multiline STRING) - the point list you're labeling, in the standard[{"x":...,"y":...,"index":...}]format from elsewhere in this node family.index_replace(required, multiline STRING, default empty) - where you write the label text tied to each point's index.
Output: text_Coordinate, a STRING combining the coordinate data with your labels - the human-readable version of what would otherwise just be a list of numbers.
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 there's no bundled installer script, so install the pack's requirements by hand. No models needed - it's string processing, nothing to download.
Common issues
Because both fields are hand-edited multiline text, the most likely failure is a mismatch between the indexes present in original_coordinate and whatever you write in index_replace - if you label index 4 but your coordinate list only goes up to 3, that label has nothing to attach to. Keep the two in sync as you edit, especially if you're iterating on the point list upstream and this node's text field doesn't automatically follow along.
If text_Coordinate comes out looking exactly like your unlabeled input, double check index_replace isn't still sitting at its empty default - it's a genuinely easy field to forget to fill in since the node runs fine without it.
As with the rest of ComfyUI-Apt_Preset: it's a large, actively-updated pack, and at least one user has reported it failing to import at ComfyUI startup. If this node or any other from the pack doesn't show up after installing, check the console log for an IMPORT FAILED line before assuming your workflow file is the problem.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| original_coordinate | STRING | [{"x":0.5,"y":0.5,"index":1}, {"x":0.6,"y":0.6,"index":2}, {"x":0.7,"y":0.7,"index":3}] | — |
| index_replace | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text_Coordinate | STRING | — |