ComfyUI Node

OpenAI Helper

Point ComfyUI at any OpenAI-compatible API and ask it to look at your images

By dseditor·Created about a year ago·Updated 7 months ago· 75
OpenAI Helper
  • image1
  • image2
  • image3
  • audio
  • text
  • model_name_list
  • prompts
config_templatedefault.json
endpoint
api_key
model_name
user_prompt請分析提供的內容。
prompt_templateCustom
max_tokens4096
system_prompt請以繁體中文輸出使用者內容,不須包括引導或後綴,如「這就是你要的結果」、「以下是你要的結果」、「你要不要我幫你」、「你說的對」等等,只需要輸出使用者要的結論raw_text。請勿使用Markdown語法(如**粗體**),直接輸出純文字即可。
file_path

The ComfyUI ecosystem is full of "use an LLM to improve your prompt" nodes, and nearly all of them are locked to one vendor. OpenAIHelper is the one that isn't: it speaks to any OpenAI-compatible chat endpoint - official OpenAI, a local Ollama/LM Studio server, a self-hosted vLLM box, or any proxy that speaks the chat-completions protocol. You give it a base URL, a key, and a model name, and it goes. That flexibility is the entire point, and it's why this is the LLM node I'd wire into a workflow before reaching for a vendor-specific one.

How it works

You fill in endpoint (e.g. https://api.openai.com/v1/chat/completions), api_key, and model_name. On every run the node queries the endpoint's /models list (derived by stripping /chat/completions off your endpoint) so it can validate and offer models - that's what the model_name_list output carries. It then POSTs your user_prompt (plus system_prompt and template) to the chat endpoint. What makes it more than a text-caller:

  • Vision - connect image1/image2/image3 and they're sent to the model, so a vision model can caption or critique your renders inline.
  • Audio - there's an audio input that gets attached as a message part for audio-capable models.
  • file_path - point it at a local file path to include file content in the request.

Settings persist via a local config file keyed to config_template (default default.json), so once you've set your endpoint and key, you can leave them mostly blank on later runs.

Inputs that matter

  • endpoint, api_key, model_name - the connection triad. Endpoint is a paste of the chat-completions URL.
  • user_prompt - the request (defaults to a Traditional-Chinese "please analyze the provided content").
  • prompt_template - the pack's .md templates (photography, image-to-prompt, person features) or "Custom" with your own system_prompt.
  • max_tokens - up to 128,000.

Outputs: text (the reply), model_name_list (the models available at your endpoint), and prompts (the rendered prompt list, for debugging).

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/dseditor/ComfyUI-ListHelper

Restart ComfyUI; look under ListHelper/LLM. It uses requests, which ships with ComfyUI - no extra packages for the base case. ComfyUI Manager: search "ComfyUI-ListHelper".

Where people get burned

The endpoint format trips people up: it needs the full /v1/chat/completions path, not just the base host. And local endpoints are great until they aren't - if you're running Ollama or LM Studio, the node's automatic model-list fetch may fail on servers that don't expose /models, in which case type the model name manually. The default system_prompt also asks for output in Traditional Chinese, which is a pleasant surprise if you expect English - but if you get a Traditional-Chinese answer and didn't ask for one, that's why. Remember this sends your images to whatever server you pointed at; for private work, a local endpoint keeps them on your machine.

CategoryListHelper/LLM

Inputs (13)

NameTypeDefaultDescription
config_templateCOMBOdefault.json選擇 API 配置範本(從 modeldata 資料夾)
endpointSTRING
api_keySTRING
model_nameSTRING
user_promptSTRING請分析提供的內容。
prompt_templateCOMBOCustom8 options: Custom, extract_person_features.md, image_to_prompt.md, photography_en.md, photography_zh.md, qwen2512_en.md, +2
max_tokensINT40961–128000
system_promptoptSTRING請以繁體中文輸出使用者內容,不須包括引導或後綴,如「這就是你要的結果」、「以下是你要的結果」、「你要不要我幫你」、「你說的對」等等,只需要輸出使用者要的結論raw_text。請勿使用Markdown語法(如**粗體**),直接輸出純文字即可。
image1optIMAGE
image2optIMAGE
image3optIMAGE
audiooptAUDIO
file_pathoptSTRING

Outputs (3)

NameTypeDescription
textSTRING
model_name_listSTRING
promptsSTRING