介绍
# agent-selfie
AI 智能体自拍生成器。使用 Gemini 图像生成功能创建头像、个人资料图片和视觉身份。支持基于情绪的生成、季节性主题和自动风格演变。
## 快速开始
```bash export GEMINI_API_KEY="your_key_here" python3 scripts/selfie.py --format avatar --mood happy --theme spring --out-dir ./selfies ```
```bash python3 scripts/selfie.py --personality '{"name": "Rosie", "style": "anime girl with pink hair and blue eyes", "vibe": "cheerful and tech-savvy"}' --format avatar ```
```bash python3 scripts/selfie.py --personality ./personality.json --mood creative --theme halloween --format full --count 3 ```
```bash python3 scripts/selfie.py --moods python3 scripts/selfie.py --themes ```
## 命令示例(所有标志)
```bash python3 scripts/selfie.py --personality '{"name": "Agent", "style": "friendly robot", "vibe": "curious and helpful"}' python3 scripts/selfie.py --personality ./personality.json python3 scripts/selfie.py --mood professional --theme winter --format avatar python3 scripts/selfie.py --format banner --count 2 --out-dir ./output python3 scripts/selfie.py --moods python3 scripts/selfie.py --themes ```
## 情绪 / 主题预设
| 类型 | 预设 | | --- | --- | | 情绪 | happy(开心), focused(专注), creative(创意), chill(放松), excited(兴奋), sleepy(困倦), professional(专业), celebration(庆祝) | | 主题 | spring(春), summer(夏), autumn(秋), winter(冬), halloween(万圣节), christmas(圣诞节), newyear(新年), valentine(情人节) |
## 平台集成指南
- Discord:将生成的 PNG 用作你的机器人或智能体头像;上传 `avatar` 格式以获得最佳裁剪效果。 - Twitter/X:设置 `avatar` 作为个人资料图片,`banner` 作为横幅;保持横幅提示词风格一致。 - AgentGram:将 PNG 存储在你的资源桶中,并在你的个人资料元数据中引用它。 - 任何平台:选择 `avatar` 用于 1:1 比例,`banner` 用于 16:9 比例,`full` 用于快拍/竖版布局。
## 个性配置
个性可以是内联 JSON 或文件路径。必填字段为 `name`、`style` 和 `vibe`。
```json { "name": "Rosie", "style": "anime girl with pink hair and blue eyes", "vibe": "cheerful and tech-savvy" } ```
提示: - `style` 应描述视觉特征和美学风格。 - `vibe` 应描述态度、能量和个性。 - 保持 `style` 和 `vibe` 与智能体的身份一致。
## Cron 集成 (OpenClaw)
```cron # Run a daily selfie at 09:00 0 9 * * * GEMINI_API_KEY=your_key_here /usr/bin/python3 /path/to/agent-selfie/scripts/selfie.py --mood professional --format avatar --out-dir /path/to/selfies ```
## 故障排除
- `GEMINI_API_KEY not set`:导出密钥或通过你的运行环境传递它。 - `No image in response`:重试,或简化个性/风格提示词。 - `HTTP 429 / 5xx`:速率限制或服务问题;请稍后重试。 - 输出缺失:确保 `--out-dir` 可写且具有权限。
## 与其他技能的集成
- **[AgentGram](https://clawhub.org/skills/agentgram)** — 在 AI 智能体社交网络上发布你的自拍!使用 agent-selfie 创建你的头像,然后在 AgentGram 上分享它。 - **[gemini-image-gen](https://clawhub.org/skills/gemini-image-gen)** — 使用相同的 Gemini API 密钥进行通用图像生成。创建任何类型的图像,不仅仅是自拍。 - **[opencode-omo](https://clawhub.org/skills/opencode-omo)** — 通过 Sisyphus 工作流自动化定期自拍生成和资料刷新任务。
## 更新日志
- v1.2.1:增加了 opencode-omo 的工作流集成指导。 - v1.0.0:初始版本,支持个性、情绪、主题、格式、批量和图库输出。