image-gen
4
总安装量
4
周安装量
#53959
全站排名
安装命令
npx skills add https://github.com/helincao/skilled --skill image-gen
Agent 安装分布
opencode
4
gemini-cli
4
claude-code
4
github-copilot
4
codex
4
kimi-cli
4
Skill 文档
Image Gen
Inputs
- Prompt intent (subject + style + constraints)
- Output path with extension (
.png,.jpg,.webp,.gif) - Optional aspect ratio (see
references/cli.md) - Optional iteration goal (what to change from previous output)
Preconditions
.envmust containGEMINI_API_KEY- Node.js runtime must support built-in
fetch(Node 18+)
Steps
- Gather missing requirements before generating:
- Usage context (hero, icon, background, poster, etc.)
- Visual constraints (no text, no logo, no watermark, negative space, etc.)
- Aspect ratio and output path
- If prompt quality is unclear, read
references/prompting.mdand construct a cleaner prompt. - If CLI flags/aspect options are unclear, read
references/cli.md. - Run generation from project root:
node "$SKILL_DIR/scripts/image-gen/generate.mjs" "<prompt>" -a <aspect-ratio> -o <output-path>SKILL_DIRis the directory containing thisSKILL.md. - Confirm the output file exists and is non-empty.
- If the user asks for iteration, keep output path versioned (for example
hero-v2.png) unless overwrite is requested.
Troubleshooting
.envnot found: put.envin your current directory or any parent directory (repo root is fine).GEMINI_API_KEYmissing: setGEMINI_API_KEY=...in.env(never paste secrets into issues, logs, or docs).fetchis not defined: run with Node.js 18+ (the CLI relies on built-infetch).- API request failed: include the HTTP status + error body in the report; likely an invalid key, quota/rate limit, or model/API change.
- Output path errors: ensure the destination directory exists (the CLI doesnât create directories).
Output
- Generated image file at requested path
- Command used (prompt + flags) so the result is reproducible
- Optional iteration suggestions if user requests refinement