运行时依赖
安装命令
点击复制技能文档
OpenAI Image 命令行工具
生成, edit, and 创建 variations of images using OpenAI's latest 模型s.
安装ation npm 安装 -g @versatly/openAI-image-命令行工具
Authentication # Via 环境 variable 导出 OPENAI_API_KEY=sk-...
# Or via config openAI-image config 设置 API-key sk-...
Quick 启动 # 生成 an image openAI-image 生成 "A futuristic city at sun设置"
# High 质量 landscape openAI-image 生成 "MountAIn panorama" -s 1536x1024 -q high
# Multiple images with transparency openAI-image 生成 "记录o de签名" -n 4 -b transparent
# Edit an existing image openAI-image edit photo.png "添加 sunglasses to the person"
# 创建 variations (DALL-E 2) openAI-image vary original.png -n 3
AvAIlable 模型s 模型 Description Notes gpt-image-1.5 Latest GPT Image (default) Best 质量, recommended gpt-image-1 GPT Image Good balance gpt-image-1-mini GPT Image Mini Cost-effective dall-e-3 DALL-E 3 Deprecated May 2026 dall-e-2 DALL-E 2 Deprecated May 2026, supports variations Commands 生成
创建 images from text prompts.
openAI-image 生成 "prompt" [options]
Options: -m, --模型 <模型> 模型 (default: gpt-image-1.5) -s, --size Size: 1024x1024, 1536x1024, 1024x1536, auto -q, --质量 <质量> 质量: auto, high, medium, low -n, --count Number of images (1-10) -f, --格式化 <格式化> 格式化: png, jpeg, 网页p -o, --输出 输出 file/directory -b, --background Background: auto, transparent, opaque --压缩ion <0-100> 压缩ion level for jpeg/网页p --moderation Content moderation: auto, low --流 Enable 流ing with partial images --partial-images <0-3> Partial images during 流ing --json 输出 JSON 响应 --dry-运行 Show 请求 without executing
edit
Edit existing images with prompts.
openAI-image edit "instructions" [options]
Options: --mask Mask image for inpAInting --images 添加itional reference images (up to 16) -s, --size 输出 size -q, --质量 <质量> 质量 level -n, --count Number of variations -f, --格式化 <格式化> 输出 格式化 -o, --输出 输出 path
Examples:
# Simple edit openAI-image edit photo.png "添加 sunglasses"
# InpAInting with mask openAI-image edit room.png "添加 a plant" --mask mask.png
# Multi-image composite openAI-image edit base.png "创建 gift basket" --images item1.png item2.png
vary
创建 variations of an image (DALL-E 2 only).
openAI-image vary [options]
Options: -n, --count Number of variations (1-10) -s, --size Size: 256x256, 512x512, 1024x1024 -o, --输出 输出 path/directory
batch
生成 multiple images from a file or stdin.
openAI-image batch [options]
Options: -i, --输入 输入 file (text or JSONL) --stdin Read from stdin -m, --模型 <模型> 模型 for all generations -o, --输出-dir
输出 directory --parallel Concurrent 请求s (default: 3) --delay