← 返回
内容创作 Key 中文

ZenMux Image Gen (Nano Banana 2)

Generate images from text prompts using ZenMux API (Vertex AI protocol with Gemini models). Use when: (1) User wants to generate/create images from text desc...
使用 ZenMux API(Vertex AI 协议搭配 Gemini 模型)根据文本提示生成图像。适用情况:(1) 用户希望根据文本描述生成/创建图像...
thinkthinking
内容创作 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 680
下载
💾 15
安装
1
版本
#latest

概述

ZenMux Image Generation

Generate images from text prompts using ZenMux API with Google Gemini models.

Quick Start

# Generate image (requires ZENMUX_API_KEY env var)
python3 scripts/generate_image.py "A cute cat" output.png

# With aspect ratio and resolution
python3 scripts/generate_image.py "A cute cat" output.png --aspect-ratio 16:9 --image-size 2K

API Key Setup

Get your API key from https://zenmux.ai.

# Set environment variable
export ZENMUX_API_KEY="sk-..."

Security Rules:

  • NEVER use --api-key flag (visible in shell history)
  • NEVER commit API keys to git

Script Options

OptionDescription
---------------------
--model MODELModel name (default: google/gemini-3.1-flash-image-preview)
--input-image PATHInput image for image-to-image generation
--temperature NRandomness 0.0-2.0 (default: 1.0)
--max-tokens NMax output tokens
--aspect-ratio RATIO1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9
--image-size SIZE1K (default), 2K, 4K

Image-to-Image

Edit existing images with text prompts:

python3 scripts/generate_image.py "Make it nighttime" result.png --input-image photo.jpg

Available Models

ModelAliasUse Case
------------------------
google/gemini-3.1-flash-image-previewNano Banana 2Fast & quality (default)
google/gemini-3-pro-image-previewNano Banana ProBest quality
google/gemini-2.5-flash-imageNano BananaFaster generation

Prompt Tips

Writing effective prompts:

  • Be specific: "A golden retriever puppy playing on grass" instead of "a dog"
  • Include details: lighting (golden hour, soft light), style (photorealistic, anime, oil painting)
  • For image-to-image: describe the desired change clearly, e.g., "Change to nighttime with city lights"
  • Try 10+ words for better results

Troubleshooting

ErrorFix
------------
Input image not foundCheck file path; verify file exists
Image too largeMax input size is 20 MB; compress before uploading
401 UnauthorizedCheck ZENMUX_API_KEY is set correctly
429 Rate limitedWait and retry, or upgrade to paid tier
Request timeoutAPI may be slow; wait and retry
Network errorCheck internet connection
No image in responseTry a different prompt or model
Poor image qualityUse more descriptive prompt (10+ words)

Script Features

  • Timeout protection: Requests timeout after 300 seconds (5 minutes)
  • Auto-create directories: Output directories are created automatically
  • Auto-rename on conflict: If output file exists, automatically appends number (e.g., image_1.png, image_2.png)
  • Input validation: Checks image format, size, and existence
  • Clear error messages: Human-readable error explanations
  • Format support: JPG, PNG, WebP, GIF input formats

Batch Generation

Generate multiple images by running the script multiple times with different outputs:

# Generate variations of the same prompt
for i in 1 2 3; do
  python3 scripts/generate_image.py "A cute cat in different poses" "cat_$i.png"
done

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 08:28 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 857 📥 199,438
content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,033
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,148