Auto Caption (AITocha — one node)
One node from image to JoyCaption caption — the one you'll actually drop in
- image
- caption
Auto Caption (AITocha - one node) is the whole point of the AITocha Vision pack, shrunk to a single square. Connect an image, get a caption string back. No separate model loader, no custom handle to babysit, no llama.cpp compilation lurking in your install. It's the node you'll reach for when you just want a prompt written from a picture, and you don't want to think about the plumbing.
What it actually runs is JoyCaption Beta One - the community's default uncensored natural-language captioner, an 8B LLaVA-style VLM by fpgaminer. This node is a thin transformers wrapper around it, loading the model the standard PyTorch way with bitsandbytes quantization instead of through the GGUF route. That's the pack's whole sales pitch, and it's a good one: the GGUF JoyCaption nodes need llama-cpp-python built with CUDA, and when that build silently falls back to CPU they return None, which crashes your downstream CLIPTextEncode with a 'NoneType' object has no attribute 'replace'. This one stays on GPU and returns a real string, even as a placeholder, never None.
How it works
Under the hood the node is the loader and the captioner fused. On first use it pulls the model from HuggingFace (the first run downloads ~14 GB into HF_HOME, default ~/.cache/huggingface), then caches it at module level - so re-running the same queue doesn't reload weights, and switching model or quantization just evicts the one cached model and reloads. It takes the first image of your input batch, converts it to PIL, builds a chat conversation from your system and user prompts, and decodes the model's answer.
Inputs that matter
The full set of caption controls, plus the model choice the loader would otherwise own:
model_id-fancyfeast/llama-joycaption-beta-one-hf-llavaby default; the olderalpha-two-hf-llavais the alternative.quantization-4-bit(≈6 GB VRAM),8-bit(≈10 GB), orbf16(≈16 GB). 4-bit is the sensible default.system_preset- defaults to Scene only (no identity), and this is the preset that makes the pack special. It instructs the model to describe pose, clothing, setting, lighting, composition - and to skip facial features, hair, eye color, age, anything identifying. Built for img2img + character LoRA: you supply the identity token, the captioner supplies the scene without over-specifying details that would fight your LoRA. Full description and Booru-style tags are the other built-ins.user_preset- Long descriptive caption (default), Short caption, Booru tags, or Stable Diffusion prompt.max_new_tokens(300, up to 2048),temperature(0.6 - set 0 for greedy, reproducible output),top_p(0.9),seed.
Pick "Custom" in a preset and the system_prompt / custom_user_prompt textareas take over. Only the first image in a batch is captioned, by the way - feed it a stack and you get one caption.
What comes out
One caption string. The canonical wiring:
LoadImage ──► Auto Caption (AITocha) ──► CLIPTextEncode ──► KSampler
Drop that into an img2img graph and you've got an auto-prompting loop. The same output writes cleanly to .txt files for a LoRA training set - JoyCaption natural language is the right format for LLM-encoded bases like Flux. Just remember the whole class's weakness: multi-subject attribution. One subject, great; two people in frame, audit the caption by hand.
Install
ComfyUI Manager → search "AITocha Vision" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/AITocha/ComfyUI-AITocha-Vision.git
cd ComfyUI-AITocha-Vision
pip install -r requirements.txt
Restart ComfyUI. Dependencies are transformers, accelerate, bitsandbytes, and Pillow - and it assumes a CUDA GPU, because there is deliberately no CPU fallback. On RunPod or Docker, set HF_HOME=/workspace/huggingface so the 14 GB model download survives pod restarts.
Troubleshooting
The usual gotchas: keep bitsandbytes updated (pip install -U bitsandbytes fixes the recurring 8-bit complaint), and don't be surprised by the ~25 second first load - that's an 8B model being pulled and quantized, not a hang. If captions run out of room on a busy image, bump max_new_tokens. And if a caption comes back oddly sparse, try Full description - the Scene-only default is doing exactly what it says.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_id | COMBO | fancyfeast/llama-joycaption-beta-one-hf-llava | 2 options: fancyfeast/llama-joycaption-beta-one-hf-llava, fancyfeast/llama-joycaption-alpha-two-hf-llava |
| quantization | COMBO | 4-bit | 3 options: 4-bit, 8-bit, bf16 |
| system_preset | COMBO | Scene only (no identity) | 4 options: Scene only (no identity), Full description, Booru-style tags, Custom (use system_prompt) |
| user_preset | COMBO | Long descriptive caption | 5 options: Long descriptive caption, Short caption, Booru tags, Stable Diffusion prompt, Custom (use custom_user_prompt) |
| max_new_tokens | INT | 30016–2048 | — |
| temperature | FLOAT | 0.600–2 | — |
| top_p | FLOAT | 0.900–1 | — |
| seed | INT | 00–18446744073709550000 | — |
| system_promptopt | STRING | You are an expert image captioner. Describe the pose, body position, clothing or lack thereof, setting, lighting, camera angle, framing, and overall composition of the image. Focus only on what is happening and where, not who is in the image. Do NOT describe the subject's facial features, hair color, eye color, age, or any identifying physical traits. | — |
| custom_user_promptopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| caption | STRING | — |