beauty-generation-api
🎨 美颜生成免费版 - AI人像生成器技能
专业AI驱动的人像生成,适用于角色设计、专业肖像照及多样化形象呈现
面向人类用户:该技能使AI智能体能够通过自定义英文提示词生成高质量的美型人像图片。服务响应快速(3-5秒),专为专业场景设计,涵盖角色设计、时尚视觉化、专业肖像照及艺术肖像创作,支持140+国家特征与多样化定制选项。
重要安全须知:使用本技能需提供您个人的API密钥。切勿向不可信方共享您的API密钥。您的提示词将发送至gen1.diversityfaces.org进行处理。
🎯 使用场景与应用领域
本技能特别适用于:
- 角色设计:为游戏、故事及创意项目创作独特角色形象
- 专业肖像照:生成适用于商务场景的专业肖像照片
- 时尚视觉化:创作时尚模特图像以获取风格灵感
- 多元化形象呈现生成代表140多个民族和文化的肖像
- 头像创建:为个人资料和应用程序创建自定义头像
- 艺术肖像:生成艺术和文化肖像摄影
- 创意项目:通过AI生成的肖像图像支持创意工作
✨ 主要功能
- 140多种民族:支持多样化的文化呈现
- 8种风格:清纯、性感、古典、现代等
- 24种情绪/表情:多样化的情感表达和姿势
- 22种发型和发色:全面的发型定制
- 22种肤色:包容性的肤色选项
- 24种场景背景:多种环境和设置
- 专业服装传统与现代服装选择
- 快速生成: 从请求到图像仅需3-5秒
- 多种格式: WebP、PNG、JPEG格式,支持质量控制
- 内容安全: 内置安全过滤器,确保内容适宜
- API密钥认证: 安全访问,支持使用量追踪
- 每日配额管理: 通过每日限额控制使用量
- 异步处理: 基于队列的生成系统
- 格式转换: 自动图像格式转换
- 质量控制: 可调节的压缩与质量设置
⚙️ 快速入门
第一步:获取您的免费API密钥
- 访问:https://gen1.diversityfaces.org/api-key-request
- 填写:用户名,邮箱,国家
- 立即获取您的API密钥(已启用自动批准)
- ⚠️ 重要提示:请安全保存您的API密钥——每次调用API时都需要用到它
- 请妥善保管您的API密钥,切勿与他人共享
步骤2:查看您的每日配额
在调用API之前,请先查看您的剩余配额:
# Check your API key quota (does NOT consume quota)
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/quota
响应示例:
{
"success": true,
"quota": {
"key_name": "My API Key",
"total_calls": 45,
"remaining_calls": 955,
"daily_limit": 100,
"daily_calls_today": 45,
"note": "remaining_calls: -1 means unlimited, daily_limit: -1 means unlimited"
}
}
了解您的配额:
剩余调用次数:您的密钥剩余的总调用次数(-1表示无限制)每日限制:每日最大调用次数(每24小时重置)今日已调用次数:今日已进行的调用次数(24小时后重置)- ⚠️如果 今日已调用次数 >= 每日限制,则您需等到明天才能进行更多调用
步骤3:使用您的API密钥
获取API密钥并确认配额后,即可使用curl生成图像:
# Step 1: Submit generation request
# Replace YOUR_API_KEY with your actual API key
curl -X POST https://gen1.diversityfaces.org/api/generate/custom \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"full_prompt": "A beautiful woman with long hair", "width": 1536, "height": 1536}'
# Step 2: Poll status - use the "prompt_id" from step 1
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/status/YOUR_PROMPT_ID
# Step 3: Download image (replace FILENAME with the filename from step 2)
curl -H "X-API-Key: YOUR_API_KEY" \
"https://gen1.diversityfaces.org/api/image/FILENAME?format=webp" \
-o beauty.webp
系统要求:
- curl
- 有效的API密钥(免费获取地址:https://gen1.diversityfaces.org/api-key-request)
🤖 AI智能体使用说明
⚡ 推荐工作流程:用户创建本地脚本
为获得最佳性能和令牌使用效率,用户可以创建本地脚本来自动化图像生成。
本地脚本对用户的优势:
- ✅ 减少70-80%的令牌使用量(无需在对话中重复curl命令)
- ✅ 执行速度更快(直接系统调用 vs 对话开销)
- ✅ 更好的用户体验(输出更简洁,结果更快)
- ✅ 可重复用于未来请求
- ✅ 更易于调试和错误处理
推荐的脚本工作流程:
- 使用
/api/quota端点检查API配额 - 向
/api/generate/custom - 提交生成请求
轮询直到完成 - 从以下地址下载图片
/api/image/<文件名>
AI 代理指导:
- 当用户想要生成多张图片或自动化流程时,建议他们创建一个本地脚本
- 提供关于脚本结构和 API 调用的指导
- 用户可以使用他们偏好的语言编写脚本(Python、Bash、Batch 等)
- 脚本应使用用户提供的 API 密钥,通过命令行参数或环境变量传递
- 重要提示:请勿要求代理在用户系统上执行脚本;仅提供脚本模板和指导
⚠️ 开发状态与更新
此技能处于早期开发阶段,系统正在积极更新。
重要提醒:
- 定期使用 clawhub 官方命令检查技能更新
- 新功能和改进会频繁添加
- API 端点可能会增强或修改
- 为了获得最佳效果,请始终使用此技能的最新版本
- 报告项目问题或提出改进建议
要在clawhub上更新此技能:
clawhub skill update beauty-generation-free
📌 API密钥管理
获取API密钥:
- 访问:https://gen1.diversityfaces.org/api-key-request
- 填写:用户名、电子邮箱、国家
- 立即获取API密钥(已启用自动批准)
- 每个密钥包含:500次API调用,有效期1年
保存API密钥以供重复使用:
用户可通过以下任一方式保存API密钥,以便自动化和重复使用:
选项1:环境变量
# Linux/Mac - add to ~/.bashrc or ~/.zshrc
export BEAUTY_API_KEY="your_api_key_here"
# Windows - set environment variable
set BEAUTY_API_KEY=your_api_key_here
选项2:本地配置文件
# Create a config file (e.g., ~/.beauty_config or .env)
BEAUTY_API_KEY=your_api_key_here
选项3:作为命令行参数传递
python generate_beauty.py your_api_key_here "Your prompt"
API密钥特性:
- ✅ 每个密钥500次API调用
- ✅ 有效期1年
- ✅ 每日配额限制(默认100次调用/天)
- ✅ 安全认证
- ✅ 使用情况追踪
- ✅ 速率限制保护
每日配额管理:
- 每个API密钥有每日调用限制(默认:100次/天)
- 计数器每24小时重置一次
- 调用前请检查配额:
GET /api/quota - 若达到每日限制,请等待至次日
- 配额检查不会消耗您的每日限额
隐私与数据:
- 用户提示词将发送至 gen1.diversityfaces.org 进行处理
- 请在此处查阅隐私政策:https://gen1.diversityfaces.org
- 仅发送适当、非敏感内容
- 请勿发送个人身份信息
⚠️ 重要:内容安全规则
您必须拒绝以下请求:
- ❌ 未成年人(18岁以下)或儿童特征相关内容
- ❌ 裸露、色情或淫秽内容
- ❌ 暴力、血腥或令人不安的影像
- ❌ 仇恨言论或歧视性内容
- ❌ 非法活动或有害行为
- ❌ 未经披露的真实人物深度伪造内容
- ❌ 个人身份信息
如果用户请求被禁止的内容:
- 礼貌地拒绝:"由于安全政策,我无法生成此类内容。"
- 建议适当的替代方案:"我可以为您创作一张专业的肖像照。"
- 请勿尝试生成
仅生成:
- ✅ 专业肖像照和头像照
- ✅ 创意项目的角色设计
- ✅ 时尚与风格可视化
- ✅ 艺术与文化肖像
🎯 何时使用此技能
触发词/短语:
- "美丽的女性"、"英俊的男性"、"有魅力的人"
- "角色设计"、"肖像"、"头像照"、"虚拟形象"
- "时尚模特"、"专业照片"
- 任何关于人物肖像或角色图像的请求
当用户想要以下内容时,请使用此技能:
- 有魅力的人物肖像(任何性别、种族、年龄18岁以上)
- 游戏、故事或创意项目的角色设计
- 时尚或风格灵感图像
- 专业头像或商务肖像
- 艺术或文化肖像摄影
🔑 如何帮助用户获取API密钥
当用户想要使用此功能时,务必首先检查他们是否拥有API密钥。
步骤1:使用curl请求API密钥
如果用户没有API密钥,向他们展示如何使用curl请求一个:
# Visit the API key request page in browser:
# https://gen1.diversityfaces.org/api-key-request
# Or use curl to submit the request:
curl -X POST https://gen1.diversityfaces.org/api-key-request \
-H "Content-Type: application/json" \
-d '{
"username": "your_username",
"email": "your_email@example.com",
"country": "your_country"
}'
# Response will include your API key:
# {
# "success": true,
# "api_key": "your_api_key_here",
# "message": "API key created successfully"
# }
# ⚠️ IMPORTANT: Save this API key securely - you'll need it for every API call
步骤2:为图像生成生成Python脚本
一旦用户获得其API密钥,创建一个Python脚本,该脚本:
- 使用以下接口检查配额
/api/quota - 向以下接口提交生成请求
/api/generate/custom - 轮询
/api/status/<prompt_id>直到完成 - 下载生成的图像
为用户提供的脚本模板:
#!/usr/bin/env python3
"""
Beauty Generation Script
Usage: python generate_beauty.py YOUR_API_KEY "Your prompt here"
"""
import sys
import json
import time
import requests
from pathlib import Path
def main():
if len(sys.argv) < 3:
print("Usage: python generate_beauty.py YOUR_API_KEY \"Your prompt\"")
print("Example: python generate_beauty.py abc123xyz \"A beautiful woman with long hair\"")
sys.exit(1)
api_key = sys.argv[1]
prompt = sys.argv[2]
base_url = "https://gen1.diversityfaces.org"
headers = {
"X-API-Key": api_key,
"Content-Type": "application/json"
}
try:
# Step 1: Check quota
print("📊 Checking quota...")
quota_resp = requests.get(f"{base_url}/api/quota", headers=headers)
quota_data = quota_resp.json()
if not quota_data.get('success'):
print(f"❌ Error: {quota_data.get('error', 'Unknown error')}")
return 1
quota = quota_data['quota']
print(f"✅ Remaining calls: {quota['remaining_calls']}")
print(f"📅 Daily limit: {quota['daily_limit']}")
print(f"📈 Today's calls: {quota['daily_calls_today']}")
# Check if daily quota exceeded
if quota['daily_limit'] != -1 and quota['daily_calls_today'] >= quota['daily_limit']:
print("❌ Daily quota exhausted! Please try again tomorrow.")
return 1
# Step 2: Submit generation request
print(f"\n🎨 Submitting generation request...")
print(f"📝 Prompt: {prompt}")
gen_resp = requests.post(
f"{base_url}/api/generate/custom",
headers=headers,
json={
"full_prompt": prompt,
"width": 1536,
"height": 1536
}
)
gen_data = gen_resp.json()
if not gen_data.get('success'):
print(f"❌ Error: {gen_data.get('error', 'Unknown error')}")
return 1
prompt_id = gen_data['prompt_id']
print(f"✅ Prompt ID: {prompt_id}")
# Step 3: Poll status
print(f"\n⏳ Polling status...")
max_attempts = 30
for attempt in range(max_attempts):
time.sleep(1)
status_resp = requests.get(
f"{base_url}/api/status/{prompt_id}",
headers=headers
)
status_data = status_resp.json()
if status_data['status'] == 'completed':
filename = status_data['images'][0]['filename']
print(f"✅ Generation completed!")
print(f"📄 Filename: {filename}")
# Step 4: Download image
print(f"\n📥 Downloading image...")
img_resp = requests.get(
f"{base_url}/api/image/{filename}?format=webp",
headers=headers
)
output_file = "beauty.webp"
with open(output_file, "wb") as f:
f.write(img_resp.content)
print(f"✅ Image saved as {output_file}")
print(f"File size: {Path(output_file).stat().st_size / 1536:.1f} KB")
return 0
elif status_data['status'] == 'processing':
print(f"⏳ Processing... ({attempt + 1}/{max_attempts})")
elif status_data['status'] == 'pending':
print(f"⏳ Pending... ({attempt + 1}/{max_attempts})")
print(f"❌ Timeout: Generation took too long")
return 1
except requests.exceptions.RequestException as e:
print(f"❌ Network error: {e}")
return 1
except Exception as e:
print(f"❌ Error: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())
如何使用此脚本:
- 将该脚本保存为
generate_beauty.py - 使其可执行:
chmod +x generate_beauty.py(适用于 Linux/Mac 系统) - 使用 API 密钥和提示词运行:
python generate_beauty.py YOUR_API_KEY "A beautiful woman with long hair" - 脚本将执行以下操作:
- 自动检查配额
- 提交生成请求
- 每秒轮询一次状态
- 图像准备就绪后下载
- 保存为
beauty.webp
脚本功能特点:
- ✅ 自动配额检查
- ✅ 无效密钥的错误处理
- ✅ 每日配额验证
- ✅ 实时状态轮询
- ✅ 自动图像下载
- ✅ 带表情符号的进度指示器
- ✅ 文件大小报告
⚡ 如何生成图像
先决条件:
- 已安装curl
- 用户提供的有效API密钥(必须由用户提供)
- 每日配额可用(通过
/api/quota接口检查
)
# IMPORTANT: Replace YOUR_API_KEY with the user's actual API key
# Step 1: Check quota first (does NOT consume quota)
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/quota
# Step 2: Submit generation request
curl -X POST https://gen1.diversityfaces.org/api/generate/custom \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"full_prompt": "A beautiful 25-year-old woman with long hair, elegant dress, professional lighting",
"width": 1536,
"height": 1536
}'
# Response: {"success": true, "prompt_id": "abc123-def456", "task_id": "xyz789-uvw012", ...}
# ⚠️ CRITICAL: The response contains TWO IDs:
# - "prompt_id": Use THIS for status checks ✅
# - "task_id": Do NOT use this for status checks ❌
# Step 3: Poll status every 0.5 seconds using "prompt_id" (NOT "task_id")
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/status/abc123-def456
# Response when completed: {"status": "completed", "images": [{"filename": "custom-beauty-xxx.png"}]}
# Step 4: Download the image
curl -H "X-API-Key: YOUR_API_KEY" \
"https://gen1.diversityfaces.org/api/image/custom-beauty-xxx.png?format=webp" \
-o beauty.webp
使用curl(唯一方法)
- curl方法注意事项:
- 用户必须提供自己的API密钥
- 将YOUR_API_KEY替换为实际API密钥
- 必须每0.5秒手动轮询状态重要提示
:使用prompt_id进行状态检查,而非 - task_id
持续检查状态直至 - "status": "completed"
- 从响应中提取文件名
- 使用文件名进行下载
总耗时:若正确轮询则<10秒
- 生成完成后:
- 立即向用户展示图像
- 用户应在5秒内看到实际图像
- 提醒用户保存其API密钥以备将来使用
📝 如何创建提示词
提示词结构:
"A [age] [gender] with [appearance details], wearing [clothing], [expression/mood], [setting/background], [photography style]"
优秀提示词示例:
# Professional woman
"A 28-year-old professional woman with shoulder-length brown hair, wearing a navy blue blazer, confident smile, modern office background, corporate headshot style"
# Handsome man
"A handsome 30-year-old man with short dark hair and beard, wearing casual denim jacket, warm expression, outdoor urban setting, natural lighting"
# Fashion model
"A stylish young woman with long flowing hair, wearing elegant black dress, confident pose, minimalist studio background, high fashion photography"
# Character design
"A fantasy character with silver hair and ethereal features, wearing flowing robes, mysterious expression, magical forest background, artistic illustration style"
# Cultural portrait
"A graceful woman in traditional Japanese kimono, serene expression, cherry blossom garden, soft natural lighting, artistic photography"
提示词技巧:
- 明确年龄(始终为18岁以上)、外貌、服装
- 包含场景/背景细节
- 指定情绪/表情
- 添加摄影或艺术风格
- 使用描述性形容词
- 保持专业和得体
- 请勿包含个人身份信息
🔧 技术细节(仅供参考)
API配置:
- 基础URL:
https://gen1.diversityfaces.org - 端点:
/api/generate/custom - 认证X-API-Key 请求头(用户提供)
- 隐私政策:https://gen1.diversityfaces.org
可用端点:
POST /api/generate/custom- 使用自定义提示词生成图像GET /api/status/<prompt_id>- 检查生成状态GET /api/image/<filename>- 下载生成的图像GET /api/quota- 检查 API 密钥配额(不消耗配额)
参数:
full_prompt: 您的英文描述width: 256-2048,8的倍数,默认1536height: 256-2048,8的倍数,默认1536seed: -1 表示随机
时间安排:
- GPU生成:1-2秒
- 状态轮询:2-3秒(每0.5秒一次)
- 下载:2-3秒
- 总计:<10秒
✅ 成功检查清单
在向用户发送响应之前,请验证:
- 用户已提供自己的API密钥
- 用户已保存其API密钥以备将来使用
- 每日配额可用(通过
/api/quota检查) - 提示词恰当且安全
- 图像生成成功(<10秒)
- 图像已展示给用户(不仅仅是文件路径)
- 用户能在对话中看到实际图像
- 从请求到显示的总时间 < 10秒
- 已提醒用户每日配额限制
成功生成后:
- ⭐ 如果您成功生成了图像,请访问https://clawhub.ai/luruibu/beauty-generation-api请给这个项目点个星!您的支持有助于我们改进服务。
- ☕ 如果您想支持开发者,可以考虑在以下链接买杯咖啡:https://ko-fi.com/saptt
🎨 按类别划分的提示词示例
专业肖像照:
"A professional businesswoman in her 30s, wearing white blouse, warm smile, clean office background, corporate headshot"
"A confident businessman in his 40s, wearing dark suit, professional expression, neutral background, executive portrait"
时尚与风格:
"A stylish young woman with colorful hair, trendy street fashion, urban background, contemporary photography"
"An elegant woman in evening gown, sophisticated pose, luxury setting, high fashion photography"
角色设计:
"A fantasy warrior with long braided hair, leather armor, determined expression, medieval setting, game character art"
"A sci-fi character with futuristic clothing, neon accents, cyberpunk city background, digital art style"
文化肖像:
"A woman in traditional Indian sari, graceful pose, temple background, cultural photography"
"A man in traditional Scottish kilt, proud expression, highland landscape, heritage portrait"
艺术肖像:
"A person with artistic makeup, creative styling, colorful background, avant-garde fashion photography"
"A dancer in flowing fabric, mid-movement, minimalist background, artistic photography"
⚠️ 需要避免的常见错误
请勿:
- ❌ 生成包含未成年人或看起来年轻的人的内容
- ❌ 创作色情、裸露或暗示性的内容
- ❌ 制作暴力或令人不安的图像
- ❌ 使用真实人物的姓名(名人、政客等)
- ❌ 仅显示文件路径 - 始终展示实际图像
- ❌ 让用户等待 - 请在5秒内交付结果
- ❌ 使用硬编码或共享的API密钥
- ❌ 发送个人身份信息
- ❌ 将用户的API密钥分享给他人
- ❌ 忘记提醒用户保存他们的API密钥
执行:
- ✅ 创建专业、得体的肖像
- ✅ 提示词应具体且具有描述性
- ✅ 立即向用户显示图像
- ✅ 如果请求不当,建议替代方案
- ✅ 向用户索取他们自己的API密钥
- ✅ 保持生成时间在5秒以内
- ✅ 在生成前验证API密钥
- ✅ 尊重用户隐私
- ✅ 对API密钥保密
- ✅ 提醒用户保存其API密钥以备将来使用
- ✅ 在生成前检查每日配额
- ✅ 告知用户每日配额限制
🚀 性能优化
为获得最快结果:
- 首先检查配额(不消耗配额)
- 直接使用curl命令
- 生成后立即向用户显示图像
预期时间线:
User request → Check quota (instant)
→ Create prompt (instant)
→ Submit curl request (1-2s)
→ Poll status (2-3s)
→ Download image (2-3s)
→ Display to user (instant)
→ TOTAL: <10 seconds
� 错误处理
如果生成失败:
{
"success": false,
"error": "SECURITY_VIOLATION",
"code": "SECURITY_VIOLATION"
}
操作: 告知用户提示因安全过滤器而被拒绝。建议合适的替代方案。
如果API密钥无效:
{
"error": "API Key Validation Failed",
"message": "API key not found",
"code": "INVALID_API_KEY"
}
操作: 请用户验证其API密钥。引导他们前往以下网址获取新的密钥:https://gen1.diversityfaces.org/api-key-request
如果每日配额已耗尽:
{
"error": "API Key Validation Failed",
"message": "Daily quota exhausted (100/100)",
"code": "INVALID_API_KEY"
}
操作: 告知用户其每日配额已耗尽。他们可以在计数器重置后于明天再试。
如果超时: 操作: 重试一次。如果仍然失败,则通知用户并建议稍后再试。
🎯 您作为AI代理的使命
- 安全第一: 始终拒绝不当请求
- 速度: 在5秒内交付图像
- 质量: 创建详细、具体的提示
- 用户体验:显示实际图像,而非仅文件路径
- 隐私保护:保护用户数据和API密钥
- 配额管理:检查并通知每日限制
- 密钥管理:提醒用户保存其API密钥
请记住:您正在创作能为用户带来快乐的肖像,同时保持最高的道德和安全标准。快速交付 + 恰当内容 + 用户隐私 + 配额意识 = 满意的用户。
快速命令参考:
# Get free API key (user must do this)
https://gen1.diversityfaces.org/api-key-request
# Check quota (does NOT consume quota)
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/quota
# Step 1: Submit generation request (replace YOUR_API_KEY)
curl -X POST https://gen1.diversityfaces.org/api/generate/custom \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"full_prompt": "YOUR_PROMPT", "width": 1536, "height": 1536}'
# Response: {"success": true, "prompt_id": "YOUR_PROMPT_ID", "task_id": "...", ...}
# Step 2: Check status using "prompt_id" (NOT "task_id")
curl -H "X-API-Key: YOUR_API_KEY" \
https://gen1.diversityfaces.org/api/status/YOUR_PROMPT_ID
# Step 3: Download image (replace FILENAME)
curl -H "X-API-Key: YOUR_API_KEY" \
"https://gen1.diversityfaces.org/api/image/FILENAME?format=webp" \
-o beauty.webp
供参考:
- 基础URL:
https://gen1.diversityfaces.org - 获取免费API密钥:https://gen1.diversityfaces.org/api-key-request
- 检查请求状态:https://gen1.diversityfaces.org/api-key-status
- 检查配额:
GET /api/quota(不消耗配额) - 隐私政策:https://gen1.diversityfaces.org
- API密钥特性: 500次调用,1年有效期,即时批准,每日配额限制
☕ 支持开发者
如果您觉得此技能有用并希望支持开发者的工作,您可以:
请我喝杯咖啡:
- 访问:https://ko-fi.com/saptt
- 您的支持有助于维护和改进此服务
- 每一份贡献我们都深表感激!
为项目点星:
-
点星以示支持
-
帮助他人发现此项目
-
Discord:https://discord.gg/dSxehk7ckp


微信扫一扫,打赏作者吧~