Gemini
使用 Gemini 生成图像
通过 CometAPI 使用 Gemini 模型生成图像——支持 4K、多轮编辑、最多 14 张参考图像以及 Thinking。
POST
gemini-2.5-flash-image 已被提供商安排于 2026-10-02 停用。对于新项目,请使用 gemini-3.1-flash-image-preview 或 gemini-3-pro-image-preview。详情请参阅 Google 的弃用时间表。Gemini 图像响应可能包含
thought 为 true 的中间图像部分。这些不是最终输出。保存生成的图像时,请跳过 thought: true 的部分,并使用最后一个存在 inlineData 且 thought 不为 true 的图像部分。授权
Use your CometAPI API key.
路径参数
The Gemini image model to use. See the Models page for current options.
请求体
application/json
Conversation turns. Each item has a role ("user" or "model") and parts array containing text and/or image data.
Controls generation behavior — output modalities, image resolution, thinking, etc.
Optional tools. Pass [{"google_search": {}}] to enable Google Search grounding for real-time information in generated images.