ComfyUI Node

Gemini Outfit Caption

Caption an outfit so a try-on prompt actually respects it

By Delcado19·Created about a month ago·Updated about 21 hours ago· 1
Gemini Outfit Caption
  • image
  • raw_caption
  • vton_prompt
model
custom_model
api_key_envGEMINI_API_KEY_COMFYUI
timeout_seconds120
max_image_mb14.0
max_tokens4096
no_person_accessoriesfalse

Most captioning nodes describe the whole picture - person, pose, background, lighting - which is the exact opposite of what a virtual try-on prompt wants. This one reads a single outfit image and hands you two strings: a forensic, evidence-first caption of the clothes, and the same caption rewritten so a diffusion model transfers the garments onto someone else without the reference photo's vibe. If you've ever hand-written "black coated biker jacket, zip-front…" and wondered why the model still added a purse and a smile, this is aimed squarely at that problem.

Why this node exists

Generic VLMs caption the scene. The built-in prompt here is the opposite: it tells the model to ignore the person, face, hair, pose, camera and background, and to describe only visible clothing, footwear and accessories across eleven labeled sections - garment pieces, coverage and silhouette, color, material family, material evidence, construction details, folds and tension, footwear, accessories, preservation, uncertainty. Material family is mandatory and evidence-first: describe highlight sharpness, weave, fold behavior and seams before you commit to "leather" versus "leather-like synthetic". That reads like overkill until you've tried to try-on a patent-leather jacket and the model invented velvet instead.

It's one half of a two-node pack by Delcado19; the twin (NVIDIA NIM Outfit Caption) calls NVIDIA's cloud instead. This node calls Google Gemini's generateContent API, and the pack supersedes the old single-provider comfyui-google-gemini-outfit-caption repo.

How it works

The node encodes your image to PNG (batches hard-fail - exactly one IMAGE), base64s it, and POSTs it alongside the strict prompt to Gemini. raw_caption is whatever the model returned. Then a Python post-processor turns that into vton_prompt: it drops the Uncertainty section, prepends a "transfer only the visible garments, preserve the target person's identity, pose, face, hair, hands and background" prefix, and keeps the described layer order - outer garments stay outermost, including sleeves. Tick no_person_accessories and it also clause-strips bags, purses, eyewear, jewelry, hats and their loose straps out of the VTON prompt while leaving raw_caption intact for diagnosis.

The outputs:

  • raw_caption - the full QA-style caption. Your audit copy.
  • vton_prompt - feed this to your text encoder, or into an instruction editor like Qwen-Image-Edit in a full try-on pipeline.

The inputs that actually matter

  • image - one ComfyUI IMAGE tensor, batch size 1.
  • model - a pull-down ranked by the author's benchmark (🟢 tested very good, 🟡 usable, 🔴 poor, ⚪ untested, then by score). gemini-2.5-flash and gemini-3.5-flash both scored 93/100 at benchmark time. Start there.
  • custom_model - escape hatch for a model ID not in the catalog.
  • api_key_env - the env var name, default GEMINI_API_KEY_COMFYUI.
  • no_person_accessories - the VTON hygiene switch, off by default.
  • timeout_seconds (120 default), max_image_mb (14 default), max_tokens (4096 default) - the dials you touch when a run fails.

The API key: session widget, not just env var

Two ways in. The friendly one lives in the browser: the node adds a masked "Session API key (not saved)" field plus a "Refresh models" button on the canvas. The key goes only to your local ComfyUI server, stays in process memory, is excluded from workflow serialization and never logged - but you'll re-enter it after a restart. Or set GEMINI_API_KEY_COMFYUI in your environment before launching. The session key wins if both exist.

Install

ComfyUI Manager → search "comfyui-outfit-caption", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Delcado19/comfyui-outfit-caption

Restart, then add "Gemini Outfit Caption" from image/captioning. That's the whole install - pyproject.toml declares zero Python dependencies beyond ComfyUI's existing Pillow, NumPy and Torch. No model files download, because nothing runs on your GPU. It's also published to the Comfy Registry as comfyui-outfit-caption.

Common issues

  • "Enter a session API key or set GEMINI_API_KEY_COMFYUI." You ran it without a key. Use the widget or the env var.
  • Stale or missing model list. The dropdown comes from a live catalog fetch with a cached fallback. Drop the key in and hit Refresh models.
  • "Encoded image is N MiB; limit is 14.0 MiB." Your reference is huge. Raise max_image_mb or downscale.
  • Cost and privacy. Every run is a metered Gemini call and your image leaves the machine. For bulk LoRA-set captioning you'd reach for a local JoyCaption instead; this node earns its cost specifically when the VTON structure matters. And no, it won't help on NSFW material - the API path filters, hard.

One honest note before you install: this is a young pack (v1.0.1, mid-2026) with no community track record yet. It's tiny, dependency-free, and the source is a single readable Python file - skim it, because a "vision node that phones home with your key" is exactly the shape the ecosystem has been burned by once already.

Categoryimage/captioning

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
modelCOMBO1 options: ⚪ — | use custom_model
custom_modelSTRING
api_key_envSTRINGGEMINI_API_KEY_COMFYUI
timeout_secondsFLOAT1201–600
max_image_mbFLOAT14.00.1–50
max_tokensINT40961–65536
no_person_accessoriesBOOLEANfalse

Outputs (2)

NameTypeDescription
raw_captionSTRING
vton_promptSTRING