Back to skills
SkillHub ClubAnalyze Data & AIFull StackBackendData / AI

gen-image

AI生成图片,支持Kolors/FLUX/Qwen-Image等模型(需SiliconFlow API)

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3,129
Hot score
99
Updated
March 20, 2026
Overall rating
C0.0
Composite score
0.0
Best-practice grade
B77.6

Install command

npx @skill-hub/cli install openclaw-skills-gen-image

Repository

openclaw/skills

Skill path: skills/duyiliu/gen-image

AI生成图片,支持Kolors/FLUX/Qwen-Image等模型(需SiliconFlow API)

Open repository

Best for

Primary workflow: Analyze Data & AI.

Technical facets: Full Stack, Backend, Data / AI.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: openclaw.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install gen-image into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/openclaw/skills before adding gen-image to shared team environments
  • Use gen-image for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: gen-image
description: AI生成图片,支持Kolors/FLUX/Qwen-Image等模型(需SiliconFlow API)
homepage: https://siliconflow.cn
metadata: {"openclaw":{"emoji":"🎨","requires":{"bins":["curl"],"env":["SILICONFLOW_API_KEY"]},"primaryEnv":"SILICONFLOW_API_KEY"}}
---

# AI 图片生成

使用 SiliconFlow API 调用 Kolors、FLUX、Qwen-Image 等模型生成图片。

## Generate Image

```bash
curl -X POST "https://api.siliconflow.cn/v1/images/generations" \
  -H "Authorization: Bearer $SILICONFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Kolors/Kolors",
    "prompt": "your image description",
    "image_size": "1024x1024",
    "num_inference_steps": 20
  }'
```

## Available Models

- `Kwai-Kolors/Kolors` - High quality image generation (正确ID)
- `black-forest-labs/FLUX.1-schnell` - Fast generation
- `black-forest-labs/FLUX.1-dev` - FLUX dev version
- `Qwen/Qwen-Image` - Qwen image generation

> 注意:模型ID可能更新,可通过 `curl -s "https://api.siliconflow.cn/v1/models" -H "Authorization: Bearer $SILICONFLOW_API_KEY" | jq '.data[].id'` 查询最新列表

## Parameters

- `prompt`: Image description (required)
- `image_size`: `1024x1024`, `1024x1792`, `1792x1024` (default: 1024x1024)
- `num_inference_steps`: 1-50 (default: 20)
- `negative_prompt`: Things to avoid (optional)
- `seed`: Random seed (optional)

## API Key

Get your API key from: https://cloud.siliconflow.cn

Set environment variable:
```bash
export SILICONFLOW_API_KEY="your-api-key"
```

Or configure in OpenClaw:
```json5
{
  skills: {
    entries: {
      "siliconflow-image": {
        enabled: true,
        env: {
          SILICONFLOW_API_KEY: "your-api-key"
        }
      }
    }
  }
}
```

---

## Skill Companion Files

> Additional files collected from the skill directory layout.

### _meta.json

```json
{
  "owner": "duyiliu",
  "slug": "gen-image",
  "displayName": "AI图片生成",
  "latest": {
    "version": "1.0.0",
    "publishedAt": 1772781653992,
    "commit": "https://github.com/openclaw/skills/commit/a831cfced16652bdcc2378750c7919d9d2e4f754"
  },
  "history": []
}

```

### scripts/generate.sh

```bash
#!/bin/bash
# Generate image via SiliconFlow API

API_KEY="${SILICONFLOW_API_KEY}"
MODEL="${MODEL:-Kolors/Kolors}"
PROMPT="$1"
OUTPUT="${2:-/tmp/siliconflow-image.png}"
SIZE="${SIZE:-1024x1024}"

if [ -z "$API_KEY" ]; then
    echo "Error: SILICONFLOW_API_KEY not set"
    exit 1
fi

if [ -z "$PROMPT" ]; then
    echo "Usage: $0 <prompt> [output_file]"
    exit 1
fi

echo "Generating image with $MODEL..."
echo "Prompt: $PROMPT"

RESPONSE=$(curl -s -X POST "https://api.siliconflow.cn/v1/images/generations" \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
        \"model\": \"$MODEL\",
        \"prompt\": \"$PROMPT\",
        \"image_size\": \"$SIZE\",
        \"num_inference_steps\": 20
    }")

# Check for error
if echo "$RESPONSE" | grep -q '"error"'; then
    echo "API Error: $(echo "$RESPONSE" | jq -r '.error.message // .error')"
    exit 1
fi

# Extract image URL
IMAGE_URL=$(echo "$RESPONSE" | jq -r '.images[0].url // empty')

if [ -z "$IMAGE_URL" ]; then
    echo "Error: No image URL in response"
    echo "$RESPONSE"
    exit 1
fi

echo "Downloading image from: $IMAGE_URL"
curl -s -o "$OUTPUT" "$IMAGE_URL"

if [ -f "$OUTPUT" ]; then
    echo "Image saved: $OUTPUT"
    echo "MEDIA: $OUTPUT"
else
    echo "Error: Failed to download image"
    exit 1
fi
```

gen-image | SkillHub