openai-image-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenAI Image Gen
OpenAI 图像生成
Generate a handful of “random but structured” prompts and render them via the OpenAI Images API.
生成若干「随机但结构化」的提示词,并通过OpenAI Images API渲染生成对应图像。
Run
运行
Note: Image generation can take longer than common exec timeouts (for example 30 seconds).
When invoking this skill via OpenClaw’s exec tool, set a higher timeout to avoid premature termination/retries (e.g., exec timeout=300).
bash
python3 {baseDir}/scripts/gen.py
open ~/Projects/tmp/openai-image-gen-*/index.html # if ~/Projects/tmp exists; else ./tmp/...Useful flags:
bash
undefined注意:图像生成的耗时通常会超过常见的执行超时阈值(例如30秒)。通过OpenClaw的exec工具调用该技能时,请设置更高的超时时间,避免提前终止或重试(例如设置exec timeout=300)。
bash
python3 {baseDir}/scripts/gen.py
open ~/Projects/tmp/openai-image-gen-*/index.html # if ~/Projects/tmp exists; else ./tmp/...常用参数:
bash
undefinedGPT image models with various options
GPT image models with various options
python3 {baseDir}/scripts/gen.py --count 16 --model gpt-image-1
python3 {baseDir}/scripts/gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4
python3 {baseDir}/scripts/gen.py --size 1536x1024 --quality high --out-dir ./out/images
python3 {baseDir}/scripts/gen.py --model gpt-image-1.5 --background transparent --output-format webp
python3 {baseDir}/scripts/gen.py --count 16 --model gpt-image-1
python3 {baseDir}/scripts/gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4
python3 {baseDir}/scripts/gen.py --size 1536x1024 --quality high --out-dir ./out/images
python3 {baseDir}/scripts/gen.py --model gpt-image-1.5 --background transparent --output-format webp
DALL-E 3 (note: count is automatically limited to 1)
DALL-E 3 (note: count is automatically limited to 1)
python3 {baseDir}/scripts/gen.py --model dall-e-3 --quality hd --size 1792x1024 --style vivid
python3 {baseDir}/scripts/gen.py --model dall-e-3 --style natural --prompt "serene mountain landscape"
python3 {baseDir}/scripts/gen.py --model dall-e-3 --quality hd --size 1792x1024 --style vivid
python3 {baseDir}/scripts/gen.py --model dall-e-3 --style natural --prompt "serene mountain landscape"
DALL-E 2
DALL-E 2
python3 {baseDir}/scripts/gen.py --model dall-e-2 --size 512x512 --count 4
undefinedpython3 {baseDir}/scripts/gen.py --model dall-e-2 --size 512x512 --count 4
undefinedModel-Specific Parameters
各模型专属参数
Different models support different parameter values. The script automatically selects appropriate defaults based on the model.
不同模型支持的参数取值不同,脚本会基于选中的模型自动选择合适的默认值。
Size
尺寸
- GPT image models (,
gpt-image-1,gpt-image-1-mini):gpt-image-1.5,1024x1024(landscape),1536x1024(portrait), or1024x1536auto- Default:
1024x1024
- Default:
- dall-e-3: ,
1024x1024, or1792x10241024x1792- Default:
1024x1024
- Default:
- dall-e-2: ,
256x256, or512x5121024x1024- Default:
1024x1024
- Default:
- GPT图像模型(、
gpt-image-1、gpt-image-1-mini):支持gpt-image-1.5、1024x1024(横版)、1536x1024(竖版)或1024x1536auto- 默认值:
1024x1024
- 默认值:
- dall-e-3:支持、
1024x1024或1792x10241024x1792- 默认值:
1024x1024
- 默认值:
- dall-e-2:支持、
256x256或512x5121024x1024- 默认值:
1024x1024
- 默认值:
Quality
画质
- GPT image models: ,
auto,high, ormediumlow- Default:
high
- Default:
- dall-e-3: or
hdstandard- Default:
standard
- Default:
- dall-e-2: only
standard- Default:
standard
- Default:
- GPT图像模型:支持、
auto、high、mediumlow- 默认值:
high
- 默认值:
- dall-e-3:支持或
hdstandard- 默认值:
standard
- 默认值:
- dall-e-2:仅支持
standard- 默认值:
standard
- 默认值:
Other Notable Differences
其他显著差异
- dall-e-3 only supports generating 1 image at a time (). The script automatically limits count to 1 when using this model.
n=1 - GPT image models support additional parameters:
- :
--background,transparent, oropaque(default)auto - :
--output-format(default),png, orjpegwebp - Note: and
streamare available via API but not yet implemented in this scriptmoderation
- dall-e-3 has a parameter:
--style(hyper-real, dramatic) orvivid(more natural looking)natural
- dall-e-3仅支持单次生成1张图像(),使用该模型时脚本会自动将生成数量限制为1。
n=1 - GPT图像模型支持额外参数:
- :可选
--background(透明)、transparent(不透明)或opaque(默认)auto - :可选
--output-format(默认)、png或jpegwebp - 注意:API支持和
stream功能,但本脚本暂未实现moderation
- dall-e-3提供参数:可选
--style(超写实、戏剧化风格)或vivid(更自然的观感)natural
Output
输出
- ,
*.png, or*.jpegimages (output format depends on model +*.webp)--output-format - (prompt → file mapping)
prompts.json - (thumbnail gallery)
index.html
- 、
*.png或*.jpeg格式的图像文件(输出格式由所选模型和*.webp参数决定)--output-format - (存储提示词与生成文件的映射关系)
prompts.json - (缩略图图库页面)
index.html