ComfyUI Node

GPT 5.2

Rent a Brain for Your Prompt, Skip the VRAM

By felipederosilva·Created about a month ago·Updated about 22 hours ago· 3
GPT 5.2
  • images
  • text
  • raw_json
  • credits_consumed
  • usage_json
  • credits_left
◄prompt►
◄system_prompt►
◄streamfalse►
◄tools_json[]►
◄history_json[]►
◄reasoning_efforthigh►
◄web_searchfalse►
◄expert_override_json{}►

Why an LLM node is in your ComfyUI graph

Because prompt-writing is the part of this hobby nobody enjoys and large models are genuinely good at it. This node puts GPT 5.2 behind a ComfyUI socket: you give it text, it gives you text, and you wire that text into a CLIP text encoder, a file saver, or a string node. It runs on KIE's infrastructure, not your GPU - no VRAM, no quantised weights, no 8B model fighting your checkpoint for memory. It costs money per call.

The case for it, concretely: turn a one-line idea into a full photographic prompt; rewrite a tag soup into prose for a model that prefers sentences; convert a prompt into structured JSON for a downstream parser; caption an image you wired into the images input; or use it as an agentic step that decides what to do next in a multi-stage graph.

The case against, which the community makes constantly: a small local model does prompt enhancement for free, offline, uncensored and instantly. If that's all you need, an abliterated 8B on your own card beats this on every axis except raw writing quality. Reach for the API when you specifically want frontier-level text and don't mind paying, waiting, and having your prompt filtered by someone else's policy.

How it works

The pack generates its nodes at startup from KIE's documentation, and unlike the image nodes - which POST a job and poll - this one is a direct endpoint: a single HTTP call to POST /gpt-5-2/v1/chat/completions through KIE. That's why the class name ends in a hash (KIE_Next_gpt_5_2_d233f39a, derived from the operation and model) and why there's no task id or polling phase.

The response is parsed for the assistant's text and returned as a STRING, with the full provider response pretty-printed into raw_json. If streaming is involved the client can normalise server-sent events into a stream payload before extraction, though for a clean text output you're better off leaving stream off - the extractor walks the response collecting content chunks, so a streamed answer can come back with the text split across lines.

Inputs

prompt is the only required field, multiline and generous. It's your user message.

system_prompt is where you put behaviour: "you are a prompt engineer, output only the final prompt, no commentary." Underrated - it's the difference between a usable string and a paragraph of throat-clearing.

reasoning_effort is low, medium, high or xhigh, defaulting to high. That default is worth changing. High and xhigh make the endpoint think harder, which costs more tokens and more wall-clock time per call. For prompt rewriting, low or medium is usually indistinguishable and much faster; save the top settings for something that actually needs reasoning.

images is an optional single IMAGE socket - the pack uploads it and passes the URL to the endpoint, so a captioning or "what's wrong with this generation" step is a wire away.

web_search is a boolean for using KIE's web-search tool where the endpoint supports it, and tools_json takes function/tool definitions if you want a structured-tool workflow. For most ComfyUI uses you'll leave tools_json at [].

history_json is a JSON array of prior messages. The node has no memory between runs - every execution starts fresh - so this is the only way to carry context forward, and it has to be valid JSON or the run fails.

expert_override_json merges raw JSON into the request body. It's a last-resort escape hatch for fields the pack doesn't expose; {} is the right value 99% of the time.

One absence is worth flagging: GPT 5.2 is the only node in this GPT family without a max_output_tokens control. The other variants expose one (1 to 131072, default 4096); here the ceiling comes from the endpoint's own default. If you need hard output-length control, that's a reason to prefer a sibling node.

Outputs

text is the output to wire into your graph. raw_json is the provider's full answer - read it when text looks truncated or empty. usage_json carries the token accounting, which is how you figure out whether xhigh reasoning was worth its price. credits_consumed and credits_left are the spend, and both also display on the node as a receipt after a successful run.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
pip install -r requirements.txt

Restart ComfyUI, then paste your KIE key once at Settings → KIE.ai Nodes Next → Connection → Paste / replace KIE.ai API key. It's validated before saving and only shown afterwards as a masked fingerprint; KIE_API_KEY in the environment takes priority for headless installs. Dependencies are requests, Pillow, numpy, PyYAML - the LLM nodes add nothing else. The README treats Registry/Manager publishing as "prepared" rather than finished, so if Manager doesn't find the pack, clone it.

Gotchas

Don't loop it carelessly. Every execution is a paid call. A graph that runs this node on every queue - for every image in a batch - is a graph that quietly converts money into slightly better prompts.

Empty or odd text? Open raw_json first. It usually shows a refusal, a tool call, or a response shape the extractor walked differently than you expected.

It filters. The model is the provider's, and there's nothing local to patch. If your workflow needs content a hosted endpoint refuses, use a local model - that's exactly the trade the local LLM scene exists to make.

Node missing from the menu. Most of this pack's nodes are built during its first catalog sync. Restart once, or run the Refresh Model Catalog node.

CategoryKIE Next/LLM/OpenAI/GPT

Inputs (9)

NameTypeDefaultDescription
promptSTRINGUser prompt / message.
system_promptoptSTRING—
streamoptBOOLEANfalse—
tools_jsonoptSTRING[]Optional function/tool definitions supported by this model endpoint.
history_jsonoptSTRING[]Optional prior message/input array as JSON.
imagesoptIMAGE—
reasoning_effortoptCOMBOhigh4 options: low, medium, high, xhigh
web_searchoptBOOLEANfalseUse KIE's web-search tool where this endpoint supports it.
expert_override_jsonoptSTRING{}Expert-only request overrides. Normal use does not require this.

Outputs (5)

NameTypeDescription
textSTRING—
raw_jsonSTRING—
credits_consumedFLOAT—
usage_jsonSTRING—
credits_leftFLOAT—