Nodes/Ray's Orenchi/πŸ’¬ Ray's LLM: Folder Captioner
ComfyUI Node

πŸ’¬ Ray's LLM: Folder Captioner

Caption images alphabetically with a connected CLIP/VLM on GPU. Return aligned lists of answers, original images, and absolute paths. Connect a full vision-language CLIP (for example Qwen3-VL from CLIPLoader, type qwen_image), not a text-only encoder. No sidecars are written. Caption one image at a time. Enable return_images only when needed: output images are decoded after captioning and remain in RAM until outputs are released; use start_index and limit to bound that output.

By MutantSparrowΒ·Created 4 months agoΒ·Updated 3 days agoΒ· 1
πŸ’¬ Ray's LLM: Folder Captioner
  • clip
  • text
  • image
  • image_path
β—„folderβ–Ί
β—„recurse_subfoldersfalseβ–Ί
β—„start_index0β–Ί
β—„limit-1β–Ί
β—„user_promptDescribe the visible contents of this image in detail.β–Ί
β—„max_length1024β–Ί
β—„temperature0.25β–Ί
β—„top_k40β–Ί
β—„top_p0.90β–Ί
β—„min_p0.05β–Ί
β—„repetition_penalty1.05β–Ί
β—„seed-1β–Ί
β—„thinkingfalseβ–Ί
β—„return_imagesfalseβ–Ί
β—„cleanup_every16β–Ί
CategoryπŸ‘‘ Ray/πŸ’¬ LLM

Inputs (16)

NameTypeDefaultDescription
clipCLIPFull generative vision-language CLIP, such as Qwen3-VL from CLIPLoader (type qwen_image). Text-only encoders cannot caption.
folderSTRINGEnter the folder containing images to caption.
recurse_subfoldersBOOLEANfalseInclude images in subfolders, sorted by relative path.
start_indexINT0Skip this many images in alphabetical relative-path order.
limitINT-1Caption at most this many images; use -1 for all remaining images.
user_promptSTRINGDescribe the visible contents of this image in detail.Enter the instruction to apply independently to every image.
max_lengthINT10241–32768Set the maximum number of generated tokens per image.
temperatureFLOAT0.250–2Set sampling randomness; use 0 for greedy decoding.
top_kINT400–1000Keep this many candidate tokens; use 0 to disable top-k filtering.
top_pFLOAT0.900–1Set the cumulative probability threshold for nucleus sampling.
min_pFLOAT0.050–1Filter tokens relative to the most probable token; use 0 to disable.
repetition_penaltyFLOAT1.050–5Set the repetition penalty; use 1 for no penalty.
seedINT-1-1–2147483647-1 for random; any >=0 value is reproducible.
thinkingBOOLEANfalseEnable thinking when supported by the selected model; return its decoded response unchanged.
return_imagesoptBOOLEANfalseReturn original-size images after all captions finish. Off keeps the image output empty and avoids retaining the folder's decoded images in RAM.
cleanup_everyoptINT160–1024Collect transient objects and release unused ComfyUI VRAM caches every N captions. 0 disables periodic cleanup; low-memory cleanup still applies.

Outputs (3)

NameTypeDescription
textSTRINGDecoded VLM answers, one per image, in scan order.
imageIMAGEOriginal RGB images, decoded after captioning when return_images is enabled; otherwise an empty list.
image_pathSTRINGAbsolute source image paths, paired with the answers and images.