Nodes/TK ImageVL - Batch Image & VLM Tools/TK JoyCaption Interrogator (Single)
ComfyUI Node

TK JoyCaption Interrogator (Single)

One image, one JoyCaption string — the quick on-the-graph captioner

By tackcrypto1031·Created 8 months ago·Updated 6 months ago· 2
TK JoyCaption Interrogator (Single)
  • image
  • text
joycaption_modelfancyfeast/llama-joycaption-beta-one-hf-llava
caption_typeDescriptive
caption_lengthlong
user_prompt
max_new_tokens512
temperature0.60
top_p0.90
top_k0
cache_modeltrue

The Single JoyCaption node strips the batch wrapper down to its essence: an IMAGE tensor goes in, a caption STRING comes out. No folders, no saving, no resize controls - just the captioning. It's the node to reach for when the image is already in your graph and you want a natural-language description of it without setting up a whole batch pipeline.

How it works

The mechanism is the same core as the batch version: load the JoyCaption model (default fancyfeast/llama-joycaption-beta-one-hf-llava, or the old joy-caption-pre-alpha), build a prompt from your controls, run inference, decode. The one difference in plumbing is that the image arrives as a tensor, so the node converts it to a PIL image before the processor sees it. What comes out is a single STRING - nothing is written to disk, so if you need a .txt you either wire a text-save node yourself or use the batch version.

The inputs that matter

The caption-shaping controls are the same ones the batch node exposes:

  • caption_type - Descriptive (formal prose) or Stable Diffusion Prompt (tag-style with quality boosters). Sets the internal instruction.
  • caption_length - any through very long; a soft length hint, not a hard cap.
  • user_prompt - override the built-in instruction. Empty uses the preset for your chosen caption_type.
  • max_new_tokens / temperature / top_p / top_k - generation knobs.
  • cache_model - keep it on if you'll run this node repeatedly; off unloads the model after each call, which is slow but frees VRAM for other nodes in a big graph.

Output is a single text STRING, ready to feed a prompt enhancer, a text display node, or anything that eats a string.

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/tackcrypto1031/tk_comfyui_imageVL.git
cd tk_comfyui_imageVL
pip install -r requirements.txt

Restart ComfyUI after, or install through ComfyUI Manager by searching tk_comfyui_imageVL. The real dependencies are the pack's standard set - transformers>=4.45.0, accelerate, huggingface-hub - since it loads JoyCaption with the Transformers AutoModelForVision2Seq path.

Where people get burned

  • First run downloads the model. An 8B VLM isn't small; the first caption can be minutes away while the weights land in tk_comfyui_imageVL/models.
  • Same JoyCaption caveats, same as always. It's uncensored by design, which is the point, but multi-subject frames get attributions scrambled and captions that describe well don't always reproduce the image faithfully. For a quick "what's in this image" answer it's great; for a training set that must be exact, audit by hand.
  • No batching here. If you have a folder, use the batch interrogator - that one also writes the .txt files for you, which this one won't.

It's the smallest node in the JoyCaption pair and arguably the friendliest: one image in, one string out, no file management. Just budget for the model load.

CategoryTK/JoyCaption

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
joycaption_modelCOMBOfancyfeast/llama-joycaption-beta-one-hf-llava2 options: fancyfeast/llama-joycaption-beta-one-hf-llava, fancyfeast/joy-caption-pre-alpha
caption_typeCOMBODescriptive2 options: Descriptive, Stable Diffusion Prompt
caption_lengthCOMBOlong6 options: any, very short, short, medium-length, long, very long
user_promptSTRING
max_new_tokensINT5121–4096
temperatureFLOAT0.600–1
top_pFLOAT0.900–1
top_kINT00–100
cache_modelBOOLEANtrue

Outputs (1)

NameTypeDescription
textSTRING