Zhuoran selfie

From wulaosiji/skills · View interactive version

Zhuoran selfie is an AI agent skill from the GitHub repository wulaosiji/skills. Zhuoran AI selfie photo generation skill using WaveSpeed AI with reference image. Creates contextual self-portrait photos for office, cafe, gym, airport, and scenic locations. Supports one-step, two-step, and smart generation modes for optimal quality. Use when: "卓然自拍", "AI照片生成", "角色照片", "场景自拍", "垫图

How to use this skill

Skill file

卓然自拍技能 (Zhuoran Selfie)

基于垫图使用 WaveSpeed AI 生成场景化自拍照片,支持一步直达、两步法和智能判断三种生成模式。

When to Use

Use this skill when:

Do NOT use this skill if:

Typical triggers:

Workflow

  1. 探查 (Probe): 完整读取需求指定的场景和模式,确认目标场景代码、生成模式(direct/selfie/portrait)和输出要求。
  1. 约束 (Constrain): 验证垫图文件 zhuoran_portrait_base.png 是否存在,API 密钥是否配置。根据场景变化幅度自动选择一步或两步法,不降级交付物。
  1. 证据 (Evidence): 每个场景的变化幅度和推荐模式来自预定义场景模板库。生成模式选择基于 change_level 参数(minimal/low → 一步,medium/high → 两步)。
  1. 执行 (Execute): 调用脚本或 API 生成照片,先给影响与结论,再给行动和必要证据。

快速开始

# 智能模式生成办公室自拍
openclaw skill run zhuoran-selfie office

# 指定自拍模式
openclaw skill run zhuoran-selfie cafe --mode selfie

# 使用两步法(高质量)
openclaw skill run zhuoran-selfie beach --method two_step

# 直接调用脚本
./skills/zhuoran-selfie/scripts/zhuoran-selfie.sh office --mode direct

命令行参数

./skills/zhuoran-selfie/scripts/zhuoran-selfie.sh <scene> \
  --mode <direct|selfie|portrait> \
  --method <one_step|two_step|smart> \
  --target <@user|#channel> \
  --caption "配文" \
  --output /path/to/output.png

生成模式详解

一步直达 (one_step): 垫图 → 场景。适用变化小的场景(gym, cafe, westlake, bookstore),快速简单但人物一致性可能不稳定。

两步法 (two_step): 垫图 → 中性背景 → 场景。适用变化大的场景(office, beach),人物一致性高但较慢、两次API调用。

智能判断 (smart): 自动根据 change_level 选择一步或两步。minimal/low → 一步直达;medium/high → 两步法。

API 调用流程

  1. 上传参考图 → WaveSpeed AI 媒体上传
  2. 提交编辑任务 → POST /api/v3/x-ai/grok-imagine-image/edit
  3. 轮询结果 → GET /api/v3/predictions/{task_id}/result
  4. 下载图片

Python API

from skills.zhuoran_selfie.zhuoran_selfie import generate_smart, generate_one_step, generate_two_step

# 智能生成
image_url = generate_smart("office", mode="direct")

# 一步直达(快速)
image_url = generate_one_step("cafe", mode="selfie")

# 两步法(高质量)
image_url = generate_two_step("beach", mode="portrait")
  1. 验证 (Verify): 用不同于生成路径的方式回读输出——检查生成图片的人物一致性、场景匹配度和面部特征是否保留。
  1. 交付 (Deliver): 返回生成图片 URL 或本地路径,清理临时文件。

Available Scenes

| 场景 | 代码 | 变化幅度 | 推荐模式 |

|------|------|---------|---------|

| 办公室 | office | high | 两步法 |

| 咖啡厅 | cafe | low | 一步直达 |

| 机场 | airport | medium | 智能判断 |

| 西湖 | westlake | low | 一步直达 |

| 书店 | bookstore | low | 一步直达 |

| 健身房 | gym | minimal | 一步直达 |

| 海滩 | beach | high | 两步法 |

| 深夜加班 | selfie_late_night | medium | 智能判断 |

Output

Guardrails

Anti-patterns:

Prompt 模板

direct (普通肖像):

{scene_description}, direct eye contact with camera, 
looking straight into lens, natural lighting, 
photorealistic, 8k quality

selfie (自拍模式):

a close-up selfie taken by herself at {scene_description}, 
direct eye contact with camera, 
looking straight into the lens, eyes centered and clearly visible, 
not a mirror selfie, 
phone held at arm's length but phone not visible in frame, 
face fully visible, natural lighting

portrait (专业肖像):

professional portrait of {scene_description}, 
soft natural lighting, half-body shot, 
clean background, photorealistic

与 v1.0 (clawra) 的区别

| 特性 | v1.0 (clawra) | v2.0 (zhuoran) |

|------|--------------|----------------|

| 参考图 | clawra.png (卡通) | zhuoran_portrait_base.png (真人) |

| API 平台 | fal.ai | WaveSpeed AI |

| 生成模式 | mirror / direct | 一步 / 两步 / 智能 |

| 场景管理 | 无 | 场景模板库 |

| 安全控制 | 无 | 禁用高风险场景 |

| 触发方式 | Bash/TS | Python CLI + Bash 包装 |

Environment Requirements

File Structure

skills/zhuoran-selfie/
├── SKILL.md                    # 本文档
├── zhuoran_selfie.py           # 核心逻辑
└── scripts/
    ├── zhuoran-selfie.py       # Python CLI 入口
    └── zhuoran-selfie.sh       # Bash 包装脚本(OpenClaw 入口)

Related Skills

About UniqueClub

Part of UniqueClub toolkit - AI-powered creative tools for character photo generation.

🌐 https://uniqueclub.ai

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.