Nodes/ComfyUI-QING/Gemini编辑丨API
ComfyUI Node

Gemini编辑丨API

Tell Gemini to change the background to a blue sky, get the image back

By sheengoa·Created about a year ago·Updated 20 days ago· 16
Gemini编辑丨API
  • image1
  • image2
  • image3
  • edited_image
  • conversation_info
  • total_tokens
text_input请编辑这张图片。
platformGoogle AI Studio
modelgemini-2.5-flash-image-preview
max_tokens2048
history4
temperature0.20
top_p0.80
image_qualityhigh
reasoning_effortmedium
clear_historyfalse

"Change the background to a blue sky," "turn this into watercolor" - Gemini's image-editing models take a natural-language instruction and a picture, and hand you back an edited picture. GeminiEditAPI is the QING pack's node for exactly that, and it's the closest thing in this pack to what the KB's external-API essay calls the closed-model frontier: no local weights, no VRAM cost, just an API key and a bill. The default model is gemini-2.5-flash-image-preview, which the tooltip describes as a professional image editor supporting up to three images at once, style transfer, and content edits.

It's part of ComfyUI-QING's API category, platform fixed to Google AI Studio. You wire in up to three IMAGE inputs, describe the edit, and out comes edited_image plus conversation info and token usage.

How it works. The node sends your instruction and images to the Gemini editing endpoint and returns the edited image as an IMAGE tensor - so it plugs into the same downstream graph (preview, save, further processing) as any locally generated image. The framework keeps a short multi-turn history (default 4 rounds) so you can iterate: "make it more dramatic" after the first edit, within the same node. The tooltip's own best practice is low temperature (0.2 default) to keep edits consistent - high randomness makes image edits wander, which is a genuinely useful hint baked in by the author.

The inputs that matter.

  • text_input - the edit instruction. Concise and explicit ("将背景改为蓝天" / "make the background a blue sky") gets better results than vague wishes.
  • image1 - required; the primary image to edit.
  • model - gemini-2.5-flash-image-preview (the only choice).
  • max_tokens (default 2048) and history (default 4).
  • Optional: temperature (0.2), top_p, image_quality, reasoning_effort (none/low/medium/high), clear_history, plus image2 and image3 for multi-image edits.

Outputs: edited_image (IMAGE), conversation_info, total_tokens.

How to install. ComfyUI-QING installs as one pack - search "ComfyUI-QING" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py

Set your Google AI Studio key in Settings → QING → API Configuration and restart. The README's clone URL is typo'd (GAOSHI-QING, missing the H) - use the URL above or Manager.

Troubleshooting. This is a paid API, and image editing is a slow, token-heavy job - if the call times out, lower image_quality from high to auto and keep max_tokens sane. Second: don't crank temperature for "creativity"; the author's own advice (low temperature, 0.2) is right, and you'll notice edits getting inconsistent as you push it up. Third, remember the filter: whatever Google's image model refuses, this node refuses too - there's no local bypass for a closed model, so plan your requests accordingly. And edited images come back as tensors in memory; wire edited_image into a Save/Preview node or it's gone when the queue clears.

CategoryQING/API

Inputs (13)

NameTypeDefaultDescription
text_inputSTRING请编辑这张图片。输入图像编辑指令,描述你想要如何修改或生成图像。建议使用简洁明确的指令,如'将背景改为蓝天'、'转换为水彩画风格'等
platformCOMBOGoogle AI Studio选择Gemini编辑模型的服务平台
modelCOMBOgemini-2.5-flash-image-preview选择要使用的Gemini编辑模型 📋 gemini-2.5-flash-image-preview特点: 专业图像编辑:支持精确的图像修改和生成 🖼️ 多图支持:可同时处理最多3张图像 🎭 风格转换:擅长艺术风格、滤镜效果转换 ✨ 内容编辑:智能添加、删除或修改图像元素 ⚡ 快速响应:针对图像编辑任务优化的高效模型 💡 最佳实践:使用较低temperature(0.2)确保编辑一致性
max_tokensINT20481–4096模型生成文本时最多能使用的token数量(1-4096,图像编辑优化)
historyINT41–18保持的历史对话轮数(1-18轮,编辑任务建议4轮)
image1IMAGE输入要编辑的第一张图像(必需)
temperatureoptFLOAT0.200–2控制生成结果的随机性,越高越随机(0.0-2.0,编辑建议0.2确保一致性)
top_poptFLOAT0.800–1控制生成结果的多样性(0.0-1.0)
image_qualityoptCOMBOhigh图像处理质量:auto(自动选择), low(低质量,速度快), high(高质量,精度高)
reasoning_effortoptCOMBOmedium推理努力程度:none(无), low(低), medium(中等), high(高) - 影响编辑质量和处理时间
clear_historyoptBOOLEANfalse是否清除历史对话记录
image2optIMAGE输入要编辑的第二张图像(可选)
image3optIMAGE输入要编辑的第三张图像(可选)

Outputs (3)

NameTypeDescription
edited_imageIMAGE
conversation_infoSTRING
total_tokensINT