image-model-evaluation
评估图像生成模型的效果。对指定模型进行全面的文生图、图生图测试,包括不同参数、不同提示词、人物一致性等测试项,生成详细的HTML测试报告。当用户想要测试、评估、对比图像模型效果时使用此 skill。
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install openclaw-skills-image-model-evaluation
Repository
Skill path: skills/hexiaochun/image-model-evaluation
评估图像生成模型的效果。对指定模型进行全面的文生图、图生图测试,包括不同参数、不同提示词、人物一致性等测试项,生成详细的HTML测试报告。当用户想要测试、评估、对比图像模型效果时使用此 skill。
Open repositoryBest for
Primary workflow: Analyze Data & AI.
Technical facets: Full Stack, 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 image-model-evaluation into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding image-model-evaluation to shared team environments
- Use image-model-evaluation for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: image-model-evaluation
description: 评估图像生成模型的效果。对指定模型进行全面的文生图、图生图测试,包括不同参数、不同提示词、人物一致性等测试项,生成详细的HTML测试报告。当用户想要测试、评估、对比图像模型效果时使用此 skill。
---
# 图像模型效果评估
对图像生成模型进行全面的效果评估,包括文生图、图生图、人物一致性等多维度测试。
## 工作流
### 1. 分析用户需求
获取用户想要评估的模型和测试范围:
- 目标模型名称
- 测试类型(完整测试/快速测试)
- 特定测试场景(可选)
### 2. 验证模型
1. 检查模型是否在支持列表中
2. 如不支持,提示用户选择可用模型
3. 确认模型功能特性(文生图/图生图支持)
> **参考文档**:支持的模型列表见 [references/models.md](references/models.md)
### 3. 制定测试计划
根据测试类型选择测试方案:
| 测试类型 | 测试项数 | 预计耗时 | 适用场景 |
|---------|---------|---------|---------|
| 快速测试 | 10 项 | 3-5 分钟 | 快速验证模型能力 |
| 完整测试 | 31 项 | 15-20 分钟 | 全面评估模型效果 |
使用 AskQuestion 让用户确认测试计划:
```
即将对 jimeng-4.5 进行快速测试:
测试项目:
- 文生图 5 项(尺寸+风格)
- 图生图 5 项(编辑+转换)
预估费用:约 0.18 元
是否开始测试?
```
> **参考文档**:完整测试用例见 [references/test-cases.md](references/test-cases.md)
> **参考文档**:快速测试方案见 [references/quick-test.md](references/quick-test.md)
### 4. 执行文生图测试
按类型分组执行测试:
#### 4.1 尺寸测试
验证模型对不同画幅比例的支持(16:9、9:16、1:1、4:3)
#### 4.2 风格测试
验证模型对不同艺术风格的理解(写实、动漫、油画、水彩、3D)
#### 4.3 复杂场景测试
验证模型处理复杂需求的能力(多人、动态、文字生成)
### 5. 执行人物一致性测试(核心测试)
先生成一张高质量的**全身人物基准图**(清晰面部、简单背景、自然站姿),然后进行一致性测试:
#### 5.1 场景+姿态大幅变化测试
**重点**:不是简单的背景替换,而是测试人物在完全不同的场景和姿态下能否保持特征一致
| 测试类型 | 示例 |
|----------|------|
| 动态姿态 | 站立 → 奔跑、跳跃、游泳 |
| 静态姿态 | 站立 → 坐着、躺着、蹲着 |
| 场景切换 | 室内 → 海滩/雪山/健身房/舞台 |
| 视角变化 | 正面 → 侧面、背面、俯视 |
| 服装变化 | 休闲装 → 正装/运动装/泳装/冬装 |
#### 5.2 评估人物一致性
对每个测试结果评估:
- 面部特征保持度(眼睛、鼻子、嘴巴、脸型)
- 体型比例一致性
- 发型发色一致性
- 整体辨识度(能否一眼认出是同一人)
#### 5.3 风格转换测试(可选)
测试将照片转换为不同艺术风格的能力
> **参考文档**:API 调用方式见 [references/api-usage.md](references/api-usage.md)
### 6. 收集测试结果
每个测试任务记录:
- 模型名称
- 测试类型(文生图/图生图)
- 输入参数(提示词、原图等)
- 生成耗时
- 输出图片 URL
- 质量评分
### 7. 生成 HTML 报告
使用模板生成精美的测试报告。
> **模板文件**:[assets/report-template.html](assets/report-template.html)
报告结构:
1. **测试概览** - 模型信息、测试总数、成功率、费用
2. **文生图结果** - 按测试类型分组展示
3. **图生图结果** - 原图与编辑结果对比
4. **人物一致性分析** - 多场景对比
5. **测试结论** - 优缺点总结
### 8. 输出文件
生成以下文件到 `{output_dir}/{model_name}_evaluation/` 目录:
```
{output_dir}/{model_name}_evaluation/
├── index.html # 测试报告(浏览器打开)
├── t2i_*.json # 文生图结果数据
├── i2i_*.json # 图生图结果数据
└── summary.json # 测试摘要
```
**默认输出目录**:当前工作目录下的 `evaluation_output/`
## 完整示例
### 用户请求
> 帮我测试一下 jimeng-4.5 模型的效果
### 执行步骤
**1. 验证模型** → jimeng-4.5 在支持列表中,支持文生图和图生图
**2. 确认测试计划** → 用户选择快速测试(10项)
**3. 执行文生图测试** → 并行执行 5 个测试
**4. 生成基准人物图** → 作为图生图的输入
**5. 执行图生图测试** → 并行执行 5 个编辑测试
**6. 生成报告** → 填充模板,输出 HTML
**7. 输出结果**
```
jimeng-4.5 模型评估完成!
📊 测试概览:
- 测试总数:10 项
- 成功率:100%
- 平均耗时:8.5 秒
- 总费用:0.18 元
📁 输出文件:
- evaluation_output/jimeng-4.5_evaluation/index.html
💡 提示:在浏览器中打开 index.html 查看详细报告
```
## 注意事项
1. **并行限制**:同时最多发起 4 个请求
2. **超时处理**:单个请求最长等待 120 秒
3. **错误重试**:失败的测试可选择重试
4. **费用预估**:执行前提示预计费用
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### references/models.md
```markdown
# 支持的图像模型列表
## Fal.ai 模型(MCP 调用)
通过 `user-速推AI` MCP 服务调用。
### 图像生成模型
| 模型 ID | 分辨率 | 价格 | 特点 |
|---------|--------|------|------|
| `fal-ai/flux-2/flash` | 1024px | 50积分 | Flux 2 最新版,极速(1秒),文字渲染强,支持图像编辑 |
| `fal-ai/flux/schnell` | 1024px | 20积分 | Flux 1 快速版,性价比高 |
| `fal-ai/flux/dev` | 1024px | 50积分 | Flux 1 开发版,质量更高 |
| `fal-ai/seedream-3.0` | 2K | 50积分 | 字节跳动,中文理解强 |
### 模型功能对比
| 模型 | 文生图 | 图像编辑 | 人物一致性 | 文字生成 | 速度 |
|------|--------|----------|------------|----------|------|
| flux-2/flash | ✅ | ✅ 原生支持 | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | 极快 (1s) |
| flux/schnell | ✅ | ❌ | - | ⭐⭐⭐ | 快 (2s) |
| flux/dev | ✅ | ❌ | - | ⭐⭐⭐⭐ | 中 (5s) |
| seedream-3.0 | ✅ | ✅ | ⭐⭐⭐⭐ | ⭐⭐⭐ | 中 (8s) |
---
## 小北 API (api.xbyjs.top)
通过 HTTP API 调用。
### 图像生成模型
| 模型 | 分辨率 | 价格 | 特点 |
|------|--------|------|------|
| `jimeng-4.5` | 2K | 0.018元 | 中文最强,推荐 |
| `jimeng-4.1` | 2K | 0.018元 | 质量稳定 |
| `jimeng-4.0` | 2K | 0.018元 | 基础版本 |
| `jimeng-4.5-4k` | 4K | 0.048元 | 高清版本 |
| `nano-banana` | 1K | 0.018元 | Google 一代,性价比高 |
| `nano-banana-pro-1k` | 1K | 0.03元 | Google 二代 |
| `nano-banana-pro-2k` | 2K | 0.054元 | Google 二代,推荐 |
| `nano-banana-pro-4k` | 4K | 0.072元 | Google 二代,最高清 |
| `grok-imagine-0.9` | - | 0.018元 | Grok 多模态 |
### 模型功能对比
| 模型系列 | 文生图 | 图生图 | 多图输出 | 比例控制 | 人物一致性 |
|---------|--------|--------|---------|---------|------------|
| jimeng-4.x | ✅ | ✅ | ✅ (4张) | ✅ | ⭐⭐⭐⭐ |
| nano-banana | ✅ | ✅ | ✅ (4张) | ✅ | ⭐⭐⭐ |
| nano-banana-pro | ✅ | ✅ | ✅ (4张) | ✅ | ⭐⭐⭐⭐ |
| grok-imagine | ✅ | ✅ | ✅ | ✅ | ⭐⭐⭐ |
### 推荐测试模型
**经济测试**:
- `nano-banana` - 0.018元/次,性价比最高
**质量测试**:
- `jimeng-4.5` - 中文理解最好,效果稳定
- `nano-banana-pro-2k` - Google 最新技术
**高清测试**:
- `jimeng-4.5-4k` - 4K分辨率
- `nano-banana-pro-4k` - 4K分辨率
## 验证模型可用性
调用 API 获取模型信息:
```bash
curl -s https://api.xbyjs.top/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
```
## 已知问题
| 模型 | 问题 |
|------|------|
| `jimeng-4.5-4k` | 部分时段无可用渠道 |
| `nano-banana-pro-1k` | 偶尔超时 |
| `nano-banana-pro-4k` | 部分时段无可用渠道 |
```
### references/test-cases.md
```markdown
# 测试用例详细说明
## 文生图测试用例
### 1. 尺寸测试
| ID | 名称 | 比例 | 提示词 | 评估要点 |
|----|------|------|--------|---------|
| S1 | 横版风景 | 16:9 | 壮丽的雪山风景,云雾缭绕,金色阳光,摄影作品 | 构图是否符合比例,边缘是否清晰 |
| S2 | 竖版人像 | 9:16 | 优雅的年轻女子肖像,侧面,柔和的自然光,专业摄影 | 人物比例是否正确,面部细节 |
| S3 | 方形构图 | 1:1 | 精致的咖啡拉花艺术,木质桌面,暖色调,美食摄影 | 主体居中,细节表现 |
| S4 | 标准比例 | 4:3 | 中国水墨山水画,远山近水,小舟渔翁,意境悠远 | 艺术风格把握,意境表现 |
### 2. 风格测试
| ID | 名称 | 风格 | 提示词 | 评估要点 |
|----|------|------|--------|---------|
| ST1 | 写实摄影 | 摄影 | 一只金毛犬在草地上奔跑,阳光明媚,摄影作品,高清细节 | 真实感,光影表现 |
| ST2 | 日系动漫 | 动漫 | 樱花树下的少女,日系动漫风格,精致细腻,Makoto Shinkai风格 | 动漫特征,细节精致度 |
| ST3 | 油画风格 | 艺术 | 梵高风格的星空夜景,漩涡笔触,油画质感,厚涂 | 笔触表现,风格还原度 |
| ST4 | 水彩风格 | 艺术 | 江南水乡,水彩画风格,清新淡雅,留白意境 | 水彩透明感,意境 |
| ST5 | 3D渲染 | 3D | 未来科技城市,赛博朋克风格,3D渲染,霓虹灯光 | 立体感,光效表现 |
| ST6 | 像素艺术 | 像素 | 复古游戏场景,像素艺术风格,16位色彩 | 像素风格准确度 |
### 3. 复杂场景测试
| ID | 名称 | 难度 | 提示词 | 评估要点 |
|----|------|------|--------|---------|
| C1 | 多人场景 | 高 | 三个朋友在咖啡厅聊天,每人表情不同,温馨氛围 | 多人物处理,表情差异 |
| C2 | 动态场景 | 高 | 运动员跳跃投篮的瞬间,动感模糊,体育摄影 | 动态捕捉,姿态合理性 |
| C3 | 文字生成 | 高 | 咖啡店招牌,上面清晰写着"Coffee Time",复古风格 | 文字清晰度,拼写正确性 |
| C4 | 复杂构图 | 高 | 俯视角度的城市十字路口,行人车辆,下午时分 | 透视关系,元素布局 |
| C5 | 手部细节 | 高 | 钢琴家的双手在演奏,特写镜头,优雅姿态 | 手指数量,姿态自然度 |
## 图生图测试用例
### 基准图生成
首先生成一张高质量的人物基准图:
```
提示词:一位年轻的亚洲女性,长发,自然微笑,穿着白色衬衫,
室内自然光,半身像,专业人像摄影,高清细节,16:9
```
### 1. 基础编辑测试
| ID | 名称 | 编辑指令 | 评估要点 |
|----|------|---------|---------|
| E1 | 背景替换 | 把背景改成海边日落,保持人物不变 | 人物边缘自然,背景融合度 |
| E2 | 服装更换 | 把白色衬衫改成红色礼服 | 衣服贴合度,阴影正确性 |
| E3 | 表情调整 | 让人物露出开心的大笑表情 | 表情自然度,面部特征保持 |
| E4 | 配饰添加 | 给人物戴上时尚的太阳镜 | 配饰位置,大小比例 |
| E5 | 发型修改 | 把长发改成短发造型 | 发型自然度,脸型适配 |
| E6 | 光线调整 | 添加金色的逆光效果 | 光影一致性,氛围感 |
### 2. 人物一致性测试(核心测试)
**测试目标**:验证模型在大幅度改变场景和姿态时,能否保持人物核心特征一致。
**基准图要求**:
- 全身像,清晰面部,简单背景,自然站立姿态
使用基准图,测试同一人物在不同场景、不同姿态下的一致性:
| ID | 场景变化 | 姿态变化 | 编辑指令 | 评估重点 |
|----|----------|----------|----------|----------|
| P1 | 室内→海滩 | 站立→奔跑 | Transform to running on beach, waves splashing, joyful expression, same person | 动态姿态下面部保持 |
| P2 | 户外→咖啡厅 | 站立→坐着 | Place sitting in cafe reading book, relaxed pose, warm lighting, same person | 坐姿体型比例 |
| P3 | 城市→雪山 | 静止→徒步 | Hiking in snowy mountains, winter gear, walking with backpack, same person | 厚重服装下身形保持 |
| P4 | 休闲→健身房 | 放松→运动 | Doing yoga stretch in modern gym, athletic wear, flexible pose, same person | 运动姿态下面部保持 |
| P5 | 日常→舞台 | 休闲→演讲 | Giving speech on stage, formal suit, confident gesture, same person | 正装下整体气质 |
| P6 | 白天→夜晚 | 正面→侧面 | Walking on city street at night, neon lights, profile view, same person | 侧面角度特征保持 |
| P7 | 室内→游泳池 | 穿衣→泳装 | Swimming in pool, underwater shot, dynamic pose, same person | 大幅换装下身形保持 |
**一致性评分标准**:
| 评分 | 百分比 | 判断依据 |
|------|--------|----------|
| 完全一致 | 90-100% | 一眼认出是同一人,面部、体型、发型全部吻合 |
| 高度相似 | 70-89% | 仔细看能认出,面部相似但细节有微调 |
| 部分相似 | 50-69% | 勉强能认出,部分特征保持,有明显变化 |
| 不一致 | 0-49% | 无法认出是同一人,核心特征丢失 |
### 3. 风格转换测试
| ID | 名称 | 编辑指令 | 评估要点 |
|----|------|---------|---------|
| T1 | 卡通化 | 转换成皮克斯3D动画风格 | 特征保持,风格统一 |
| T2 | 油画化 | 转换成古典油画风格,伦勃朗光效 | 艺术感,细节保持 |
| T3 | 素描化 | 转换成铅笔素描风格,黑白 | 线条表现,明暗层次 |
| T4 | 水彩化 | 转换成水彩画风格,柔和色调 | 透明感,特征保持 |
| T5 | 漫画化 | 转换成日系漫画风格 | 漫画特征,表情保持 |
## 评分标准
### 图片质量评分 (1-5分)
| 分数 | 说明 |
|------|------|
| 5 | 完美,无明显问题,商用级别 |
| 4 | 很好,细微瑕疵,可直接使用 |
| 3 | 一般,有明显问题但可接受 |
| 2 | 较差,问题较多,需要修改 |
| 1 | 失败,严重问题,无法使用 |
### 一致性评分 (百分比)
| 百分比 | 说明 |
|--------|------|
| 90-100% | 高度一致,几乎无变化 |
| 70-89% | 基本一致,细节有变化 |
| 50-69% | 部分一致,明显变化 |
| 0-49% | 不一致,人物特征丢失 |
## 测试执行顺序
1. 尺寸测试 (4项) - 验证基本功能
2. 风格测试 (6项) - 验证风格理解
3. 复杂场景测试 (5项) - 验证高级能力
4. 生成基准人物图
5. 基础编辑测试 (6项)
6. 人物一致性测试 (5项)
7. 风格转换测试 (5项)
**总计**: 31 项测试
```
### references/quick-test.md
```markdown
# 快速测试方案
当需要快速评估模型时,使用此精简测试方案。
## 精简测试项 (10项)
### 文生图 (5项)
| 测试 | 提示词 | 评估要点 |
|------|--------|----------|
| 横版16:9 | 壮丽的雪山风景,云雾缭绕,金色阳光 | 构图比例、细节质量 |
| 竖版9:16 | 优雅的年轻女子全身像,站立姿态,自然光,专业摄影 | 人物比例、面部细节 |
| 文字生成 | 咖啡店招牌,上面写着"COFFEE TIME",复古风格 | 文字清晰度、拼写正确 |
| 油画风格 | 梵高风格的星空夜景,漩涡笔触,油画质感 | 风格还原度 |
| 多人场景 | 三个朋友在咖啡厅聊天,每人表情不同 | 多人物处理、表情差异 |
### 人物一致性测试 (5项)
**核心测试目标**:测试模型能否在大幅度改变场景、姿态的同时保持人物特征一致。
先用竖版全身人像作为基准图(需要清晰的面部特征),然后测试:
| 测试 | 场景变化 | 姿态变化 | 编辑指令 |
|------|----------|----------|----------|
| 海边奔跑 | 室内→海滩 | 站立→奔跑 | Transform this person to be running joyfully on a sunny beach, waves splashing, dynamic action pose, same person same face |
| 咖啡厅阅读 | 室外→室内 | 站立→坐着 | Place this person sitting in a cozy cafe, reading a book, relaxed pose, warm lighting, same person same face |
| 雪山徒步 | 城市→雪山 | 静止→行走 | Transform this person hiking in snowy mountains, wearing winter gear, walking pose with backpack, same person same face |
| 健身运动 | 日常→健身房 | 休闲→运动 | Show this person doing yoga in a modern gym, stretching pose, athletic wear, same person same face |
| 正装演讲 | 休闲→正式 | 放松→演讲 | Transform this person giving a speech on stage, wearing formal business suit, confident gesture, same person same face |
**评估标准**:
- 面部特征保持度(眼睛、鼻子、脸型)
- 体型比例一致性
- 发型发色一致性
- 整体辨识度(是否还能认出是同一人)
## 预估费用
| 模型 | 单价 | 快速测试费用 |
|------|------|-------------|
| nano-banana | 0.018元 | 0.18元 |
| jimeng-4.5 | 0.018元 | 0.18元 |
| nano-banana-pro-2k | 0.054元 | 0.54元 |
| fal-ai/flux-2/flash | 50积分 | 500积分 |
## 快速测试流程
```
1. 并行执行 5 个文生图测试
↓
2. 选择全身人像作为基准图(确保面部清晰)
↓
3. 并行执行 5 个人物一致性测试(大幅度场景+姿态变化)
↓
4. 生成测试报告(含一致性评分)
```
预计耗时:3-5 分钟
## 人物一致性评分标准
| 评分 | 说明 | 判断依据 |
|------|------|----------|
| 优秀 (90-100%) | 完全认出是同一人 | 面部、体型、发型全部一致 |
| 良好 (70-89%) | 基本认出是同一人 | 面部相似,细节有变化 |
| 一般 (50-69%) | 勉强认出是同一人 | 部分特征保持,明显变化 |
| 较差 (0-49%) | 无法认出是同一人 | 人物特征丢失 |
## 基准图要求
为了更好测试人物一致性,基准图应满足:
- **全身像**:方便测试不同姿态
- **清晰面部**:五官清晰可辨
- **简单背景**:避免复杂背景干扰
- **自然姿态**:站立或轻松姿态
```
### references/api-usage.md
```markdown
# API 调用方式
本 skill 支持两种 API 调用方式,根据模型类型自动选择。
---
## 方式一:MCP 调用(Fal.ai 模型)
适用于 `fal-ai/*` 开头的模型,通过 `user-速推AI` MCP 服务调用。
### 文生图
使用 `submit_task` 工具:
```json
{
"model_id": "fal-ai/flux-2/flash",
"parameters": {
"prompt": "A young woman standing in a garden, full body shot, clear face, simple background",
"image_size": "portrait_16_9",
"num_images": 1
}
}
```
### 图像编辑(人物一致性测试)
```json
{
"model_id": "fal-ai/flux-2/flash",
"parameters": {
"prompt": "Transform this person to be running on a sunny beach, waves splashing, joyful expression, same person same face",
"image_urls": ["https://example.com/base_portrait.png"]
}
}
```
### 查询结果
使用 `get_task` 工具:
```json
{
"task_id": "返回的任务ID"
}
```
### image_size 可选值
| 值 | 尺寸 | 用途 |
|----|------|------|
| `portrait_16_9` | 576x1024 | 竖版人像(推荐基准图) |
| `portrait_4_3` | 768x1024 | 竖版标准 |
| `landscape_16_9` | 1024x576 | 横版风景 |
| `landscape_4_3` | 1024x768 | 横版标准 |
| `square_hd` | 1024x1024 | 高清正方形 |
| `square` | 512x512 | 标准正方形 |
---
## 方式二:HTTP API(小北 API 模型)
适用于 `jimeng-*`、`nano-banana*`、`grok-*` 等模型。
### 接口地址
- **Base URL**: `https://api.xbyjs.top`
- **端点**: `/v1/chat/completions`
## 文生图调用
### 请求格式
```json
{
"model": "模型名称",
"messages": [{
"role": "user",
"content": "提示词,比例如16:9"
}]
}
```
### cURL 示例
```bash
curl -s https://api.xbyjs.top/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "jimeng-4.5",
"messages": [{
"role": "user",
"content": "一只可爱的金毛犬在草地上奔跑,阳光明媚,16:9"
}]
}'
```
### 响应格式
```json
{
"id": "chatcmpl-xxx",
"model": "jimeng-4.5",
"choices": [{
"message": {
"role": "assistant",
"content": "\n"
}
}],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 100,
"total_tokens": 120
}
}
```
## 图生图调用
### 请求格式
```json
{
"model": "模型名称",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "编辑指令"},
{"type": "image_url", "image_url": {"url": "原图URL"}}
]
}]
}
```
### cURL 示例
```bash
curl -s https://api.xbyjs.top/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "jimeng-4.5",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "把背景改成海边日落"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}'
```
## 比例参数说明
在提示词末尾添加比例参数来控制输出尺寸:
| 比例 | 用途 | 示例 |
|------|------|------|
| 16:9 | 横版风景、封面 | `xxx,16:9` |
| 9:16 | 竖版人像、手机壁纸 | `xxx,9:16` |
| 1:1 | 方形、头像、产品图 | `xxx,1:1` |
| 4:3 | 标准比例 | `xxx,4:3` |
| 3:4 | 竖版标准 | `xxx,3:4` |
## 错误处理
### 常见错误码
| 状态码 | 错误 | 处理方式 |
|--------|------|---------|
| 400 | 请求参数错误 | 检查请求格式 |
| 401 | 认证失败 | 检查 API Key |
| 429 | 请求过于频繁 | 降低请求频率 |
| 500 | 服务器错误 | 重试或更换模型 |
| 503 | 服务不可用 | 当前模型无可用渠道 |
### 超时处理
- 默认超时:120 秒
- 建议:对于高清模型(4K),适当增加超时时间
## Python 调用示例
```python
import requests
import json
def generate_image(model: str, prompt: str, api_key: str) -> dict:
"""文生图"""
response = requests.post(
"https://api.xbyjs.top/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
},
json={
"model": model,
"messages": [{"role": "user", "content": prompt}]
},
timeout=120
)
return response.json()
def edit_image(model: str, instruction: str, image_url: str, api_key: str) -> dict:
"""图生图"""
response = requests.post(
"https://api.xbyjs.top/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
},
json={
"model": model,
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": instruction},
{"type": "image_url", "image_url": {"url": image_url}}
]
}]
},
timeout=120
)
return response.json()
```
## 解析图片 URL
响应中的图片以 Markdown 格式返回,需要解析提取:
```python
import re
def extract_image_urls(content: str) -> list:
"""从响应内容中提取图片 URL"""
pattern = r'!\[.*?\]\((https?://[^\)]+)\)'
return re.findall(pattern, content)
# 使用示例
content = response['choices'][0]['message']['content']
urls = extract_image_urls(content)
print(f"生成了 {len(urls)} 张图片")
```
```
### assets/report-template.html
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{MODEL_NAME}} 效果评估报告</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
min-height: 100vh;
color: #fff;
padding: 40px 20px;
}
.container { max-width: 1400px; margin: 0 auto; }
/* 标题样式 */
h1 {
text-align: center;
font-size: 2.5rem;
margin-bottom: 10px;
background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.subtitle { text-align: center; color: #a0a0a0; margin-bottom: 40px; }
h2 {
color: #667eea;
margin: 30px 0 20px;
padding-bottom: 10px;
border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}
h3 { color: #f093fb; margin: 20px 0 15px; }
/* 概览卡片 */
.summary-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 20px;
margin-bottom: 40px;
}
.summary-card {
background: rgba(255,255,255,0.08);
border-radius: 12px;
padding: 20px;
text-align: center;
border: 1px solid rgba(255,255,255,0.1);
}
.summary-card .label { color: #a0a0a0; font-size: 0.9rem; margin-bottom: 8px; }
.summary-card .value { font-size: 2rem; font-weight: bold; color: #667eea; }
.summary-card .value.success { color: #22c55e; }
.summary-card .value.warning { color: #f59e0b; }
/* 测试分类 */
.test-section {
background: rgba(255,255,255,0.05);
border-radius: 16px;
padding: 25px;
margin-bottom: 30px;
border: 1px solid rgba(255,255,255,0.1);
}
/* 图片网格 */
.image-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 20px;
}
.image-card {
background: rgba(255,255,255,0.06);
border-radius: 12px;
overflow: hidden;
border: 1px solid rgba(255,255,255,0.1);
}
.image-card-header {
padding: 12px 15px;
background: rgba(102, 126, 234, 0.15);
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.image-card-header h4 { font-size: 0.95rem; margin-bottom: 5px; }
.image-card-body { padding: 12px; }
.image-card img {
width: 100%;
border-radius: 8px;
margin-bottom: 8px;
}
.prompt-text {
background: rgba(0,0,0,0.3);
padding: 10px;
border-radius: 6px;
font-size: 0.85rem;
color: #e0e0e0;
}
/* 徽章 */
.badge {
display: inline-block;
padding: 3px 10px;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 600;
margin-right: 5px;
}
.badge-success { background: rgba(34, 197, 94, 0.3); color: #22c55e; }
.badge-warning { background: rgba(245, 158, 11, 0.3); color: #f59e0b; }
.badge-error { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
.badge-info { background: rgba(102, 126, 234, 0.3); color: #667eea; }
.badge-time { background: rgba(248, 181, 0, 0.3); color: #f8b500; }
/* 图生图对比 */
.i2i-card {
background: rgba(255,255,255,0.06);
border-radius: 12px;
overflow: hidden;
margin-bottom: 20px;
border: 1px solid rgba(255,255,255,0.1);
}
.i2i-card-header {
padding: 15px 20px;
background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.15));
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.i2i-card-body {
padding: 20px;
display: grid;
grid-template-columns: 180px 40px 1fr;
gap: 20px;
align-items: center;
}
.i2i-source { text-align: center; }
.i2i-source img { width: 100%; border-radius: 8px; }
.i2i-source .label { margin-top: 8px; color: #a0a0a0; font-size: 0.8rem; }
.i2i-arrow { font-size: 1.8rem; color: #667eea; text-align: center; }
.i2i-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.i2i-results img { width: 100%; border-radius: 6px; }
/* 基准图展示 */
.base-image-container {
display: flex;
justify-content: center;
padding: 20px;
}
.base-image-container img {
max-height: 400px;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
/* 一致性对比卡片 */
.consistency-card {
background: rgba(255,255,255,0.06);
border-radius: 12px;
overflow: hidden;
margin-bottom: 20px;
border: 1px solid rgba(255,255,255,0.1);
}
.consistency-card-header {
padding: 15px 20px;
background: linear-gradient(90deg, rgba(240, 147, 251, 0.2), rgba(102, 126, 234, 0.15));
border-bottom: 1px solid rgba(255,255,255,0.1);
display: flex;
justify-content: space-between;
align-items: center;
}
.consistency-card-header h4 { margin: 0; }
.consistency-card-body {
padding: 20px;
display: grid;
grid-template-columns: 160px 40px 1fr;
gap: 20px;
align-items: start;
}
.consistency-source { text-align: center; }
.consistency-source img { width: 100%; border-radius: 8px; }
.consistency-source .label { margin-top: 8px; color: #a0a0a0; font-size: 0.75rem; }
.consistency-arrow { font-size: 1.5rem; color: #f093fb; text-align: center; padding-top: 60px; }
.consistency-result { }
.consistency-result img { max-width: 300px; border-radius: 8px; margin-bottom: 10px; }
.consistency-result .changes {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 10px;
}
.consistency-result .change-tag {
background: rgba(102, 126, 234, 0.2);
color: #a0c4ff;
padding: 4px 10px;
border-radius: 6px;
font-size: 0.75rem;
}
.consistency-result .prompt-text {
font-size: 0.8rem;
}
/* 一致性评分 */
.score-badge {
padding: 5px 12px;
border-radius: 8px;
font-weight: 600;
font-size: 0.85rem;
}
.score-excellent { background: rgba(34, 197, 94, 0.3); color: #22c55e; }
.score-good { background: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.score-fair { background: rgba(245, 158, 11, 0.3); color: #f59e0b; }
.score-poor { background: rgba(239, 68, 68, 0.3); color: #ef4444; }
/* 评分总结 */
.score-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
}
.score-item {
background: rgba(255,255,255,0.06);
border-radius: 10px;
padding: 15px;
text-align: center;
}
.score-item .test-name { color: #a0a0a0; font-size: 0.85rem; margin-bottom: 8px; }
.score-item .score-value { font-size: 1.5rem; font-weight: bold; }
/* 结论部分 */
.conclusion {
background: rgba(255,255,255,0.08);
border-radius: 16px;
padding: 25px;
margin-top: 40px;
}
.pros-cons {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin-top: 20px;
}
.pros { background: rgba(34, 197, 94, 0.1); border-left: 4px solid #22c55e; }
.cons { background: rgba(239, 68, 68, 0.1); border-left: 4px solid #ef4444; }
.pros, .cons {
padding: 20px;
border-radius: 0 10px 10px 0;
}
.pros h4 { color: #22c55e; margin-bottom: 15px; }
.cons h4 { color: #ef4444; margin-bottom: 15px; }
.pros ul, .cons ul { margin-left: 20px; line-height: 1.8; }
/* 页脚 */
.footer {
text-align: center;
margin-top: 50px;
color: #666;
font-size: 0.9rem;
}
/* 响应式 */
@media (max-width: 768px) {
.i2i-card-body { grid-template-columns: 1fr; }
.i2i-arrow { transform: rotate(90deg); }
.pros-cons { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="container">
<h1>{{MODEL_NAME}} 效果评估报告</h1>
<p class="subtitle">{{TEST_DATE}} | 小北 API (api.xbyjs.top)</p>
<!-- 测试概览 -->
<div class="summary-grid">
<div class="summary-card">
<div class="label">测试模型</div>
<div class="value" style="font-size: 1rem;">{{MODEL_NAME}}</div>
</div>
<div class="summary-card">
<div class="label">测试总数</div>
<div class="value">{{TOTAL_TESTS}}</div>
</div>
<div class="summary-card">
<div class="label">成功率</div>
<div class="value success">{{SUCCESS_RATE}}%</div>
</div>
<div class="summary-card">
<div class="label">平均耗时</div>
<div class="value" style="font-size: 1.2rem;">{{AVG_TIME}}秒</div>
</div>
<div class="summary-card">
<div class="label">总费用</div>
<div class="value" style="font-size: 1.2rem;">{{TOTAL_COST}}元</div>
</div>
</div>
<!-- 文生图测试 -->
<h2>文生图测试</h2>
<div class="test-section">
<h3>尺寸测试</h3>
<div class="image-grid">
{{SIZE_TEST_CARDS}}
</div>
</div>
<div class="test-section">
<h3>风格测试</h3>
<div class="image-grid">
{{STYLE_TEST_CARDS}}
</div>
</div>
<div class="test-section">
<h3>复杂场景测试</h3>
<div class="image-grid">
{{COMPLEX_TEST_CARDS}}
</div>
</div>
<!-- 图生图测试 -->
<h2>图生图测试</h2>
<div class="test-section">
<h3>基础编辑</h3>
{{I2I_BASIC_CARDS}}
</div>
<div class="test-section">
<h3>风格转换</h3>
{{I2I_STYLE_CARDS}}
</div>
<!-- 人物一致性测试 -->
<h2>人物一致性测试(核心测试)</h2>
<div class="test-section">
<h3>基准人物图</h3>
<p style="color: #a0a0a0; margin-bottom: 15px;">用于测试的原始人物图像(全身像、清晰面部)</p>
<div class="base-image-container">
{{BASE_IMAGE}}
</div>
</div>
<div class="test-section">
<h3>场景 + 姿态变化测试</h3>
<p style="color: #a0a0a0; margin-bottom: 20px;">测试在大幅度改变场景和姿态时,人物特征的保持能力</p>
{{CONSISTENCY_CARDS}}
</div>
<div class="test-section">
<h3>一致性评分总结</h3>
<div class="score-summary">
{{CONSISTENCY_SCORE_SUMMARY}}
</div>
</div>
<!-- 测试结论 -->
<div class="conclusion">
<h2 style="margin-top: 0; border: none;">测试结论</h2>
<div class="pros-cons">
<div class="pros">
<h4>优点</h4>
<ul>
{{PROS_LIST}}
</ul>
</div>
<div class="cons">
<h4>待改进</h4>
<ul>
{{CONS_LIST}}
</ul>
</div>
</div>
</div>
<div class="footer">
<p>测试工具: image-model-evaluation skill</p>
<p style="margin-top: 8px;">小北 API (api.xbyjs.top)</p>
</div>
</div>
</body>
</html>
```
---
## Skill Companion Files
> Additional files collected from the skill directory layout.
### _meta.json
```json
{
"owner": "hexiaochun",
"slug": "image-model-evaluation",
"displayName": "image-model-evaluation",
"latest": {
"version": "1.0.0",
"publishedAt": 1770648522403,
"commit": "https://github.com/openclaw/skills/commit/9dc4099a719f12924beb4a02ef643e0b3a953480"
},
"history": []
}
```