文生图 API

使用 Buble 图片模型通过 prompt 生成图片。

文生图 API

图片模型使用 mode: "text_to_image"

推荐模型

模型Key适用场景
Nano Bananagoogle/nano-banana快速创意草图和轻量生产图片。
Nano Banana Progoogle/nano-banana-pro专业商业视觉和更高质量输出。
GPT Image 2openai/gpt-image-2复杂指令跟随和布局敏感的图片。

Nano Banana Pro 示例

curl https://buble.ai/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-pro",
    "mode": "text_to_image",
    "prompt": "A premium hero image for a skincare serum bottle on translucent glass, soft reflections, editorial lighting",
    "aspect_ratio": "16:9",
    "resolution": "1K",
    "output_format": "png"
  }'

GPT Image 2 示例

curl https://buble.ai/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "mode": "text_to_image",
    "prompt": "Create a clean editorial layout image showing a modern workspace with a laptop, notebook, and coffee. Keep the composition balanced with clear negative space on the right side.",
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }'