360 Secure SkillHub
360 安全技能中心

YouCam Hair Color & Style Advisor

取得使用者正面自拍照後,呼叫 YouCam 臉部屬性與膚色分析取得臉型與膚色,依內附指南推薦髮型輪廓與色系,再以換髮型與換髮色功能生成預覽圖並回傳結果圖片網址;執行前需確認 API 金鑰、告知點數成本並讓使用者選擇要做的項目。

youcam-api
youcam-api
热度 51.19
最近更新 2026-10-14 16:18:50
分类:生活依赖:代码执行 / 第三方 API / 读写文件应用场景:推荐 / 图像生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add youcam-hair-color-style-advisor
Metadata
name
hair-color-style-advisor
description
Recommend a hairstyle and hair color based on the user's face shape and skin tone, then preview them with YouCam (Perfect Corp) AI. Use for "推薦髮型", "換髮色", "hairstyle advice", "hair color try-on". Do NOT use for hair health diagnostics (that's hair-diagnostics), skin, makeup, or clothes.
version
1.1.1
requirements
{"credentials":[{"name":"YOUCAM_API_KEY","source":"env | credentials.json (in the skill root, next to SKILL.md)"}],"network":["yce-api-01.makeupar.com"],"apis":["face-attr-analysis","skin-tone-analysis","hair-transfer","hair-color"],"permissions":[{"type":"exec","commands":["python"]}]}

Hair Color & Style Advisor

An analysis + generation skill: analyze face shape and skin tone, then recommend and preview a hairstyle and/or hair color.

When to trigger

When the user wants a hairstyle/color recommendation or try-on. For hair-health diagnostics, hand off to hair-diagnostics.

Ask first (this skill has multiple generation options) and state cost

Before generating, ask the user what they want and tell them the credit cost of each:

  • Restyle (change hairstyle) — hair-transfer
  • Recolor (change hair color) — hair-color
  • Both Get costs with python scripts/youcam_core.py cost --feature hair-transfer and --feature hair-color (plus the analysis features if you run them), tell the user, and only run what they choose.

Get the latest API spec (do this every run)

Prerequisites

  1. A clear, front-facing selfie that shows the hair.
  2. Run python scripts/youcam_core.py validate-key (0 credits) to confirm the key. If it is not set, tell the user to get one at https://yce.perfectcorp.com/api-console and set the YOUCAM_API_KEY env var, or create credentials.json in the skill root (see credentials.example.json for the format).

Flow

  1. Analyze (as needed): face shape with python scripts/youcam_core.py run --feature face-attr-analysis --src_file <photo> --param features='["faceShape","faceAspectRatio"]' (features is required and picks which attributes to measure), and run --feature skin-tone-analysis for colors.
    • The face shape comes back as faceshape: one of Triangle, Diamond, Heart, InvTriangle, Oblong, Oval, Round, Square, or Unknown; references/guide.md has advice for Round, Oblong, Square, and Heart.
    • If it is Unknown, don't guess a shape. face_aspect_ratio comes back as [1, r] (ideal 1 : 1.46): r above about 1.6 means a long face, below about 1.3 a short/wide one. Use it only for that long-vs-wide advice, and keep the rest general.
  2. Recommend: use references/guide.md — face shape → hairstyle silhouette, skin tone → color family.
  3. Restyle (hair-transfer): style source can be a preset template or a reference photo.
    • Template: list the styles with python scripts/youcam_core.py templates --feature hair-transfer (0 credits; each has an id, title, and thumb image; pass --starting_token <next_token> for the next page), let the user pick one, then run --feature hair-transfer --src_file <photo> --param template_id=<id>
    • Reference photo: run --feature hair-transfer --src_file <photo> --ref_file <style.jpg>
  4. Recolor (hair-color): run --feature hair-color --src_file <photo> --param preset="Honey Blonde" (or custom pattern + palettes; ombre needs blend_strength / line_offset — see the doc).
  5. The generation returns a result image URL in data.results.url.
  6. If run prints "task_status": "running", the task is still processing and run stopped waiting. Do not run it again, since that starts a new task and charges again. Check back with python scripts/youcam_core.py status --feature <feature> --task_id <task_id>, using the task_id from that output, until task_status is success or error. A task_id stays valid for 24 hours.

Output rules

  • Return the result image URL exactly as given (hyperlink is OK; do not modify it).
  • Explain the recommendation (face shape → style, skin tone → color).
  • Always end with this note: "This preview image is AI-generated and for reference only; real hairstyle/color results may vary. For coloring, consult a professional stylist."