openai-image-gen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenAI 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
undefined

GPT 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
undefined
python3 {baseDir}/scripts/gen.py --model dall-e-2 --size 512x512 --count 4
undefined

Model-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
    ,
    1536x1024
    (landscape),
    1024x1536
    (portrait), or
    auto
    • Default:
      1024x1024
  • dall-e-3:
    1024x1024
    ,
    1792x1024
    , or
    1024x1792
    • Default:
      1024x1024
  • dall-e-2:
    256x256
    ,
    512x512
    , or
    1024x1024
    • Default:
      1024x1024
  • GPT图像模型
    gpt-image-1
    gpt-image-1-mini
    gpt-image-1.5
    ):支持
    1024x1024
    1536x1024
    (横版)、
    1024x1536
    (竖版)或
    auto
    • 默认值:
      1024x1024
  • dall-e-3:支持
    1024x1024
    1792x1024
    1024x1792
    • 默认值:
      1024x1024
  • dall-e-2:支持
    256x256
    512x512
    1024x1024
    • 默认值:
      1024x1024

Quality

画质

  • GPT image models:
    auto
    ,
    high
    ,
    medium
    , or
    low
    • Default:
      high
  • dall-e-3:
    hd
    or
    standard
    • Default:
      standard
  • dall-e-2:
    standard
    only
    • Default:
      standard
  • GPT图像模型:支持
    auto
    high
    medium
    low
    • 默认值:
      high
  • dall-e-3:支持
    hd
    standard
    • 默认值:
      standard
  • dall-e-2:仅支持
    standard
    • 默认值:
      standard

Other Notable Differences

其他显著差异

  • dall-e-3 only supports generating 1 image at a time (
    n=1
    ). The script automatically limits count to 1 when using this model.
  • GPT image models support additional parameters:
    • --background
      :
      transparent
      ,
      opaque
      , or
      auto
      (default)
    • --output-format
      :
      png
      (default),
      jpeg
      , or
      webp
    • Note:
      stream
      and
      moderation
      are available via API but not yet implemented in this script
  • dall-e-3 has a
    --style
    parameter:
    vivid
    (hyper-real, dramatic) or
    natural
    (more natural looking)
  • dall-e-3仅支持单次生成1张图像(
    n=1
    ),使用该模型时脚本会自动将生成数量限制为1。
  • GPT图像模型支持额外参数:
    • --background
      :可选
      transparent
      (透明)、
      opaque
      (不透明)或
      auto
      (默认)
    • --output-format
      :可选
      png
      (默认)、
      jpeg
      webp
    • 注意:API支持
      stream
      moderation
      功能,但本脚本暂未实现
  • dall-e-3提供
    --style
    参数:可选
    vivid
    (超写实、戏剧化风格)或
    natural
    (更自然的观感)

Output

输出

  • *.png
    ,
    *.jpeg
    , or
    *.webp
    images (output format depends on model +
    --output-format
    )
  • prompts.json
    (prompt → file mapping)
  • index.html
    (thumbnail gallery)
  • *.png
    *.jpeg
    *.webp
    格式的图像文件(输出格式由所选模型和
    --output-format
    参数决定)
  • prompts.json
    (存储提示词与生成文件的映射关系)
  • index.html
    (缩略图图库页面)