AS_ComfyGPT
A ChatGPT reply dropped straight into your ComfyUI graph
- STRING
AS_ComfyGPT is the thinnest node in the AS_LLM_nodes pack, and it doesn't try to hide it: three inputs, one output, zero models on disk. It's a tidy wrapper around OpenAI's chat completions API that hands the reply back to your graph as a string. If you've ever wanted an LLM to write prompts, tweak a caption, or brainstorm variations inside a workflow instead of in a browser tab, this is that.
The name deserves one honesty check before you get excited: it's not a local GPT and it's not connected to ChatGPT the product. It's a plain OpenAI API call. You pay per token, it needs the internet, and your prompt text leaves your machine. ComfyUI's whole pitch is "everything stays local" - these nodes are the deliberate exception, so don't wire one in and then be surprised your firewall logs a chat request.
How it works
Under the hood it's embarrassingly simple, which is fine because simple is the point. The node reads your API key from a text file (more on that below), opens the openai client, sends a single user message, and returns the model's reply as a STRING output. There's no system prompt, no conversation history, no temperature slider - one question in, one answer out.
One quirk you can see in the source: the author threw in time.sleep(2) with the comment "Artificial delay for demonstration." Every single call pauses two seconds for no functional reason. It's harmless, just don't assume a frozen UI means a broken call.
The inputs that matter
- api_key_file - a path to a plaintext file containing your OpenAI key. Yes, a file, not an environment variable. It reads the whole file and strips whitespace, so a key with a trailing newline works fine.
- model - a dropdown, defaulting to
gpt-4, with four choices:gpt-4,gpt-4-32k,gpt-3.5-turbo,gpt-3.5-turbo-16k. Here's the gotcha: that list was written in the early GPT-4 era and never updated. Nogpt-4o, nogpt-4.1, no newer anything, and a couple of those names have been deprecated or retired on OpenAI's side. If the API returns a "model not found" error, that's why - you'll be editing the choices list inAS_LLM_nodes.pyor swapping to another node. - prompt - your actual text.
Output is one STRING: ChatGPT's reply. Wire it straight into a text prompt, a caption workflow, or anything else that eats text.
Installing it
Same story as the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/svetozarov/AS_LLM_nodes
then restart ComfyUI. Or just search AS_LLM_nodes in ComfyUI Manager and click install - that's the easier path and it handles the pip side. The pack needs openai, google-generativeai, Pillow, and requests; there are no model files to download because nothing runs locally.
Troubleshooting
The most common failure is a bad key file - either the path is wrong or the file contains a quote, a space, or a copied "sk-…" that includes stray text. The node returns the error message as its output, so read the string, don't just stare at the empty node.
Second is the stale model list above. If you keep hitting it, honestly consider whether you need this node at all - for text-to-text work, plenty of ComfyUI LLM nodes with live model lists exist.
And the serious one, because it's a small pack with effectively no community footprint: it reads a real API key from disk and runs that file's contents through the OpenAI SDK. Custom nodes are arbitrary code with your user's permissions - that's how the LLMVISION malware burned people back in 2024. Spend the two minutes to skim AS_LLM_nodes.py before you hand it a paid key. It's a short file, and this one checks out, but the habit is what keeps you safe.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key_file | STRING | — | |
| model | COMBO | gpt-4 | 4 options: gpt-4, gpt-4-32k, gpt-3.5-turbo, gpt-3.5-turbo-16k |
| prompt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |