gemini-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gemini Image Generation

Gemini 图像生成

Use this skill when user expresses intent to generate images (e.g., "draw a...", "generate an image...", "create a picture...").
当用户表达出生成图像的意图时使用此技能(例如:“画一只……”、“生成一张图像……”、“创建一幅画……”)。

Steps

步骤

1. Read Configuration

1. 读取配置

  • Read
    config/secrets.md
    to get API Key
  • 读取
    config/secrets.md
    获取API Key

2. Construct Prompt

2. 构建提示词

ModePrompt FormatExample
Text-to-Image
description text
a cute orange cat
Image-to-Image
image_URL description
https://xxx.jpg draw similar style
Multi-Image Reference
URL1 URL2 description
https://a.jpg https://b.jpg merge these two
For image-to-image, upload local images first. See
tips/image-upload.md
.
模式提示词格式示例
文本转图像
描述文本
一只可爱的橘猫
图像转图像
图片URL 描述
https://xxx.jpg 绘制相似风格
多图像参考
URL1 URL2 描述
https://a.jpg https://b.jpg 融合这两张图片
对于图像转图像模式,请先上传本地图片。详见
tips/image-upload.md

3. Call API

3. 调用API

bash
curl -s -X POST "https://api.apicore.ai/v1/images/generations" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "model_name",
    "prompt": "prompt_text",
    "size": "aspect_ratio",
    "n": 1
  }'
bash
curl -s -X POST "https://api.apicore.ai/v1/images/generations" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "model_name",
    "prompt": "prompt_text",
    "size": "aspect_ratio",
    "n": 1
  }'

4. Return Result

4. 返回结果

Extract
data[0].url
from response and return to user.
从响应中提取
data[0].url
并返回给用户。

Reference Docs

参考文档

  • tips/image-upload.md
    - Image upload methods
  • tips/chinese-text.md
    - Chinese text handling tips
  • tips/image-upload.md
    - 图片上传方法
  • tips/chinese-text.md
    - 中文文本处理技巧