拾流 / 生成配图 · 创作技能

SHILIU · 创作资源

生成配图 · 创作技能

通过仓库自带的零依赖Node客户端调用Gemini或OpenAI生成、编辑或批量生成配图,含提示词规范、参考图、JSONL批处理、逐张检查与失败回退。需用户自行配置API密钥,不得在对话中粘贴密钥。

拾流编辑部 · 更新于 2026-11-02

这个技能解决什么问题

通过仓库自带的零依赖Node客户端调用Gemini或OpenAI生成、编辑或批量生成配图,含提示词规范、参考图、JSONL批处理、逐张检查与失败回退。需用户自行配置API密钥,不得在对话中粘贴密钥。

适用任务

为页面或内容流程生成、编辑或批量生成插图、示意图、封面与参考图改图,并逐张检查文字、构图与移动端可读性。

需要的输入

先解压完整包,按 SHILIU-INSTALL.md 读取 upstream/executors/generate-image/SKILL.md。图片用途与位置;主体与可见动作;构图与宽高比;视觉风格与品牌色;必须逐字出现的文字;必须出现的细节;需排除的伪影、logo、水印与无关文字;可选参考图;已配置的GEMINI_API_KEY或OPENAI_API_KEY(通过环境变量或根目录.env文件)。

交付内容

选定图片文件(稳定描述性文件名、明确尺寸、适当压缩);对应alt文本;批量任务的JSONL作业文件与输出目录;逐张检查记录与必要的重生成或改用代码原生图形的说明。

任务示例

为<页面区块>生成一张16:9示意图,主体为<对象与动作>,风格<风格>,品牌色<色值>,图中仅出现文字“<标签1>”“<标签2>”,不得出现其他文字或水印。参考图:<路径>。输出到<目录>/<文件名>.png。

输出示例

示意(非真实结果):生成图片文件路径、尺寸与alt文本;检查清单逐项标注通过或需重生成;若多次失败则给出改用代码原生图形的方案。实际图片需真实生成后核对。

来源与使用

作者 tsingyuai;许可 Apache-2.0。已核对来源与包结构,未据此宣称完成运行实测。

查看原始来源

机器可读详情 · 读取 SKILL.md · 下载完整技能包

技能说明全文

---
name: generate-image
description: Generate, edit, or batch-create SEO, marketing, social, and document images with Gemini or OpenAI through the repository-owned Growth Lab image client. Use when a page or content loop needs illustrations, diagrams, covers, reference-image edits, multiple candidates, or verified image text and composition. This is the only AI image-generation Executor in Growth Lab.
---

# Generate images

Use `executors/generate-image/generate-image.mjs` for text-to-image and reference-image editing.
It is a repository-owned, zero-dependency Node.js client. Do not call Codex system Skills, private scripts, or files under `~/.codex`.

## Define the asset

Specify:

- placement and purpose;
- subject and visible action;
- composition and aspect ratio;
- visual style and brand palette;
- exact text when text is essential;
- details that must appear;
- artifacts, logos, watermarks, and unrelated text to exclude.

Prefer real product screenshots when the image explains product behavior. Use generated visuals for concepts, scenes, covers, illustrations, diagrams, and supporting examples.

## Generate

Use a prompt file for long or multilingual prompts:

```bash
node executors/generate-image/generate-image.mjs \
  --out <output.png> --prompt-file <prompt.txt>
```

Choose OpenAI explicitly when appropriate:

```bash
node executors/generate-image/generate-image.mjs \
  --model gpt-image-2 --out <output.png> \
  --prompt-file <prompt.txt>
```

`--model` accepts any `gpt-image-*` ID (sent to the OpenAI Images API at `OPENAI_BASE_URL`) or any `gemini-*image*` / `nano-banana*` ID (sent to the Gemini API at `GOOGLE_GEMINI_BASE_URL`). Compatible gateways may expose suffixed or tiered model IDs; list them with the gateway's `/v1/models` before choosing.

Add one `--ref <image>` argument for each reference image used in an edit.

For JSONL batch generation, put one job per line with `prompt` or `prompt_file`, `out`, and optional `model`, `refs`, `size`, or `quality`:

```bash
node executors/generate-image/generate-image.mjs \
  --batch <jobs.jsonl> --out-dir <directory> --concurrency 3
```

Read `GEMINI_API_KEY` or `OPENAI_API_KEY` from the process environment, root `.env.local`, or root `.env`, in that precedence order. Use `GOOGLE_GEMINI_BASE_URL` or `OPENAI_BASE_URL` only for a compatible HTTPS endpoint. Keep credentials out of prompts, files, logs, and commits.
Do not read credentials from another application's private authentication files.

Before the first provider call, run `python models/onboard-growth-lab/scripts/check_configuration.py`. If image generation is `optional-missing`, tell the user that collection, copywriting, review, and deterministic rendering can continue without an image API. When generated assets are requested, point to [`CONFIGURATION.md`](../../CONFIGURATION.md), name the OpenAI and Gemini field options, and wait for the user to configure or skip. Never ask them to paste a key into the conversation. A paid verification call requires separate approval.

## Control text and structure

List every required label verbatim in the prompt. State that all rendered text must match those strings exactly and that the image may contain no other text or watermark.

For a structured diagram, enumerate nodes, arrows, order, grouping, and direction explicitly. For edits, state what must remain unchanged.

## Inspect every result

Use the Runtime's image viewer at full size. Check:

- relevance to the adjacent page content;
- every rendered character;
- subject and factual details;
- arrow direction, order, and grouping;
- visual artifacts and unintended objects;
- crop, aspect ratio, and mobile readability;
- consistency with the product's visual language.

Regenerate with one targeted correction when the result fails. Use a deterministic code-native graphic when repeated attempts cannot render exact dense text or structure.

Store the selected asset in the product's normal public directory with a stable descriptive filename, suitable compression, explicit dimensions, and descriptive alt text.

技能是任务材料,不会自动授予账户权限、付费授权或其他系统权限。请让 Agent 按说明核对依赖,再在授权范围内使用。

把这个任务交给你的 Agent

数据、技能和创作空间,一起备好。复制接入指令,发给你正在使用的 AI 工具。

阅读 Agent 接入指南
正在复制指令

粘贴发给你的 Agent
让它成为你的自媒体专家

打开你正在使用的 AI 工具,把下面这段话粘贴到对话框并发送。

发给 Agent 的完整指令

发送后,告诉它你想做什么账号、实现什么目标。

这些 Agent 都可以使用24 个工具