Skip to content

Conversation

@bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Dec 7, 2025

This PR introduces a system_instruction input for Gemini nodes.

  • Text Models: Default value is empty.
  • Image Models ("Banana" / Gemini-3-Pro-Image): A carefully crafted system prompt has been added to enforce image generation.

Motivation & The Problem
There is a significant behavioral discrepancy between Google AI Studio and the raw Vertex AI API.

  • AI Studio implicitly wraps user prompts with system instructions that force the model into "Visual Mode."
  • ComfyUI uses **Vertex AI ** that executes raw prompt. Consequently, if a user provides a prompt that looks like a script, a storyboard, or a conversational request (e.g., "I need urgent help" or "3x3 Storyboard Grid"), the model often interprets it as a text-generation task. It returns a text reply or a refusal (Safety/Assistant response) instead of an image, leading to NO_IMAGE errors.

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

@bigcat88
Copy link
Contributor Author

bigcat88 commented Dec 7, 2025

+label: Core

@comfy-pr-bot comfy-pr-bot added the Core Core team dependency label Dec 7, 2025
Copy link
Collaborator

@Kosinkadink Kosinkadink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging

@Kosinkadink Kosinkadink merged commit c3c6313 into comfyanonymous:master Dec 8, 2025
13 checks passed
@bigcat88 bigcat88 deleted the feat/api-nodes/Gemini-systemprompt branch December 8, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Core team dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants