PD: OpenAI ChatGPT (comfyui_apikey)
ChatGPT models in a ComfyUI graph, billed through your Comfy key
- images
- text
- info
- price
Most of the comfyui-PD_comfy-api-node pack is about images, but this one is the odd one out: it runs OpenAI's ChatGPT models - up through gpt-5.5 - as a text-generation node inside your workflow. Feed it a prompt, get a STRING out, wire that into a TextEncode or a prompt router. It's a surprisingly handy glue node once you realize how much of ComfyUI these days is prompt choreography.
Why you'd reach for it
If you're building workflows that need to think - rewriting prompts, classifying a batch, drafting alt-text, deciding which branch a graph should take - a hosted LLM is the pragmatic choice over trying to run one locally. This node gives you that with the same ComfyUI key and billing as the image nodes, so there's no second API to set up. The model dropdown runs the gamut from the big gpt-5.5/gpt-5 line down through gpt-4.1 and the o1/o3/o4-mini reasoning models.
How it works
It's a thin HTTP client for the OpenAI-compatible responses endpoint on Comfy's proxy (https://api.comfy.org/proxy/openai/v1/responses), authenticated with your ComfyUI key in the X-API-KEY header. The node sends the prompt plus any attached images, gets the model's response text back, and also reports estimated usage. It's not an agent framework - no tool calls, no multi-turn state - it's a single-shot LLM call wearing a node costume, which is exactly what most graph use-cases need.
Inputs that matter
- comfy_api_key - from comfy.org/api-keys.
- prompt - the actual input text.
- model -
gpt-5is the default; the list includes gpt-5.5/gpt-5.5-pro, gpt-5-mini/nano, gpt-4.1 variants, and the o-series. Pick nano/mini for cheap classification tasks, reserve the big ones for real reasoning. - system_prompt - optional instructions; this is where you put "act as an expert prompt engineer."
- max_output_tokens - default 4096, up to 16384. Long generations cost more; trim for simple tasks.
- truncation -
auto(default) ordisabled, for when the context grows past the window. - images (optional) - a batch of images to use as vision context. Handy for captioning or analyzing a generated frame inside the same graph.
Outputs: text (the response), info, and price (cost estimate in USD/RMB/credits).
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/comfyui-PD_comfy-api-node.git
Restart, find it under PD_Tools/Text_Generation. The README's pip install -r requirements.txt is a dead end (no such file); the pack relies on comfy_api_nodes, which ComfyUI Desktop already ships.
Troubleshooting
- Empty
textout - checkinfo; a bad key or a failed call shows there, and the node surfaces errors instead of silently returning junk. - Cost creep - the big reasoning models are where the money goes. For batch/prompt chores, gpt-5-mini or nano is usually plenty.
- No memory - each run is stateless. If you want a conversation, you have to thread previous output back into the prompt yourself.
One thing to keep in mind: because this bills through your Comfy key, every call costs Comfy credits at OpenAI-plus-proxy rates. If you already hold an OpenAI key, a direct-to-OpenAI node might be cheaper - this is the convenience option that keeps your billing in one place.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| comfy_api_key | STRING | — | |
| prompt | STRING | Text input to the model. | |
| model | COMBO | gpt-5 | OpenAI model used through the Comfy API proxy. |
| system_prompt | STRING | Optional instructions for the model. | |
| max_output_tokens | INT | 409616–16384 | Upper bound for generated tokens. |
| truncation | COMBO | auto | Context truncation strategy. |
| imagesopt | IMAGE | Optional image batch to use as context. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| info | STRING | — |
| price | STRING | — |