siliconflow-image-gen

TotalClaw 作者 totalclaw

使用 SiliconFlow API(FLUX.1、稳定扩散等)生成图像

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~lilei0311-siliconflow-image-gen
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~lilei0311-siliconflow-image-gen/file -o lilei0311-siliconflow-image-gen.md
# SiliconFlow Image Generation Skill

Generate images using SiliconFlow API with support for FLUX.1, Stable Diffusion, and more.

## Features

- 🎨 **Multiple Models**: FLUX.1-schnell (free), FLUX.1-dev, Stable Diffusion 3.5
- 🔑 **Auto API Key Detection**: Reads from environment or OpenClaw config
- 💾 **Auto Download**: Saves generated images locally
- 📱 **OpenClaw Ready**: Designed for OpenClaw Agent integration

## Requirements

- **Environment Variable**: `SILICONFLOW_API_KEY`
- **Optional Config File**: `~/.openclaw/openclaw.json` (for auto-detect)

## Installation

```bash
npx clawhub install siliconflow-image-gen
```

## Configuration

Set your SiliconFlow API key:

```bash
export SILICONFLOW_API_KEY="your-api-key"
```

Or configure in OpenClaw:

```json
{
  "models": {
    "providers": {
      "siliconflow": {
        "apiKey": "your-api-key"
      }
    }
  }
}
```

## Usage

### Command Line

```bash
# Generate with default model (FLUX.1-schnell)
python3 scripts/generate.py "A cup of coffee on wooden table"

# Specify model
python3 scripts/generate.py "Sunset over mountains" --model "black-forest-labs/FLUX.1-dev"

# Save to file
python3 scripts/generate.py "Cute cat" --output ~/Desktop/cat.png
```

## Available Models

| Model | Cost | Quality | Speed |
|-------|------|---------|-------|
| `black-forest-labs/FLUX.1-schnell` | Free | Good | Fast |
| `black-forest-labs/FLUX.1-dev` | Paid | Excellent | Medium |
| `stabilityai/stable-diffusion-3-5-large` | Paid | Excellent | Medium |

## Security Notes

- This skill requires an API key to call SiliconFlow services
- The script reads `~/.openclaw/openclaw.json` only to auto-detect API keys
- No sensitive data is transmitted except to `api.siliconflow.cn`
- Review the code at `scripts/generate.py` before providing credentials

## Author

MaxStorm Team

## License

MIT

---

## 中文说明

# SiliconFlow 图像生成技能

使用 SiliconFlow API 生成图像,支持 FLUX.1、Stable Diffusion 等模型。

## 功能特性

- 🎨 **多模型支持**:FLUX.1-schnell(免费)、FLUX.1-dev、Stable Diffusion 3.5
- 🔑 **自动检测 API 密钥**:从环境变量或 OpenClaw 配置中读取
- 💾 **自动下载**:在本地保存生成的图像
- 📱 **OpenClaw 就绪**:专为 OpenClaw Agent 集成而设计

## 要求

- **环境变量**:`SILICONFLOW_API_KEY`
- **可选配置文件**:`~/.openclaw/openclaw.json`(用于自动检测)

## 安装

```bash
npx clawhub install siliconflow-image-gen
```

## 配置

设置你的 SiliconFlow API 密钥:

```bash
export SILICONFLOW_API_KEY="your-api-key"
```

或在 OpenClaw 中配置:

```json
{
  "models": {
    "providers": {
      "siliconflow": {
        "apiKey": "your-api-key"
      }
    }
  }
}
```

## 用法

### 命令行

```bash
# Generate with default model (FLUX.1-schnell)
python3 scripts/generate.py "A cup of coffee on wooden table"

# Specify model
python3 scripts/generate.py "Sunset over mountains" --model "black-forest-labs/FLUX.1-dev"

# Save to file
python3 scripts/generate.py "Cute cat" --output ~/Desktop/cat.png
```

## 可用模型

| 模型 | 费用 | 质量 | 速度 |
|-------|------|---------|-------|
| `black-forest-labs/FLUX.1-schnell` | 免费 | 良好 | 快 |
| `black-forest-labs/FLUX.1-dev` | 付费 | 优秀 | 中等 |
| `stabilityai/stable-diffusion-3-5-large` | 付费 | 优秀 | 中等 |

## 安全注意事项

- 本技能需要 API 密钥才能调用 SiliconFlow 服务
- 脚本读取 `~/.openclaw/openclaw.json` 仅用于自动检测 API 密钥
- 除发往 `api.siliconflow.cn` 外,不传输任何敏感数据
- 在提供凭证前请先审查 `scripts/generate.py` 中的代码

## 作者

MaxStorm Team

## 许可证

MIT