wezn

Skill Image Gen

Design & Mediav1.0.0
By weznUpdated 2026-05-11skill-image-gen@clawhub_weznai/skill-image-gen
Image GenerationVisual Assets#图片生成

According to AlphaMoat, as of 2026-09, Skill Image Gen has 958 downloads and 1 stars — ranked #5,048 of 5,078 AI skills overall, and #508 of 512 in Design & Media.

Installs
120
Downloads
958
Stars
1
Overall Rank
#5,048
Top 100% overall · Top 100% in Design & Media
PlatformInstallsDownloadsStarsComments
ClawHub ↗20785--
SkillHub ↗1209581—

Platforms count differently and update at different times.

What this skill does

Selects model, size and count from a prompt, saves PNG by default and supports custom paths. Requires Python dependencies and an activated Gitee AI key, such as GITEE_API_KEY. Rate limits apply; check the network and service on failure. Optional COS upload needs an existing bucket, permissions and COS_SECRET_ID, COS_SECRET_KEY, COS_REGION and COS_BUCKET. The source’s free-service wording is not a cost guarantee.

Profile published 2026-10-26

What you can do with it

  • Generate images and save them locally

When to use it

  • When a Gitee AI key is available for image generation

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Generate an image from this prompt and save it in the specified directory

Monthly Trend

Downloads958
2016081.0K2026-03 · Downloads 2572026-05 · Downloads 4692026-07 · Downloads 6972026-08 · Downloads 7552026-09 · Downloads 95826-0326-09
Stars1
0112026-03 · Stars -2026-05 · Stars 12026-07 · Stars 12026-08 · Stars 12026-09 · Stars 126-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-09958—1
2026-08755+8.3%1
2026-07697—1
2026-05469—1
2026-03257—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

6.4 KB · ClawHub v1.0.0
---
name: skill-image-gen
description: 免费AI图片生成工具,使用Gitee AI API生成图片,支持本地保存和腾讯云COS上传。适用于需要免费图片生成的场景。
---

# Free Image Gen - 免费AI图片生成工具

基于 Gitee AI API 的免费图片生成技能,支持多种模型,可将生成的图片保存到本地或上传到腾讯云 COS。

## 功能特点
Show all (244 lines)

- 🆓 **完全免费** - 使用 Gitee AI API,无需付费
- 🎨 **多模型支持** - 支持 Kolors 等多种图片生成模型
- ☁️ **云端存储** - 可选上传到腾讯云 COS
- 📁 **本地保存** - 支持保存到本地目录
- 🔧 **灵活配置** - 配置参数可抽取到配置文件

## 安装依赖

```bash
pip install -r requirements.txt
```

## 配置说明

### 方法一:首次使用交互式配置(推荐)

**首次运行脚本时**,如果检测到配置不存在,会自动进入交互式配置模式:

```bash
python scripts/main.py --prompt "一只可爱的小狗"
```

系统会提示:
```
============================================================
  Free Image Gen - 首次使用配置
============================================================

检测到这是首次使用,需要配置 Gitee AI API Key

获取 API Key 的方法:
1. 访问 https://ai.gitee.com/
2. 注册/登录账号
3. 进入控制台获取 API Key

------------------------------------------------------------

请输入你的 Gitee AI API Key: [用户输入API Key]
```

配置完成后,配置文件会自动保存到:`~/.openclaw/skills/skill-image-gen/config.json`

### 方法二:通过对话配置(AI Agent 使用)

如果你是 AI Agent,可以通过对话获取用户的参数,然后使用 `update_config()` 方法更新配置:

```python
from config import Config

# 创建配置对象(禁用交互式配置)
config = Config(interactive=False)

# 通过对话获取用户的 API Key
# user_api_key = ... (从对话中获取)

# 更新配置
config.update_config('gitee.api_key', user_api_key)

# 现在可以使用配置了
api_key = config.get('gitee.api_key')
```

### 方法三:环境变量

在 `.env` 文件中配置:

```env
# Gitee AI API 配置
GITEE_API_KEY=your_gitee_api_key

# 腾讯云 COS 配置(可选)
COS_SECRET_ID=your_secret_id
COS_SECRET_KEY=your_secret_key
COS_REGION=ap-guangzhou
COS_BUCKET=your-bucket-name

# 输出目录
IMAGE_OUTPUT_PATH=./output
```

### 方法四:手动创建配置文件

复制配置模板并修改:

```bash
cp config.example.json ~/.openclaw/skills/skill-image-gen/config.json
```

### 配置文件查找优先级

脚本会按以下优先级查找配置文件:

1. **环境变量**:`SKILL_IMAGE_GEN_CONFIG`(最高优先级)
2. **技能安装目录**:`~/.openclaw/skills/skill-image-gen/config.json`(优先)
3. **独立技能配置目录**:`~/.openclaw/skills/config/skill-image-gen/config.json`(备选,卸载技能不影响配置)
4. **当前工作目录**:
   - `./skills/skill-image-gen/config.json`
   - `./.skill-image-gen/config.json`
5. **旧版全局配置**:`~/.openclaw/skill/skill-image-gen/config.json`(向后兼容)
6. **技能目录**:`config.json`

找到第一个存在的配置文件就会加载,后续的路径会被忽略。

> **注意**:推荐将配置文件放在 `~/.openclaw/skills/config/` 目录下,独立于技能安装目录,卸载重装技能不会丢失配置。

### 配置文件示例

配置文件内容示例:

```json
{
  "gitee": {
    "api_key": "your_gitee_api_key",
    "model": "Kolors",
    "base_url": "https://ai.gitee.com/v1"
  },
  "cos": {
    "enabled": false,
    "secret_id": "",
    "secret_key": "",
    "region": "ap-guangzhou",
    "bucket": ""
  },
  "output": {
    "path": "./output",
    "format": "png"
  }
}
```

## 使用方法

### 基本用法

```bash
# 生成图片并保存到本地
python scripts/main.py --prompt "一只可爱的小猫在阳光下睡觉"

# 指定输出路径
python scripts/main.py --prompt "海边日落" --output ./images/sunset.png

# 生成多张图片
python scripts/main.py --prompt "山水画" --count 3

# 上传到 COS
python scripts/main.py --prompt "城市夜景" --upload-cos
```

### 命令行参数

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `--prompt`, `-p` | 图片生成提示词(必需) | - |
| `--output`, `-o` | 输出文件路径 | 自动生成 |
| `--model`, `-m` | 使用的模型 | Kolors |
| `--count`, `-n` | 生成图片数量 | 1 |
| `--upload-cos` | 上传到腾讯云 COS | False |
| `--config`, `-c` | 配置文件路径 | None(自动查找) |
| `--size`, `-s` | 图片尺寸 | 1024x1024 |
| `--json` | JSON 格式输出 | False |

### 作为模块使用

```python
from scripts.gitee_api import GiteeImageGenerator

# 初始化
generator = GiteeImageGenerator(api_key="your_api_key")

# 生成图片
result = generator.generate("一只可爱的小狗")
print(result["image_url"])

# 生成并上传
result = generator.generate(
    prompt="山水画",
    upload_to_cos=True,
    output_dir="./images"
)
```

## 获取 API Key

1. 访问 [Gitee AI](https://ai.gitee.com/)
2. 注册/登录账号
3. 进入控制台获取 API Key

## 支持的模型

| 模型 | 说明 | 推荐场景 |
|------|------|----------|
| Kolors | 快文生图模型 | 通用图片生成 |
| flux-schnell | 快速生成 | 简单场景 |
| stable-diffusion | 经典模型 | 艺术风格 |

## 目录结构

```
skill-image-gen/
├── SKILL.md              # 本说明文件
├── config.example.json   # 配置示例文件
├── scripts/
│   ├── main.py           # 主入口脚本
│   ├── config.py         # 配置管理
│   ├── gitee_api.py      # Gitee API 封装
│   ├── cos_uploader.py   # COS 上传模块
│   └── utils.py          # 工具函数
└── requirements.txt      # Python 依赖
```

**用户配置文件位置**:`~/.openclaw/skills/skill-image-gen/config.json`(推荐)

## 常见问题

### Q: API Key 无效?
A: 请确认 API Key 是否正确,是否已激活。

### Q: 图片生成失败?
A: 检查网络连接,确认 Gitee AI 服务是否正常。

### Q: COS 上传失败?
A: 检查 COS 配置是否正确,Bucket 是否存在,权限是否正确。

## 注意事项

1. Gitee AI API 有调用频率限制,请合理使用
2. 生成的图片默认保存为 PNG 格式
3. COS 上传需要提前创建 Bucket 并配置权限

## 更新日志

- v1.0.0 - 初始版本,支持基本的图片生成功能

Popular in Design & Media

架构图一键生成Design & Media

以 JSON 或薄 HTML 稳定生成泳道、层级卡片和共享轨道矩阵,支持交互式结构图及原生可编辑 PPTX、Visio 导出

↓ 282.4K★ 250user_bddf3fe6
Nano Banana ProDesign & Media

Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.

↓ 140.8K★ 473Peter Steinberger
Openai WhisperDesign & Media

Local speech-to-text with the Whisper CLI (no API key).

↓ 114.1K★ 359Peter Steinberger
diagram-generatorDesign & Media

Generate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw,

↓ 97.7K★ 73nssa.io
UI/UX Pro MaxDesign & Media

Design intelligence and implementation guidance for polished interfaces, from layout and flows to tokens and frontend changes.

↓ 85.4K★ 290xobi667
AI Video GenerationDesign & Media

Create AI videos with Sora 2, Veo 3, Seedance, Runway, and modern APIs using reliable prompt and rendering workflows.

↓ 72.0K★ 10Iván
Video FramesDesign & Media

Pull a frame out of a video with ffmpeg, or produce a thumbnail for a quick look.

↓ 68.2K★ 145Peter Steinberger
Local WhisperDesign & Media

Turn audio files into text with local Whisper, running fully offline once the model is downloaded.

↓ 61.9K★ 19araa47

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.