MinusZone - CLIPTextEncode(OpenAIApi)
No local LLM required — have a cloud model write your prompts
- clip
- customize_instruct
- text
- conditioning
The name is a small lie, in the friendliest way: CLIPTextEncode(OpenAIApi) does not do its own text encoding. It sends your rough idea to an OpenAI-compatible chat API, gets back a beautified Stable Diffusion prompt, and then - like every node in this pack - encodes that prompt into conditioning with your local clip. It's the node to reach for when you don't want to babysit a 5GB local LLM, when you have an API key burning a hole in your pocket, or when your prompt ideas are in a language the pack's local models handle poorly.
The nice bit: "OpenAI-compatible" is doing real work here. Because the node just sets base_url and api_key on an OpenAI client, it works with any OpenAI-style endpoint. The README explicitly calls out compatibility with Zhipu (智谱) - a Chinese API - and anything else that speaks the OpenAI protocol (Ollama's API, LM Studio, vLLM servers, etc.) works too. So you can point it at a local server and get cloud-quality prompt writing with no cloud.
The inputs that matter
base_url- the API endpoint. Empty defaults to OpenAI's. For a compatible local server, e.g.http://localhost:11434/v1(Ollama) or your Zhipu/other endpoint.api_key- your key. The node persists it toComfyUI/models/openai_config.jsonafter the first run (it masks it as******in the UI after saving), so you don't re-enter it every session.model_name- defaultgpt-3.5-turbo-1106. Whatever the endpoint supports.textandstyle_presets- same as the local-LLM nodes: your rough idea, and the quality preset to prepend (none/high_quality/photography/illustration).
Optional: clip (to get conditioning out) and customize_instruct (your own system prompt / instruction via the pack's CustomizeInstruct node - useful since you're paying per token, you want output shaped right the first time).
Outputs: text and conditioning.
How it works
On encode, the node builds the beautify request, calls the chat API, takes the reply, and feeds it through the same A1111-style weight-scaling encoder the local nodes use. If the openai Python package isn't installed, it auto-pip installs it on first use - handy, but worth knowing it's doing that in the background.
Installing
Part of ComfyUI-Prompt-MZ:
cd ComfyUI/custom_nodes
git clone https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ
Restart. No llama.cpp needed for this node specifically (it skips the local model path entirely), though the pack still installs those deps as a whole. You need a working API key and network access to your chosen endpoint.
Troubleshooting
The api_key is required error means no key and no saved config - set it once, or delete openai_config.json if you need to start over (the masked ****** field won't accept a new key until you clear it). Cost surprise is the other gotcha: every queue run calls the API, and the default gpt-3.5-turbo-1106 isn't the cheapest route if you're churning through batches - if you're using this to caption hundreds of images, a local model or a cheap compatible endpoint will save real money. And if clip isn't wired, conditioning comes back None and the sampler won't run - that trips people up.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | — | |
| api_key | STRING | — | |
| model_name | STRING | gpt-3.5-turbo-1106 | — |
| style_presets | COMBO | high_quality | 4 options: none, high_quality, photography, illustration |
| text | STRING | — | |
| clipopt | CLIP | — | |
| customize_instructopt | CustomizeInstruct | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| conditioning | CONDITIONING | — |