openai-image-gen-siliconflow
Generate images via SiliconFlow API (OpenAI compatible). Uses Qwen/Qwen-Image model.
от wu-xiaochen★ 18 звёзд на GitHub
Установить openai-image-gen-siliconflow в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
OpenAI Image Gen (SiliconFlow)
使用 SiliconFlow API 生成图片,支持 Qwen/Qwen-Image 模型。
环境变量
export OPENAI_API_KEY="your-siliconflow-api-key"
# base URL 已默认配置
⚠️ 重要:Python 版本要求
必须用 python3.12+,不能用系统默认的 python3(macOS 默认是 3.9)
原因:gen.py 使用了 str | None 类型注解语法(Python 3.10+ 才支持),在 3.9 上会报错:
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'
已知问题(gen.py 已修复)
- 参数名:
Qwen/Qwen-Image模型用image_size而不是size - quality 参数:Qwen 模型不支持
quality参数 - 默认模型:gen.py 默认是
gpt-image-1(OpenAI),需显式指定--model "Qwen/Qwen-Image" - endpoint:
/images/generations(不是/image_generation)
使用方法
OPENAI_API_KEY="sk-..." python3.12 {baseDir}/gen.py \
--model "Qwen/Qwen-Image" \
--prompt "描述" \
--count 1 \
--out-dir /tmp/output
快速验证
import requests
api_key = "sk-..." # SiliconFlow key
r = requests.post(
"https://api.siliconflow.cn/v1/images/generations",
headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
json={"model": "Qwen/Qwen-Image", "prompt": "test", "image_size": "1024x1024", "n": 1}
)
print(r.json()) # 成功返回 {"images": [{"url": "..."}]}
参数
--model: 模型名称(必须填Qwen/Qwen-Image)--prompt: 图片描述--count: 生成数量--size/--image_size: 尺寸(Qwen 模型用 image_size)
自拍专用 prompt 模板(Clawra 用)
a beautiful Chinese woman, 28 years old, elegant makeup, stunning appearance,
taking a mirror selfie, wearing stylish outfit, realistic photo style, soft lighting
注意:Qwen-Image 模型生成的风格是"规矩流动"型,和 MiniMax 风格不同。人物一致性不如专业模型,但真实感较好。
测试成功的 key 配置(2026-04-09)
OPENAI_API_KEY=sk-cyfunmsszjrqumckweykgkjojjfbclilbbochdvprfezqgcw
SILICONFLOW_BASE_URL=https://api.siliconflow.cn/v1
踩坑记录
| 问题 | 原因 | 解决方案 |
|---|---|---|
401 Invalid token |
endpoint 路径写错 | 用 /images/generations 不是 /image_generation |
TypeError: unsupported operand |
Mac python3 是 3.9 | 必须用 python3.12 |
| 生成图片糊/不像 | prompt 没加 realistic photo style |
显式指定风格关键词 |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- gen.py
- tmp/latest.jpg
- tmp/openai-image-gen-2026-03-13-11-08-34/001-chinese-woman-taking-selfie-in-front-of-.png
- tmp/openai-image-gen-2026-03-13-11-08-34/index.html
- tmp/openai-image-gen-2026-03-13-11-08-34/prompts.json
- tmp/openai-image-gen-2026-03-14-09-49-02/001-chinese-woman-selfie-beautiful-face-eleg.png
- tmp/openai-image-gen-2026-03-14-09-49-02/index.html
- tmp/openai-image-gen-2026-03-14-09-49-02/prompts.json
- tmp/openai-image-gen-2026-03-18-16-06-36/001-a-stunning-chinese-woman-taking-a-selfie.png
- tmp/openai-image-gen-2026-03-18-16-06-36/index.html
- tmp/openai-image-gen-2026-03-18-16-06-36/prompts.json
- tmp/openai-image-gen-2026-03-24-09-15-06/001-chinese-woman-with-stunning-makeup-takin.png
- tmp/openai-image-gen-2026-03-24-09-15-06/index.html
- tmp/openai-image-gen-2026-03-24-09-15-06/prompts.json
- tmp/openai-image-gen-2026-03-26-09-39-38/001-chinese-woman-young-beautiful-k-pop-idol.png
- tmp/openai-image-gen-2026-03-26-09-39-38/index.html
- tmp/openai-image-gen-2026-03-26-09-39-38/prompts.json
- tmp/selfie.jpg
FAQ
Что делает скилл openai-image-gen-siliconflow?
Generate images via SiliconFlow API (OpenAI compatible). Uses Qwen/Qwen-Image model.
Как установить скилл openai-image-gen-siliconflow?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openai-image-gen-siliconflow запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…