Generate Text (AI CustomURL)
Put a real LLM inside your ComfyUI graph (no local model required)
- image
- text
- full_response
Most of what you do in ComfyUI runs on your own GPU. This node is the exception on purpose: it calls a hosted LLM - OpenAI's gpt-4o by default, but really anything that speaks the OpenAI chat-completions format - and hands the answer back as a normal string you can wire into the rest of your graph. That's the whole point of the ComfyUI-AI-CustomURL pack: bridge the gap between "everything local" and the handful of things you genuinely can't run on a consumer GPU, like a frontier-class language model or Sora-grade video.
Why would you want an LLM inside a diffusion graph? Because prompt engineering becomes a node. Have the model write the image prompt, translate it, expand a tag list into a full scene description, or caption the image sitting on another wire - then feed the result into a CLIP text encoder. That's a workflow that used to require tabbing out to a browser and copy-pasting.
How it works
The node is a thin, honest wrapper. It builds a messages array from your prompt (plus an optional system_prompt), POSTs it to {base_url}/chat/completions, and pulls choices[0].message.content out of the response. No magic, no local inference, no model files - everything happens over HTTPS with your api_key in the Authorization header.
The genuinely interesting bit is the optional image input. If you connect an IMAGE from anywhere in your graph, the node base64-encodes it as a PNG data URL and sends it as a multimodal image_url content part - so this works as a vision node too. Caption your last generation, ask it to describe the composition, then chain that text straight back into the next prompt.
Outputs are two strings: text (the clean answer) and full_response (the entire pretty-printed API response, which is your debugging friend when a provider does something unexpected).
The inputs that matter
For a first run you only touch four of them:
base_url- defaulthttps://api.openai.com/v1. Swap it forhttps://openrouter.ai/api/v1,https://api.together.xyz/v1, orhttp://localhost:11434/v1for a local Ollama.api_key- your key. Best read from an env var (OPENAI_API_KEY) rather than typed into the node, because node values get embedded in saved workflow JSON.model-gpt-4oby default, but with OpenRouter you can point it at Claude or Llama; with Ollama,llama3or whateverollama listshows you.prompt- the actual ask.
temperature and max_tokens are the only sampling controls on the node itself; anything fancier (top_p, penalties, JSON mode) comes through advanced_params_json, typically fed by the Text Advanced Parameters node.
Installing it
ComfyUI Manager → search "AI CustomURL" → Install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/bowtiedbluefin/ComfyUI-AI-CustomURL
cd ComfyUI-AI-CustomURL
pip install -r requirements.txt
No model downloads, ever - this pack is API-only. Its requirements.txt is just requests, aiohttp, pillow, numpy, torch, torchaudio, and opencv-python; most of those are already in your ComfyUI environment.
Common issues
- 401 / auth error - wrong key, or the key lacks permission for the model. Also make sure
base_urlincludes the/v1if your provider's docs use that path. - "Model not found" - you typoed the model name, or it isn't available to your account. Providers like OpenRouter list every model on their site.
- Nothing useful in
text- checkfull_response; content filters and quota errors both show up there as structured JSON.
One honest caveat: this is a small, young pack (a single-author project, essentially zero community chatter about it as of writing). It's not the most feature-rich LLM node in the ecosystem - but it's one of the simplest, and it doesn't drag in a heavy local model just to write a sentence.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | https://api.openai.com/v1 | — |
| api_key | STRING | — | |
| model | STRING | gpt-4o | — |
| prompt | STRING | — | |
| temperature | FLOAT | 1.00–2 | — |
| max_tokens | INT | 10241–128000 | — |
| system_promptopt | STRING | You are a helpful assistant. | — |
| imageopt | IMAGE | — | |
| advanced_params_jsonopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| full_response | STRING | — |