Nodes/digit-comfyui/DIGIT Batch Caption
ComfyUI Node

DIGIT Batch Caption

Batch caption images in a folder using Gemini via Vertex AI. Saves .txt files next to each image.

By thedepartmentofexternalservices·Created 6 months ago·Updated 6 days ago· 0
DIGIT Batch Caption
    • log
    • captioned_count
    • folder_path
    image_folder
    modelgemini-2.5-flash
    caption_styletraining_detailed
    caption_lengthlong
    overwritefalse
    gcp_project_id
    gcp_region
    trigger_word
    prefix_text
    suffix_text
    custom_prompt
    system_prompt
    max_tokens1024
    temperature0.40
    max_dimension2048
    delay_seconds0.5
    CategoryDIGIT

    Inputs (16)

    NameTypeDefaultDescription
    image_folderSTRINGPath to folder containing images to caption.
    modelCOMBOgemini-2.5-flash9 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-3.1-pro-preview, +3
    caption_styleCOMBOtraining_detailed7 options: descriptive_formal, descriptive_casual, training_detailed, training_concise, booru_tags, prompt_style, +1
    caption_lengthCOMBOlong4 options: short, medium, long, any
    overwriteBOOLEANfalseOverwrite existing .txt caption files. If false, skips images that already have captions.
    gcp_project_idSTRINGGCP project ID. Auto-detected from DIGIT_GCP_PROJECT env var or GCP metadata.
    gcp_regionSTRINGGCP region. Auto-detected from DIGIT_GCP_REGION env var or GCP metadata. Defaults to 'global'.
    trigger_wordoptSTRINGTrigger word prepended to each caption. Connect from LoRA Loader or type manually. Leave disconnected to skip.
    prefix_textoptSTRINGText injected at the START of every caption (after trigger word). Useful for consistent style tags.
    suffix_textoptSTRINGText injected at the END of every caption. Useful for quality tags or consistent endings.
    custom_promptoptSTRINGCustom prompt used when caption_style is 'custom'. Also appended as extra instructions for other styles.
    system_promptoptSTRINGOptional system prompt override. If empty, a default captioning system prompt is used.
    max_tokensoptINT102464–8192
    temperatureoptFLOAT0.400–2
    max_dimensionoptINT2048512–4096Resize images to this max dimension before sending to API (saves bandwidth).
    delay_secondsoptFLOAT0.50–10Delay between API calls to avoid rate limiting.

    Outputs (3)

    NameTypeDescription
    logSTRING
    captioned_countINT
    folder_pathSTRING