Text Prompt Combiner Node
Build a CLIP prompt out of live API data
- api_response
- clip
- CONDITIONING
- ID
Regular prompt nodes take a string you typed and encode it. This one takes a string you typed with blanks in it, fills the blanks from a JSON object, and then encodes the result. It's the middle node of the ComfyUI_API_Manager pack, sitting between APIRequestNode (which fetches the JSON) and generation itself, and it exists for exactly one scenario: you want to generate images from data instead of retyping a prompt by hand every run.
Why you'd reach for it
Say you've pulled a hundred product records from some API and want an image per product, each one referencing that product's actual name, color, and category. Typing a hundred prompts by hand isn't a plan. This node lets you write the prompt template once - something like "a studio photo of $product.name in $product.color" - and re-run the graph against each JSON record APIRequestNode hands it, with the template resolving to a different real prompt every time.
How it works
Two things happen inside this one node. First, it takes text_prompt_template and does a find-and-replace: every $attributeName (or $attribute1.attribute2 for a nested field) gets swapped for the matching value in the api_response JSON. That's plain string substitution against whatever shape your API actually returns - no schema validation, so a missing key means a broken or literal $field left sitting in your prompt rather than a clean error.
Second, once the template's filled in, the node runs the resulting text through a standard CLIP text encode against whatever you wire into clip - the same encoding every prompt in ComfyUI goes through, just fed a string assembled at runtime instead of typed in a box. What comes out is ordinary CONDITIONING, exactly like CLIPTextEncode produces, so it drops straight into your KSampler's positive (or negative) slot with nothing else in the graph needing to change.
The inputs and outputs that matter
text_prompt_template- your prompt, written with$fieldplaceholders where API data should land. This is the one you'll actually spend time tuning.api_response- the JSON to pull values from. In practice this isAPIRequestNode'sAPI_RESPONSEoutput, wired straight across.id_field_name- separate from the template entirely: name a field in the same JSON object and its value comes back on its own as theIDoutput, so you can track which record a given generation belongs to without stuffing it into the prompt text.clip- your model's CLIP, same as any text encode node.
Two outputs: CONDITIONING for your sampler, and ID (string), which is handy for feeding straight into PostImageToAPI's api_object_id so the image you generate gets posted back tagged to the right record.
How to install it
ComfyUI Manager: search "ComfyUI_API_Manager". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/CC-BryanOttho/ComfyUI_API_Manager.git
Restart. No dependencies, nothing to download - same as the other two nodes in the pack.
Common issues & troubleshooting
A $field shows up literally in your generated image, or the prompt just looks wrong. That means the substitution didn't find a match - check the exact casing and nesting of the key against what api_response actually contains, not what you assume the API returns. Nested fields need the full dotted path ($user.address.city, not just $city).
ID comes back empty. id_field_name has to be a correctly-pathed key that exists in every record you're iterating - if some records in your API are missing that field, you'll get empty strings for those with nothing telling you why.
Prompt looks right but the image doesn't reflect it. That's on the encode side, not the pack - the usual CLIP-encoding limits apply (weighting syntax, token limits, model-specific quirks), since after substitution it's just being handed to a normal text encode.
This node is one dev's answer to a real, recurring ask on r/comfyui for exactly this kind of API-driven prompt building - but it was shared as a rough personal tool, not a maintained one. Keep your template simple and print the substituted string once to check it before you burn GPU time on a full batch run.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text_prompt_template | STRING | — | |
| api_response | JSON | [object Object] | — |
| id_field_name | STRING | — | |
| clip | CLIP | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |
| ID | STRING | — |