Prompt Annotate
How ComfyUI Prompt Annotate works
- annotations
- clean_prompt
The name undersells it, and slightly lies. Prompt Annotate doesn't annotate an image and it doesn't call a classifier - it tags your prompt. You write one prompt and mark which text belongs to which region with inline |label: text| tags, and the node hands you two things: a clean, tag-free prompt for the base generation, and a parsed ANNOTATIONS object that the rest of this pack's prompt nodes turn into per-region prompts for your Detailer passes.
That solves a real annoyance. In a detect-crop-refine workflow - Impact Pack finds a face, crops it, re-renders it at proper resolution, pastes it back - you normally maintain two texts that have to stay in sync: the full prompt for the base image, and the tweaked per-region prompt for the detail pass. Prompt Annotate makes them one text. It's the prompt-side version of "name the region instead of training a detector": you don't describe the region to a segmenter, you label the words that belong to it.
How it works
The markup is deliberately simple:
masterpiece, |body:1girl, thin|, |face:blue eyes, smirk|, |body,hair:red hair|, |body:stands|, |background:outdoors, park|
|label1,label2: text| marks text as belonging to those labels. A few rules worth knowing before you lean on it:
- Tags are flat, never nested. If a region appears in several spots (like
bodyabove), you just repeat the label - no XML-style nesting to get wrong. - Labels are free-form (
letters,digits,_) and there's no fixed class list. They should match whatever your downstream classifier or Detailer expects, because nothing validates them for you. - Text outside tags is the common part, implicitly labelled
all. - Empty tags like
|face:|are dropped along with their dangling separators, so sloppy markup doesn't leave comma soup behind. |itself cannot appear in the prompt text. Malformed tags fail the node and it tells you the offending position, which is a nice touch compared to a silent wrong parse.
The inputs and outputs that matter
There's exactly one input: text, the prompt with the markup (multiline, so paste freely). The two outputs are where the value is:
- annotations (ANNOTATIONS) - the parsed spans. This is an internal type; only the other Lukutar prompt nodes consume it, so wire it into Annotation Segment, Annotation Labels, Annotation Segment Edit, or Annotations to Wildcard (LAB).
- clean_prompt (STRING) - the same prompt with all markup stripped:
masterpiece, 1girl, thin, blue eyes, smirk, red hair, stands, outdoors, park. Feed this straight into your CLIP Text Encode for the base generation.
One workflow shape that works well: base generation from clean_prompt, a SAM/Impact detector for the regions, then each region's inpaint prompt built from the annotation via Annotation Segment. Everything stays derived from one text, so editing the prompt once updates every branch.
The node also ships a web editor - with the pack's frontend assets loaded, the prompt field highlights markup live and an Annotate… button opens a larger editor with a palette of labels already in use. If the assets don't load it still works fine; the markup is just plain text you can type by hand.
Installation
This is one node in ComfyUI-LukutarNodes (MIT), so installing the pack gets you all of them. Via ComfyUI Manager: Custom Nodes Manager → Install via git URL → https://github.com/Mistress-Lukutar/ComfyUI-LukutarNodes. Or manually:
cd <ComfyUI>/custom_nodes
git clone https://github.com/Mistress-Lukutar/ComfyUI-LukutarNodes
Restart ComfyUI. The only runtime dependency beyond ComfyUI is opencv-python (>= 4.8) - Manager installs requirements.txt automatically; manual installs may need pip install opencv-python into ComfyUI's python environment. No model downloads, no API keys. The node appears under Lukutar/Prompt.
Common issues
- The annotation nodes reject foreign input. ANNOTATIONS is this pack's own type - feed them anything that didn't come out of Prompt Annotate and they raise a clear error. Wire the chain properly: Prompt Annotate → the consumer.
- Unknown labels fail loudly. Annotation Segment and Segment Edit list the available labels when you ask for one that doesn't exist, so typo'd labels are easy to catch.
- Non-ASCII in
|-free text is fine, but the label charset is strict - labels are[A-Za-z0-9_], so keep class names ASCII. - It's a young pack. v0.10.x, released 2026, near-zero community footprint - don't expect forum threads to bail you out. The README is unusually thorough and the code is clean and unit-tested, so read those before asking the internet.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Prompt with |label: text| markup, e.g. 'masterpiece, |face:blue eyes, smirk|, |body:thin|'; the Annotate button (web UI) edits it visually |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| annotations | ANNOTATIONS | — |
| clean_prompt | STRING | — |