Update gen-image skill specs

This commit is contained in:
mac
2026-07-18 11:00:23 +08:00
parent 45ee76e3c8
commit 4c7e9dfc68
7 changed files with 136 additions and 32 deletions
+19 -4
View File
@@ -1,6 +1,6 @@
# gen-image · 生图 Skill
通过大模型中转站,直接调用 OpenAI 图片接口生图。文生图 / 图生图 / 局部重绘 / 透明背景,零第三方依赖。
通过大模型中转站,直接调用 OpenAI 图片接口生图。文生图 / 图生图 / 局部重绘 / 透明背景 / 1K-4K 常用尺寸 / 可选 style 风格参数,零第三方依赖。
## 快速开始
@@ -11,13 +11,16 @@ cp .env.example .env
# 2. 文生图
python3 scripts/gen_image.py "a cozy cabin in snowy mountains, golden hour, cinematic" \
--size 1536x1024 --quality high
--size 2k-landscape --quality high
# 3. 图生图 / 编辑
python3 scripts/gen_image.py "把背景换成星空" --edit input.png
python3 scripts/gen_image.py "把背景换成星空" --edit input.png --size 1k-square
# 4. 局部重绘(mask 透明处为重绘区域)
python3 scripts/gen_image.py "戴上一顶红帽子" --edit input.png --mask mask.png
# 5. 可选 style 参数(部分模型/中转支持)
python3 scripts/gen_image.py "a studio portrait, natural light" --style natural --size 1k-portrait
```
图片保存到 `output/`,脚本打印完整路径。
@@ -32,9 +35,21 @@ python3 scripts/gen_image.py "戴上一顶红帽子" --edit input.png --mask mas
## 参数
`--size` `--n` `--quality` `--background transparent` `--edit`(可多次) `--mask` `--model` `--output`
`--size` `--n` `--quality` `--background transparent` `--style` `--edit`(可多次) `--mask` `--model` `--output`
详见 `python3 scripts/gen_image.py --help` 与 `SKILL.md`。
## 尺寸与风格
`--size` 支持直接传像素值,也支持别名:
| 规格 | 常用别名 |
|------|----------|
| 1K | `1k-square`、`1k-landscape`、`1k-portrait` |
| 2K | `2k-square`、`2k-landscape`、`2k-portrait`、`2k-wide`、`2k-tall` |
| 4K | `4k-square`、`4k-landscape`、`4k-portrait`、`4k-wide`、`4k-tall`、`4k-uhd`、`4k-uhd-portrait` |
风格优先写进 prompt;目标模型或中转明确支持独立风格字段时,可额外传 `--style natural`、`--style vivid`、`--style anime`、`--style photorealistic` 等。
## 安全
`.env` 与 `output/` 已在 `.gitignore` 中,不会提交。切勿把 API Key 写进代码或对话。