ComfyUI Node

Gemini 2.5

Gemini 2.5 as a ComfyUI text node, for prompt work that needs eyes and ears

By GoogleCloudPlatform·Created 8 months ago·Updated about a month ago· 47
Gemini 2.5
    • generated_output
    promptDescribe the content in detail.
    modelGEMINI_PRO
    temperature0.70
    max_output_tokens8192
    top_p1.00
    top_k32
    candidate_count1
    stop_sequences
    response_mime_typetext/plain
    harassment_thresholdBLOCK_MEDIUM_AND_ABOVE
    hate_speech_thresholdBLOCK_MEDIUM_AND_ABOVE
    sexually_explicit_thresholdBLOCK_MEDIUM_AND_ABOVE
    dangerous_content_thresholdBLOCK_MEDIUM_AND_ABOVE
    system_instruction
    image_file_path
    image_mime_typeimage/png
    video_file_path
    video_mime_typevideo/mp4
    audio_file_path
    audio_mime_typeaudio/mp3
    gcp_project_id
    gcp_region

    The GeminiNode25 is the elder statesman of this pack's text nodes: a direct line to Gemini 2.5 on Vertex AI that returns plain text. If you've seen the 3.1 and 3.5 siblings and wondered what's different, the answer is "the model and the dropdown." The shape is identical, which is honestly the point - this is a mature, well-trodden wrapper for the workhorse generation, and there are workflows that have been running on it since before the newer models existed.

    What it does

    Prompt in, generated_output (a STRING) out. The useful part is multimodal input through file paths: image_file_path, video_file_path, and audio_file_path each take an absolute path (like output/file.png or output/file.mp3) plus a MIME type dropdown, so the node can describe, classify, or re-prompt from content your workflow already produced. The model dropdown gives you three flavors of Gemini 2.5: GEMINI_PRO, GEMINI_FLASH, and GEMINI_FLASH_LITE - big, fast, and cheapest, respectively. A caption-and-reprompt loop is the killer use: generate an image, point this node at the file, have it write a better prompt, feed that string back into your generator.

    Inputs that matter

    • prompt - the instruction (defaults to "Describe the content in detail.").
    • system_instruction - optional, but this is the field that turns it into a reusable tool ("You are a prompt engineer. Output only comma-separated tags.").
    • temperature / top_p / top_k / max_output_tokens - standard sampling controls.
    • candidate_count - up to 8 alternative responses if you want variety.
    • stop_sequences - comma-separated strings that cut generation short.
    • response_mime_type - set to application/json for structured output.
    • The four safety-threshold dropdowns - Google's filters, medium-and-above default.

    Installing it

    Part of the shared Google GenMedia pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GoogleCloudPlatform/comfyui-google-genmedia-custom-nodes
    pip install -r comfyui-google-genmedia-custom-nodes/requirements.txt
    

    Or ComfyUI Manager → search comfyui-google-genmedia-custom-nodes. Restart, find it under Google AI/Gemini. Set gcp_project_id and gcp_region, run gcloud auth application-default login, and every call bills to Vertex AI.

    The honest take

    If you're starting fresh today, the 3.1 node is the better default - newer model, same interface. But there's a real argument for this one: Gemini 2.5 is battle-tested in these workflows, its pricing is well understood, and if a saved workflow of yours references it, it just keeps working. For a text node whose whole job is prompt plumbing, "older but proven" is a feature, not a bug. Just don't expect any fancy extras - the file-path-only inputs and the string output are the whole story.

    CategoryGoogle AI/Gemini

    Inputs (22)

    NameTypeDefaultDescription
    promptSTRINGDescribe the content in detail.
    modelCOMBOGEMINI_PRO3 options: GEMINI_PRO, GEMINI_FLASH, GEMINI_FLASH_LITE
    temperatureFLOAT0.700–1
    max_output_tokensINT81921–8192
    top_pFLOAT1.000–1
    top_kINT321–64
    candidate_countINT11–8
    stop_sequencesSTRING
    response_mime_typeSTRINGtext/plain
    harassment_thresholdCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
    hate_speech_thresholdCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
    sexually_explicit_thresholdCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
    dangerous_content_thresholdCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
    system_instructionoptSTRING
    image_file_pathoptSTRINGthe absolute path of the image e.g output/file.png
    image_mime_typeoptCOMBOimage/png2 options: image/png, image/jpeg
    video_file_pathoptSTRINGthe absolute path of the video e.g output/file.mp4
    video_mime_typeoptCOMBOvideo/mp42 options: video/mp4, video/mpeg
    audio_file_pathoptSTRINGthe absolute path of the audio e.g output/file.mp3
    audio_mime_typeoptCOMBOaudio/mp33 options: audio/mp3, audio/wav, audio/mpeg
    gcp_project_idoptSTRINGGCP project id where Vertex AI API will query Gemini
    gcp_regionoptSTRINGGCP region for Vertex AI API

    Outputs (1)

    NameTypeDescription
    generated_outputSTRING