nano-banana-pro-image-gen图片生成技能,当用户需要生成图片、创建图像、编辑/修改/调整已有图片时使用此技能。支持10种图片比例(1:1、16:9、9:16等)和3种分辨率(1K、2K、4K),支持文生图和图生图编辑。
Install via ClawdBot CLI:
clawdbot install wuchubuzai2018/nano-banana-pro-image-gen图片生成技能,可以通过自然语言帮助用户生成图片,通过API易国内代理服务访问,支持Node.js和Python两种运行环境。
遵循以下步骤:
-p 提示词的主体,避免自行改写、总结或二次创作,防止细节丢失。-p "帮我生成一张猫的图片,风格要可爱一点。"-p "帮我生成一张猫的图片,风格要可爱一点。猫是橘色的,背景是草地。"cat_in_garden.png),避免使用通用名。9:1616:91:12K。4K,并通过友好性提示,提示用户生成较慢,耐心等待。1K, 2K, 4K)。APIYI_API_KEY 环境变量是否已设置(通常假定已设置,若运行失败再提示用户)。node 命令可用),优先使用 scripts/generate_image.js(零依赖,参数与 Python 保持一致)。scripts/generate_image.py。文生图命令模板(优先 Node.js):
node scripts/generate_image.js -p "{prompt}" -f "{filename}" [-a {ratio}] [-r {res}]
图生图命令模板(优先 Node.js):
node scripts/generate_image.js -p "{edit_instruction}" -i "{input_path}" -f "{output_filename}" [-r {res}]
(可选)Python 版本命令模板(Node 不可用时):
python scripts/generate_image.py -p "{prompt}" -f "{filename}" [-a {ratio}] [-r {res}]
python scripts/generate_image.py -p "{edit_instruction}" -i "{input_path}" -f "{output_filename}" [-r {res}]
执行前必须告知用户:
"快速模式:1K分辨率生成,预计30秒内完成"
"高质量模式:2K分辨率生成,预计1-4分钟\n⏳ 开始生成... 🔄"
python scripts/generate_image.py -p "图片描述文本" -f "output.png" [-a 1:1] [-r 1K]
示例:
# 基础生成
python scripts/generate_image.py -p "一只可爱的橘猫在草地上玩耍" -f "cat.png"
# 指定比例和分辨率
python scripts/generate_image.py -p "日落山脉风景" -f "sunset.png" -a 16:9 -r 4K
# 竖版高清图片(适合手机壁纸)
python scripts/generate_image.py -p "城市夜景" -f "city.png" -a 9:16 -r 2K
(可选)Node.js 版本示例:
# 基础生成
node scripts/generate_image.js -p "一只可爱的橘猫在草地上玩耍" -f "cat.png"
# 指定比例和分辨率
node scripts/generate_image.js -p "日落山脉风景" -f "sunset.png" -a 16:9 -r 4K
python scripts/generate_image.py -p "编辑指令" -f "output.png" -i "path/to/input.png" [-a 1:1] [-r 1K]
示例:
# 修改风格
python scripts/generate_image.py -p "将图片转换成水彩画风格" -f "watercolor.png" -i "original.png"
# 添加元素
python scripts/generate_image.py -p "在天空添加彩虹" -f "rainbow.png" -i "landscape.png" -r 2K
# 替换背景
python scripts/generate_image.py -p "将背景换成海滩" -f "beach-bg.png" -i "portrait.png" -a 3:4
(可选)Node.js 版本示例:
# 修改风格
node scripts/generate_image.js -p "将图片转换成水彩画风格" -f "watercolor.png" -i "original.png"
# 多张参考图(最多14张)
node scripts/generate_image.js -p "参考多张图片融合风格" -i ref1.png ref2.png ref3.png -f "merged.png"
Python 与 Node.js 版本参数保持一致(短参数与长参数等价)。
| 参数 | 必填 | 说明 |
|------|------|------|
| -p / --prompt | 是 | 图片描述(文生图)或编辑指令(图生图)。保留用户原始完整输入。 |
| -f / --filename | 否 | 输出图片路径/文件名;不传则自动生成带时间戳的 PNG 文件名,并写入当前目录。 |
| -a / --aspect-ratio | 否 | 图片比例:1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9。 |
| -r / --resolution | 否 | 图片分辨率:1K / 2K / 4K(必须大写)。不传则不在请求中指定,由 API 侧决定。 |
| -i / --input-image | 否 | 图生图输入图片路径;可传多张(最多 14 张)。传入该参数即进入编辑模式。 |
支持以下10种比例:
| 比例 | 方向 | 适用场景 |
|------|------|----------|
| 1:1 | 正方形 | 头像、Instagram帖子 |
| 16:9 | 横版 | YouTube缩略图、桌面壁纸、演示文稿 |
| 9:16 | 竖版 | 抖音/TikTok、Instagram Stories、手机壁纸 |
| 4:3 | 横版 | 经典照片、演示文稿 |
| 3:4 | 竖版 | Pinterest、人像摄影 |
| 3:2 | 横版 | 单反相机标准、印刷媒体 |
| 2:3 | 竖版 | 人像海报 |
| 5:4 | 横版 | 大幅面打印、艺术印刷 |
| 4:5 | 竖版 | Instagram帖子、社交媒体 |
| 21:9 | 超宽 | 电影感、横幅、全景 |
1K、2K、4K三种分辨率选项
注意: 分辨率值必须大写(1K、2K、4K)
默认: 2K
如果你还没有API密钥,请前往 https://api.apiyi.com 注册账号并申请API Key。
获取步骤:
脚本按以下顺序查找API密钥:
--api-key 命令行参数(临时使用)APIYI_API_KEY 环境变量(推荐)设置环境变量(推荐):
# Linux/Mac
export APIYI_API_KEY="your-api-key-here"
# Windows CMD
我的电脑高级设置中设置环境变量或者执行set APIYI_API_KEY=your-api-key-here
# Windows PowerShell
在我的电脑中设置环境变量:$env:APIYI_API_KEY="your-api-key-here"
命令行参数方式(临时):
python scripts/generate_image.py -p "一只猫" -k "your-api-key-here"
Generated Mar 1, 2026
Content creators and marketers use this skill to generate custom images for posts, stories, and ads on platforms like Instagram, TikTok, and YouTube. It supports various aspect ratios (e.g., 1:1 for Instagram posts, 9:16 for Stories) and resolutions, enabling quick production of visually appealing graphics without design expertise.
Online retailers and sellers utilize the skill to create or edit product images, such as generating lifestyle shots or modifying backgrounds to enhance listings. The image editing capabilities allow for adjustments based on customer feedback, improving product presentation on platforms like Amazon or Shopify.
Educators and instructional designers employ the skill to produce custom illustrations, diagrams, and visual aids for courses, presentations, and textbooks. It helps in creating engaging content tailored to specific topics, with options for different resolutions suitable for digital or print media.
Individuals and artists use the skill to generate unique artwork, avatars, or wallpapers based on personal descriptions. The support for multiple aspect ratios and resolutions allows for customization across devices, such as creating phone wallpapers (9:16) or profile pictures (1:1).
Offer the image generation capability as a paid API service, charging users based on usage tiers (e.g., number of images generated per month). This model targets developers and businesses integrating the skill into their applications, with revenue from monthly or annual subscriptions.
Provide a free basic version with limited features (e.g., lower resolutions) and charge for premium features like higher resolutions (4K), advanced editing, or priority processing. This attracts individual users and small businesses, converting them to paid plans for enhanced functionality.
License the skill as a customizable white-label solution for large companies in industries like marketing or e-commerce, allowing them to rebrand and integrate it into their internal workflows. Revenue comes from one-time licensing fees or ongoing support contracts.
💬 Integration Tip
Ensure the APIYI_API_KEY environment variable is set before use, and prioritize Node.js for execution if available to leverage zero-dependency scripts.
Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.
Capture frames or clips from RTSP/ONVIF cameras.
Batch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
Generate images using the internal Google Antigravity API (Gemini 3 Pro Image). High quality, native generation without browser automation.
使用内置 image_generate.py 脚本生成图片, 准备清晰具体的 `prompt`。
AI image generation powered by CellCog. Create images, edit photos, consistent characters, product photography, reference-based images, sets of images, style transfer. Professional image creation with AI.