Skip to content

feat(api-nodes): add Gemini 3.1 Flash-Lite model to LLM node#12803

Merged
Kosinkadink merged 1 commit intomasterfrom
feat/api-nodes/gemini-llm
Mar 6, 2026
Merged

feat(api-nodes): add Gemini 3.1 Flash-Lite model to LLM node#12803
Kosinkadink merged 1 commit intomasterfrom
feat/api-nodes/gemini-llm

Conversation

@bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Mar 6, 2026

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 bigcat88 marked this pull request as ready for review March 6, 2026 16:51
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

This PR modifies the Gemini model configuration in comfy_api_nodes/nodes_gemini.py. The GeminiModel enum is removed and replaced with an explicit list of supported model strings in the UI schema. The default model is updated to gemini-3-1-pro. Model normalization mappings are added to handle aliases that map to canonical model names. Price calculation is expanded to include new model variants gemini-3-pro-preview, gemini-3.1-pro-preview, and gemini-3.1-flash-lite-preview. The price badge expression is updated to account for the expanded set of models.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding Gemini 3.1 Flash-Lite model support to the LLM node, which is the primary focus of the changeset.
Description check ✅ Passed The description provides relevant context through an API Node PR checklist covering scope, pricing updates, QA status, and communications, which relates to the changeset's goals and requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
comfy_api_nodes/nodes_gemini.py (1)

433-451: ⚠️ Potential issue | 🟠 Major

Re-add local prompt validation before building the request.

This method now goes straight from model normalization to GeminiPart(text=prompt), so empty or whitespace-only prompts reach the remote API instead of failing fast in-node. That is a behavior regression unrelated to the model addition and makes API failures harder to diagnose.

Suggested change
     ) -> IO.NodeOutput:
+        validate_string(prompt, strip_whitespace=True, min_length=1)
         if model == "gemini-3-pro-preview":
             model = "gemini-3.1-pro-preview"  # model "gemini-3-pro-preview" will be soon deprecated by Google
         elif model == "gemini-3-1-pro":
             model = "gemini-3.1-pro-preview"
         elif model == "gemini-3-1-flash-lite":
             model = "gemini-3.1-flash-lite-preview"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@comfy_api_nodes/nodes_gemini.py` around lines 433 - 451, In execute, re-add
local validation for the prompt before constructing parts/GeminiPart: trim
prompt (and optionally system_prompt) and if it's empty or only whitespace, fail
fast by raising a clear exception or returning an error NodeOutput instead of
calling the remote API; insert this check immediately before the line that
creates parts: list[GeminiPart] = [GeminiPart(text=prompt)] so empty/whitespace
prompts are caught in-node.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@comfy_api_nodes/nodes_gemini.py`:
- Around line 287-295: The dropdown options list should not advertise
"gemini-3-pro-preview" since execute() always remaps that value to
"gemini-3.1-pro-preview"; remove "gemini-3-pro-preview" from the options array
metadata so users can't select it, and keep the legacy ID only in the
compatibility/remapping logic inside the execute() method (where you detect and
upgrade the old ID) to preserve backwards compatibility.

---

Outside diff comments:
In `@comfy_api_nodes/nodes_gemini.py`:
- Around line 433-451: In execute, re-add local validation for the prompt before
constructing parts/GeminiPart: trim prompt (and optionally system_prompt) and if
it's empty or only whitespace, fail fast by raising a clear exception or
returning an error NodeOutput instead of calling the remote API; insert this
check immediately before the line that creates parts: list[GeminiPart] =
[GeminiPart(text=prompt)] so empty/whitespace prompts are caught in-node.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 14defb14-050c-4baa-abc5-bf17ab4f8074

📥 Commits

Reviewing files that changed from the base of the PR and between 3b93d5d and df8a8a7.

📒 Files selected for processing (1)
  • comfy_api_nodes/nodes_gemini.py

@Kosinkadink Kosinkadink self-requested a review March 6, 2026 17:53
@Kosinkadink Kosinkadink merged commit 34e55f0 into master Mar 6, 2026
17 checks passed
@bigcat88 bigcat88 deleted the feat/api-nodes/gemini-llm branch March 6, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants