giggle-generation-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGiggle Image Generation (Multi-Model)
Giggle 图像生成(多模型)
Source: giggle-official/skills · API: giggle.pro
Generates AI images via giggle.pro's Generation API. Supports multiple models (Seedream, Midjourney, Nano Banana). Submit task → query when ready. No polling or Cron.
API Key: Set system environment variable . The script will prompt if not configured.
GIGGLE_API_KEYNo inline Python: All commands must be executed via thetool. Never useexecor heredoc inline code.python3 << 'EOF'
No Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
来源:giggle-official/skills · API:giggle.pro
通过giggle.pro的生成API生成AI图像。支持多种模型(Seedream、Midjourney、Nano Banana)。提交任务→准备就绪后查询。无需轮询或Cron任务。
API Key:设置系统环境变量。如果未配置,脚本会提示用户。
GIGGLE_API_KEY禁止内嵌Python代码:所有命令必须通过工具执行。绝对不要使用exec或 heredoc 内嵌代码。python3 << 'EOF'
错误时请勿重试:如果脚本执行遇到错误,不要重试。直接向用户报告错误并停止操作。
Supported Models
支持的模型
| Model | Description |
|---|---|
| seedream45 | Seedream, realistic and creative |
| midjourney | Midjourney style |
| nano-banana-2 | Nano Banana 2 |
| nano-banana-2-fast | Nano Banana 2 fast |
| 模型 | 描述 |
|---|---|
| seedream45 | Seedream,写实且富有创意 |
| midjourney | Midjourney风格 |
| nano-banana-2 | Nano Banana 2 |
| nano-banana-2-fast | Nano Banana 2 快速版 |
Execution Flow: Submit and Query
执行流程:提交与查询
Image generation is asynchronous (typically 30–120 seconds). Submit a task to get , then query when the user wants to check status.
task_idImportant: Never passin exec'sGIGGLE_API_KEYparameter. API Key is read from system environment variable.env
图像生成为异步操作(通常耗时30–120秒)。提交任务以获取,然后在用户想要查看状态时进行查询。
task_id重要提示:绝对不要在exec的参数中传递env。API Key会从系统环境变量中读取。GIGGLE_API_KEY
Step 1: Submit Task
步骤1:提交任务
bash
undefinedbash
undefinedText-to-image (default seedream45)
文本生成图像(默认使用seedream45)
python3 scripts/generation_api.py
--prompt "description" --aspect-ratio 16:9
--model seedream45 --resolution 2K
--no-wait --json
--prompt "description" --aspect-ratio 16:9
--model seedream45 --resolution 2K
--no-wait --json
python3 scripts/generation_api.py
--prompt "描述内容" --aspect-ratio 16:9
--model seedream45 --resolution 2K
--no-wait --json
--prompt "描述内容" --aspect-ratio 16:9
--model seedream45 --resolution 2K
--no-wait --json
Text-to-image - Midjourney
文本生成图像 - 使用Midjourney模型
python3 scripts/generation_api.py
--prompt "description" --model midjourney
--aspect-ratio 16:9 --resolution 2K
--no-wait --json
--prompt "description" --model midjourney
--aspect-ratio 16:9 --resolution 2K
--no-wait --json
python3 scripts/generation_api.py
--prompt "描述内容" --model midjourney
--aspect-ratio 16:9 --resolution 2K
--no-wait --json
--prompt "描述内容" --model midjourney
--aspect-ratio 16:9 --resolution 2K
--no-wait --json
Image-to-image - Reference URL
图像生成图像 - 使用参考URL
python3 scripts/generation_api.py
--prompt "Convert to oil painting style, keep composition"
--reference-images "https://example.com/photo.jpg"
--model nano-banana-2-fast
--no-wait --json
--prompt "Convert to oil painting style, keep composition"
--reference-images "https://example.com/photo.jpg"
--model nano-banana-2-fast
--no-wait --json
python3 scripts/generation_api.py
--prompt "转换为油画风格,保留构图"
--reference-images "https://example.com/photo.jpg"
--model nano-banana-2-fast
--no-wait --json
--prompt "转换为油画风格,保留构图"
--reference-images "https://example.com/photo.jpg"
--model nano-banana-2-fast
--no-wait --json
Batch generate multiple images
批量生成多张图像
python3 scripts/generation_api.py
--prompt "description" --generate-count 4
--no-wait --json
--prompt "description" --generate-count 4
--no-wait --json
Response example:
```json
{"status": "started", "task_id": "xxx"}Store task_id in memory ():
addMemorygiggle-generation-image task_id: xxx (submitted: YYYY-MM-DD HH:mm)Tell the user: "Image generation started. It usually takes 30–120 seconds. You can ask me 'is it ready?' to check the status."
python3 scripts/generation_api.py
--prompt "描述内容" --generate-count 4
--no-wait --json
--prompt "描述内容" --generate-count 4
--no-wait --json
响应示例:
```json
{"status": "started", "task_id": "xxx"}将task_id存储到内存(使用):
addMemorygiggle-generation-image task_id: xxx (submitted: YYYY-MM-DD HH:mm)告知用户:"图像生成已启动。通常需要30–120秒完成。你可以问我‘好了吗?’来查看状态。"
Step 2: Query Task (when user asks for status)
步骤2:查询任务(当用户询问状态时)
bash
python3 scripts/generation_api.py --query --task-id <task_id>Behavior:
- completed: Output image links for user
- failed/error: Output error message
- processing/pending: Output JSON ; user can query again later
{"status": "...", "task_id": "xxx"}
bash
python3 scripts/generation_api.py --query --task-id <task_id>行为说明:
- completed(已完成):向用户输出图像链接
- failed/error(失败/错误):输出错误信息
- processing/pending(处理中/待处理):输出JSON ;用户可稍后再次查询
{"status": "...", "task_id": "xxx"}
New Request vs Query Old Task
新请求与查询旧任务
When the user initiates a new image generation request, run submit to create a new task. Do not reuse old task_id from memory.
When the user asks about a previous task's progress (e.g. "is it ready?", "check status"), query the task_id from memory.
当用户发起新的图像生成请求时,运行提交命令创建新任务。不要复用内存中的旧task_id。
当用户询问之前任务的进度时(例如“好了吗?”、“查看状态”),从内存中取出对应的task_id进行查询。
Parameter Reference
参数参考
| Parameter | Default | Description |
|---|---|---|
| required | Image description prompt |
| seedream45 | seedream45, midjourney, nano-banana-2, nano-banana-2-fast |
| 16:9 | 16:9, 9:16, 1:1, 3:4, 4:3, 2:3, 3:2, 21:9 |
| 2K | Text-to-image: 1K, 2K, 4K (image-to-image partially supported) |
| 1 | Number of images to generate |
| - | Image-to-image reference; supports URL, base64, asset_id |
| false | Add watermark (image-to-image) |
| 参数 | 默认值 | 描述 |
|---|---|---|
| 必填 | 图像描述提示词 |
| seedream45 | 可选模型:seedream45、midjourney、nano-banana-2、nano-banana-2-fast |
| 16:9 | 可选宽高比:16:9、9:16、1:1、3:4、4:3、2:3、3:2、21:9 |
| 2K | 文本生成图像:1K、2K、4K(图像生成图像部分支持) |
| 1 | 生成图像的数量 |
| - | 图像生成图像的参考图;支持URL、base64、asset_id |
| false | 添加水印(仅图像生成图像支持) |
Image-to-Image Reference: Three Input Methods
图像生成图像参考:三种输入方式
The image-to-image API's is an array of objects. Each element can be one of these three formats (can be mixed):
reference_images图像生成图像API的是一个对象数组。每个元素可以是以下三种格式之一(可混合使用):
reference_imagesMethod 1: URL
方式1:URL
json
{
"prompt": "A cute orange cat sitting on the windowsill in the sun, realistic style",
"reference_images": [
{
"url": "https://assets.giggle.pro/private/example/image.jpg?Policy=EXAMPLE_POLICY&Key-Pair-Id=EXAMPLE_KEY_PAIR_ID&Signature=EXAMPLE_SIGNATURE"
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}json
{
"prompt": "一只可爱的橘猫坐在阳光下的窗台上,写实风格",
"reference_images": [
{
"url": "https://assets.giggle.pro/private/example/image.jpg?Policy=EXAMPLE_POLICY&Key-Pair-Id=EXAMPLE_KEY_PAIR_ID&Signature=EXAMPLE_SIGNATURE"
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}Method 2: Base64
方式2:Base64
json
{
"prompt": "A cute orange cat sitting on the windowsill in the sun, realistic style",
"reference_images": [
{
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}Base64 format: Pass the raw Base64 string directly. Do not add theprefix.data:image/xxx;base64,
json
{
"prompt": "一只可爱的橘猫坐在阳光下的窗台上,写实风格",
"reference_images": [
{
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}Base64格式要求:直接传递原始Base64字符串。不要添加前缀。data:image/xxx;base64,
Method 3: asset_id
方式3:asset_id
json
{
"prompt": "A cute orange cat sitting on the windowsill in the sun, realistic style",
"reference_images": [
{
"asset_id": "vvsdsfsdf"
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}For multiple reference images, add more objects to thearray.reference_images
json
{
"prompt": "一只可爱的橘猫坐在阳光下的窗台上,写实风格",
"reference_images": [
{
"asset_id": "vvsdsfsdf"
}
],
"generate_count": 1,
"model": "nano-banana-2-fast",
"aspect_ratio": "16:9",
"watermark": false
}若要使用多张参考图,可在数组中添加更多对象。reference_images
Interaction Guide
交互指南
When the user request is vague, guide per the steps below. If the user has provided enough info, run the command directly.
当用户的请求模糊时,按照以下步骤引导用户。如果用户已提供足够信息,直接运行命令即可。
Step 1: Model Selection
步骤1:模型选择
Question: "Which model would you like to use?"
Title: "Image Model"
Options:
- "seedream45 - Realistic & creative (recommended)"
- "midjourney - Artistic style"
- "nano-banana-2 - High quality"
- "nano-banana-2-fast - Fast generation"
multiSelect: false问题:"你想要使用哪种模型?"
标题:"图像模型"
选项:
- "seedream45 - 写实且富有创意(推荐)"
- "midjourney - 艺术风格"
- "nano-banana-2 - 高质量"
- "nano-banana-2-fast - 快速生成"
multiSelect: falseStep 2: Aspect Ratio
步骤2:宽高比选择
Question: "What aspect ratio do you need?"
Title: "Aspect Ratio"
Options:
- "16:9 - Landscape (wallpaper/cover) (recommended)"
- "9:16 - Portrait (mobile)"
- "1:1 - Square"
- "Other ratios"
multiSelect: false问题:"你需要什么宽高比?"
标题:"宽高比"
选项:
- "16:9 - 横版(壁纸/封面)(推荐)"
- "9:16 - 竖版(移动端)"
- "1:1 - 正方形"
- "其他宽高比"
multiSelect: falseStep 3: Generation Mode
步骤3:生成模式选择
Question: "Do you need reference images?"
Title: "Generation Mode"
Options:
- "No - Text-to-image only"
- "Yes - Image-to-image (style transfer)"
multiSelect: false问题:"你需要使用参考图像吗?"
标题:"生成模式"
选项:
- "不需要 - 仅文本生成图像"
- "需要 - 图像生成图像(风格迁移)"
multiSelect: falseStep 4: Execute and Display
步骤4:执行与展示
Submit task → store task_id → inform user. When user asks for status, run query and forward stdout to user.
Link return rule: Image links in results must be full signed URLs (with Policy, Key-Pair-Id, Signature query params). Correct: . Wrong: do not return unsigned URLs with only the base path (no query params).
https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=...提交任务→存储task_id→告知用户。当用户询问状态时,运行查询命令并将标准输出转发给用户。
链接返回规则:结果中的图像链接必须是完整的签名URL(包含Policy、Key-Pair-Id、Signature查询参数)。正确示例:。错误示例:不要返回仅包含基础路径的未签名URL(无查询参数)。
https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=...