TK JoyCaption Interrogator (Single)
One image, one JoyCaption string — the quick on-the-graph captioner
- image
- text
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) orStable Diffusion Prompt(tag-style with quality boosters). Sets the internal instruction. - caption_length -
anythroughvery 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
.txtfiles 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| joycaption_model | COMBO | fancyfeast/llama-joycaption-beta-one-hf-llava | 2 options: fancyfeast/llama-joycaption-beta-one-hf-llava, fancyfeast/joy-caption-pre-alpha |
| caption_type | COMBO | Descriptive | 2 options: Descriptive, Stable Diffusion Prompt |
| caption_length | COMBO | long | 6 options: any, very short, short, medium-length, long, very long |
| user_prompt | STRING | — | |
| max_new_tokens | INT | 5121–4096 | — |
| temperature | FLOAT | 0.600–1 | — |
| top_p | FLOAT | 0.900–1 | — |
| top_k | INT | 00–100 | — |
| cache_model | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |