Nodes/ComfyUI-Prompt-MZ/MinusZone - CLIPTextEncode(OpenAIApi)
ComfyUI Node

MinusZone - CLIPTextEncode(OpenAIApi)

No local LLM required — have a cloud model write your prompts

By MinusZoneAI·Created 2 years ago·Updated about a year ago· 138
MinusZone - CLIPTextEncode(OpenAIApi)
  • clip
  • customize_instruct
  • text
  • conditioning
base_url
api_key
model_namegpt-3.5-turbo-1106
style_presetshigh_quality
text

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 to ComfyUI/models/openai_config.json after the first run (it masks it as ****** in the UI after saving), so you don't re-enter it every session.
  • model_name - default gpt-3.5-turbo-1106. Whatever the endpoint supports.
  • text and style_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.

CategoryMinusZone - Prompt

Inputs (7)

NameTypeDefaultDescription
base_urlSTRING
api_keySTRING
model_nameSTRINGgpt-3.5-turbo-1106
style_presetsCOMBOhigh_quality4 options: none, high_quality, photography, illustration
textSTRING
clipoptCLIP
customize_instructoptCustomizeInstruct

Outputs (2)

NameTypeDescription
textSTRING
conditioningCONDITIONING