image-gen-blockeden-openai
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGenerate 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 environment variable must be set. If it's missing, tell the user:
BLOCKEDEN_ACCESS_KEYPlease set theenvironment variable before using this skill.BLOCKEDEN_ACCESS_KEY
必须设置环境变量。如果未设置,请告知用户:
BLOCKEDEN_ACCESS_KEY请在使用此技能前设置环境变量。BLOCKEDEN_ACCESS_KEY
How to generate an image
如何生成图像
Use the bundled script at (relative to this SKILL.md):
scripts/generate_image.pybash
python <skill_dir>/scripts/generate_image.py "<prompt>" [options]使用本SKILL.md所在目录下的捆绑脚本:
scripts/generate_image.pybash
python <skill_dir>/scripts/generate_image.py "<prompt>" [options]Options
选项
| Flag | Default | Choices | Notes |
|---|---|---|---|
| | any URI | Reference image URL to base generation on. Uses |
| | | Landscape: |
| | | |
| | | Model for text-only generation. Ignored when |
| | | DALL-E 3 only. |
| | any path | Directory where the PNG will be saved |
| 标识 | 默认值 | 可选值 | 说明 |
|---|---|---|---|
| | 任意URI | 用于生成图像的参考图片URL。通过 |
| | | 横向: |
| | | |
| | | 纯文本生成使用的模型。当设置 |
| | | 仅适用于DALL-E 3。 |
| | 任意路径 | 保存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 ~/Desktopbash
python /path/to/skill/scripts/generate_image.py \
"雨天里温馨的咖啡店,印象派绘画风格" \
--size 1792x1024 \
--quality hd \
--style natural \
--output-dir ~/DesktopExample: 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 ~/Desktopbash
python /path/to/skill/scripts/generate_image.py \
"相同构图,但设置为夜晚霓虹灯场景" \
--reference-image "https://example.com/my-photo.jpg" \
--output-dir ~/DesktopAfter 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:
- Tell the user the file path so they can open it.
- Show the if DALL-E rewrote it — this helps the user refine future prompts.
revised_prompt - 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"
}图片保存完成后:
- 告知用户文件路径,方便他们打开查看。
- 如果DALL-E重写了提示词,展示——这有助于用户优化未来的提示词。
revised_prompt - 如果用户想要迭代优化,可提供重新生成(使用不同参数)的选项。
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 . The model switches automatically to
--reference-image.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 (text-only mode only).
--quality hd - If the user says "realistic" or "photorealistic", use .
--style natural - If the user says "artistic", "dramatic", or "vivid", use (the default).
--style vivid - 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
优质的图像提示词应具体且具有视觉性。如果用户的需求模糊,可以适当优化:
- 如果未指定媒介/风格,添加一个(例如:“数字艺术”、“水彩画”、“照片级写实”)
- 如果内容过于通用,添加光线或氛围描述(例如:“黄金时段光线”、“忧郁氛围”)
- 不要过度加工——以用户的核心需求为中心