image-gen-blockeden-openai

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Generate an Image via BlockEden OpenAI Proxy

通过BlockEden OpenAI代理生成图像

You are helping the user generate an AI image using the BlockEden OpenAI proxy, which is fully compatible with the OpenAI Images API (DALL-E 3 / DALL-E 2 / gpt-image-1).
你将协助用户通过BlockEden OpenAI代理生成AI图像,该代理完全兼容OpenAI Images API(DALL-E 3 / DALL-E 2 / gpt-image-1)。

Prerequisites

前提条件

The
BLOCKEDEN_ACCESS_KEY
environment variable must be set. If it's missing, tell the user:
Please set the
BLOCKEDEN_ACCESS_KEY
environment variable before using this skill.
必须设置
BLOCKEDEN_ACCESS_KEY
环境变量。如果未设置,请告知用户:
请在使用此技能前设置
BLOCKEDEN_ACCESS_KEY
环境变量。

How to generate an image

如何生成图像

Use the bundled script at
scripts/generate_image.py
(relative to this SKILL.md):
bash
python <skill_dir>/scripts/generate_image.py "<prompt>" [options]
使用本SKILL.md所在目录下的捆绑脚本
scripts/generate_image.py
bash
python <skill_dir>/scripts/generate_image.py "<prompt>" [options]

Options

选项

FlagDefaultChoicesNotes
--reference-image
None
any URIReference image URL to base generation on. Uses
gpt-image-1
via
/v1/responses
.
--size
1024x1024
1024x1024
,
1792x1024
,
1024x1792
Landscape:
1792x1024
, Portrait:
1024x1792
--quality
standard
standard
,
hd
hd
gives finer detail, costs more (text-only mode only)
--model
dall-e-3
dall-e-3
,
dall-e-2
Model for text-only generation. Ignored when
--reference-image
is set.
--style
vivid
vivid
,
natural
DALL-E 3 only.
vivid
= dramatic,
natural
= realistic
--output-dir
.
any pathDirectory where the PNG will be saved
标识默认值可选值说明
--reference-image
None
任意URI用于生成图像的参考图片URL。通过
/v1/responses
使用
gpt-image-1
模型。
--size
1024x1024
1024x1024
,
1792x1024
,
1024x1792
横向:
1792x1024
,纵向:
1024x1792
--quality
standard
standard
,
hd
hd
画质细节更丰富,成本更高(仅支持纯文本模式)
--model
dall-e-3
dall-e-3
,
dall-e-2
纯文本生成使用的模型。当设置
--reference-image
时,此参数将被忽略。
--style
vivid
vivid
,
natural
仅适用于DALL-E 3。
vivid
= 富有戏剧性,
natural
= 写实风格
--output-dir
.
任意路径保存PNG图片的目录

Example: text-only generation

示例:纯文本生成

bash
python /path/to/skill/scripts/generate_image.py \
  "a cozy coffee shop on a rainy day, impressionist painting style" \
  --size 1792x1024 \
  --quality hd \
  --style natural \
  --output-dir ~/Desktop
bash
python /path/to/skill/scripts/generate_image.py \
  "雨天里温馨的咖啡店,印象派绘画风格" \
  --size 1792x1024 \
  --quality hd \
  --style natural \
  --output-dir ~/Desktop

Example: reference image generation

示例:基于参考图片生成

bash
python /path/to/skill/scripts/generate_image.py \
  "same composition but set at night with neon lights" \
  --reference-image "https://example.com/my-photo.jpg" \
  --output-dir ~/Desktop
bash
python /path/to/skill/scripts/generate_image.py \
  "相同构图,但设置为夜晚霓虹灯场景" \
  --reference-image "https://example.com/my-photo.jpg" \
  --output-dir ~/Desktop

After generation

生成完成后

Text-only mode output

纯文本模式输出

json
{
  "filepath": "/path/to/image_1234567890.png",
  "revised_prompt": "...",
  "model": "dall-e-3",
  "size": "1024x1024",
  "quality": "standard",
  "style": "vivid"
}
json
{
  "filepath": "/path/to/image_1234567890.png",
  "revised_prompt": "...",
  "model": "dall-e-3",
  "size": "1024x1024",
  "quality": "standard",
  "style": "vivid"
}

Reference image mode output

参考图片模式输出

json
{
  "filepath": "/path/to/image_1234567890.png",
  "model": "gpt-image-1",
  "reference_image": "https://example.com/my-photo.jpg",
  "prompt": "same composition but set at night with neon lights"
}
Once the image is saved:
  1. Tell the user the file path so they can open it.
  2. Show the
    revised_prompt
    if DALL-E rewrote it — this helps the user refine future prompts.
  3. Offer to regenerate with different parameters if the user wants to iterate.
json
{
  "filepath": "/path/to/image_1234567890.png",
  "model": "gpt-image-1",
  "reference_image": "https://example.com/my-photo.jpg",
  "prompt": "same composition but set at night with neon lights"
}
图片保存完成后:
  1. 告知用户文件路径,方便他们打开查看。
  2. 如果DALL-E重写了提示词,展示
    revised_prompt
    ——这有助于用户优化未来的提示词。
  3. 如果用户想要迭代优化,可提供重新生成(使用不同参数)的选项。

Interpreting the user's request

解读用户需求

  • Extract the core visual description from what the user says and use it as the prompt.
  • If the user provides a reference image URL/URI, pass it via
    --reference-image
    . The model switches automatically to
    gpt-image-1
    .
  • If the user specifies an aspect ratio (wide, tall, square), map it to the appropriate
    --size
    .
  • If the user says "high quality", "detailed", or "HD", add
    --quality hd
    (text-only mode only).
  • If the user says "realistic" or "photorealistic", use
    --style natural
    .
  • If the user says "artistic", "dramatic", or "vivid", use
    --style vivid
    (the default).
  • If the user provides an output location, pass it via
    --output-dir
    .
  • If no output location is given, save to the current working directory.
  • 从用户的表述中提取核心视觉描述,将其作为提示词。
  • 如果用户提供了参考图片URL/URI,通过
    --reference-image
    参数传入。模型会自动切换为
    gpt-image-1
  • 如果用户指定了宽高比(宽屏、竖屏、正方形),映射到对应的
    --size
    参数。
  • 如果用户提到“高质量”、“细节丰富”或“HD”,添加
    --quality hd
    参数(仅适用于纯文本模式)。
  • 如果用户想要“写实”或“照片级写实”风格,使用
    --style natural
    参数。
  • 如果用户想要“艺术感”、“戏剧性”或“生动”风格,使用
    --style vivid
    参数(默认值)。
  • 如果用户指定了输出位置,通过
    --output-dir
    参数传入。
  • 如果未指定输出位置,保存到当前工作目录。

Prompt crafting tips

提示词编写技巧

Good image prompts are specific and visual. If the user's request is vague, enhance it slightly:
  • Add a medium/style if none given (e.g., "digital art", "watercolor", "photorealistic")
  • Add lighting or atmosphere if it feels generic (e.g., "golden hour lighting", "moody atmosphere")
  • Don't over-engineer — keep the user's intent central
优质的图像提示词应具体且具有视觉性。如果用户的需求模糊,可以适当优化:
  • 如果未指定媒介/风格,添加一个(例如:“数字艺术”、“水彩画”、“照片级写实”)
  • 如果内容过于通用,添加光线或氛围描述(例如:“黄金时段光线”、“忧郁氛围”)
  • 不要过度加工——以用户的核心需求为中心