Nodes/SDXL Auto Prompter/APNext GPT Custom Vision
ComfyUI Node

APNext GPT Custom Vision

Custom image analysis with GPT, your prompt your rules

By dagthomas·Created 3 years ago·Updated 16 days ago· 285
APNext GPT Custom Vision
  • images
  • output
  • clip_l
  • faded_image
custom_prompt
additive_prompt
dynamic_promptfalse
tagohwx man
sexmale
words100
pronounshim, his
fade_percentage15.0
gpt_model

GptCustomVision is the OpenAI flavor of dagthomas's custom vision nodes: hand it one or more images and your own analysis prompt, and GPT looks at the picture and answers however you told it to. Where a plain captioner gives you one fixed style of description, "custom" is the point here - you write the instruction, so you can get tag-style output, a scene breakdown, a style clone, or a LoRA caption, all from the same node. If you already live in the OpenAI ecosystem and have a key, this is your image-to-prompt workhorse.

It exists because this is genuinely one of the most-wanted ComfyUI workflows: load an image, give a short steer, get a detailed prompt back for image-to-image or video. Pick this node over the Gemini or Claude versions purely on which API you're set up to pay for - the capability is similar, the bill goes to a different vendor.

How it works

The node encodes your images, fills your custom_prompt with any dynamic tokens if enabled, sends both to a GPT vision model, and returns the text. Its standout feature is dynamic prompting: turn on dynamic_prompt and the tokens ##TAG##, ##SEX##, ##WORDS## and ##PRONOUNS## in your instruction get replaced by the tag, sex, words and pronouns inputs - which is exactly how you build a reusable LoRA-captioning template that always refers to "ohwx man / him, his / 100 words" without editing the prompt each time. If you pass multiple images, fade_percentage blends them and also outputs the blended frame.

The inputs and outputs that matter

  • images - the image(s) to analyze.
  • custom_prompt - your instruction to GPT. This is the whole node; write it well. Pair it with the CustomPromptLoader to pull a saved template instead of retyping.
  • gpt_model - the model dropdown (GPT-5 and GPT-4.1 families, including -mini and -nano). gpt-4.1-mini is the cost-sane default; the full models cost more per call for marginal caption gains.
  • dynamic_prompt + tag / sex / words / pronouns - the template-substitution system for LoRA-style captioning.
  • additive_prompt - extra text appended to the instruction.

Three outputs: output (GPT's full text), clip_l (a trimmed variant sized for a CLIP-L text slot), and faded_image (the blended composite when you feed multiple images).

How to install it

ComfyUI Manager: search comfyui_dagthomas, install, restart. Manual:

cd ComfyUI/custom_nodes && git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas && pip install -r requirements.txt

then restart. Needs the openai library (in requirements.txt) and a key. Set OPENAI_API_KEY in the environment before launching ComfyUI.

Where people get burned

  • Empty custom_prompt = nothing useful. Unlike a fixed captioner, this node does what you tell it. No instruction, no coherent output. Start from a CustomPromptLoader template if you're not sure what to write.
  • Key set after launch. Export OPENAI_API_KEY before starting ComfyUI; it's read at startup.
  • Hosted ComfyUI blocks it. Outbound API calls and custom env vars usually aren't available on serverless instances - use a local vision node there instead.
  • Dynamic tokens need the toggle. ##TAG## stays literal unless dynamic_prompt is on. If your captions come out with ##TAG## in them, that's the switch.
  • Model names drift. The dropdown may list models your key can't call yet; that throws a runtime API error. The list is editable JSON (data/gpt_models.json) - prune it to what you can actually access.
Categorycomfyui_dagthomas

Inputs (10)

NameTypeDefaultDescription
imagesIMAGE
custom_promptSTRING
additive_promptSTRING
dynamic_promptBOOLEANfalse
tagSTRINGohwx man
sexSTRINGmale
wordsSTRING100
pronounsSTRINGhim, his
fade_percentageFLOAT15.00.1–50
gpt_modelCOMBO6 options: gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano

Outputs (3)

NameTypeDescription
outputSTRING
clip_lSTRING
faded_imageIMAGE