Preface¶
When building “whether two images show the same person” functionality in an agent, the common approach is to manually write Tencent Cloud SDK calls, maintain your own parameter tables and threshold descriptions, and then explain the results to users. Every step requires consulting the CompareFace documentation, and input parameters for local paths, URLs, and Base64 are prone to errors.
Below we introduce TencentCloud FaceID CompareFace on SkillHub (@tencent-adm/tencentcloud-faceid-compareface). It wraps Tencent Cloud’s face recognition CompareFace into a standard Agent Skill: when an Agent needs 1:1 face similarity, it triggers according to SKILL.md, calls the API through a script, and returns a similarity score, facilitating the determination of whether it is the same person.
What This Is¶
TencentCloud FaceID CompareFace is an API invocation skill for Tencent Cloud’s face comparison (CompareFace). It is published by the Tencent Cloud Huiyan Face Verification Team, categorized as ai-agent on SkillHub, marked as enterprise source, and the current version is 1.0.1. The skill tag includes requires_api_key=true, indicating that Tencent Cloud API keys must be configured before invocation.
The core problem it solves: performing similarity comparison on faces in two images and returning a face similarity score of 0~100; supports both image Base64 and image URL inputs (local files can be automatically converted to Base64 by the script), and can be used to determine whether two faces are the same person.
SkillHub page: https://www.skillhub.cn/skills/tencent-adm/tencentcloud-faceid-compareface
Official index: https://api.skillhub.cn/tencent-adm/tencentcloud-faceid-compareface
Core Features¶
The following capabilities come from the skill description and the upstream SKILL.md (consistent with Tencent Cloud’s CompareFace product):
- Face similarity comparison: Scores the faces detected in images A and B respectively.
- Same person determination: Combines the score and algorithm version to provide structured results such as whether it is the same person (the script outputs JSON containing fields like
Score,IsSamePerson). - Multiple input methods:
--image-a/--image-b(local path or Base64 string), or--url-a/--url-b(image URL; URL takes priority over the same-side image parameter). - Quality control: Optional
--quality-control(0~4) to filter low-quality images. - Algorithm version:
--face-model-versionsupports 2.0 and 3.0, with 3.0 as default. - Rotation detection: Optional
--need-rotate-detection(0 off / 1 on).
API product documentation: https://cloud.tencent.com/document/product/867/44987
Installation and Enablement¶
Install from SkillHub¶
Open TencentCloud FaceID CompareFace on the SkillHub skill page, and follow the page instructions to send the installation prompt to the AI assistant you are using. The assistant will complete the skill package retrieval and directory placement. Package coordinates:
@tencent-adm/tencentcloud-faceid-compareface
Version 1.0.1. If the page does not separately list different commands for Cursor, Codex CLI, and Claude Code, you can enable it in each Agent using the “prompt + coordinates” method; the specific placement path follows the Skills configuration of your client.
Runtime Environment and Keys¶
The skill script depends on Python and the Tencent Cloud SDK, which must be prepared in advance:
pip install tencentcloud-sdk-python
Environment variables (write to the shell or Agent runtime environment before invocation):
TENCENTCLOUD_SECRET_ID=your_SecretId
TENCENTCLOUD_SECRET_KEY=your_SecretKey
Requirements: Python 3.6+. Without configured keys, CompareFace requests cannot pass Tencent Cloud authentication.
Typical Usage¶
After installation is complete, execute scripts/main.py in the skill directory. The following examples are consistent with the official SKILL.md and can be reproduced in the skill root directory.
Two local face images (automatically converted to Base64):
python scripts/main.py --image-a ./face_a.jpg --image-b ./face_b.jpg
Two image URLs:
python scripts/main.py --url-a "https://example.com/face_a.jpg" --url-b "https://example.com/face_b.jpg"
Mixed input with 3.0 algorithm and quality control specified:
python scripts/main.py --image-a ./face_a.jpg --image-b ./face_b.jpg --face-model-version 3.0 --quality-control 2
On success, the script returns JSON, for example:
{
"Score": 87.5,
"ScoreDesc": "高度相似,可认定为同一人(3.0版本)",
"IsSamePerson": true,
"FaceModelVersion": "3.0",
"RequestId": "xxx"
}
In Agent conversations, when users express intentions such as “compare two faces” or “1:1 verification of whether it is the same person”, the model should select this skill and call the script according to the above parameters, rather than guessing the similarity on its own.
Use Cases and Notes¶
Who it’s for
- Developers who are already using Tencent Cloud face recognition and need to perform face 1:1 comparison in Coding Agents.
- Teams that want to write CompareFace parameters, threshold descriptions, and compliance prompts into
SKILL.md, reducing repeated documentation lookups.
Input and Detection
- Formats: PNG, JPG, JPEG, BMP; GIF is not supported.
- Base64-encoded size must not exceed 5MB; resolution and face selection rules are documented in the skill documentation (when multiple faces are present, the one with the highest confidence is selected by default).
Threshold Reference (Version 3.0, from skill documentation)
| Score Range | Recommended Determination |
|---|---|
| ≥ 40 points | Suspected same person |
| ≥ 50 points | Can be determined as same person (recommended threshold) |
| ≥ 60 points | High confidence of being same person |
Version 2.0 has higher thresholds (e.g., recommended determination threshold ≥ 80 points), and business strategies need to be adjusted accordingly when switching versions.
Compliance
The skill explicitly requires: before processing personal information such as faces, legal and valid consent or other legality basis must be obtained from the personal information subject; specifics are subject to the service agreement on Tencent Cloud’s official website.
Platform-side Information
On SkillHub, this skill has a rating of 100000, 1428 downloads, and 38 installs (subject to the SkillHub page display, which may change over time).
Conclusion¶
TencentCloud FaceID CompareFace consolidates Tencent Cloud’s CompareFace into a standard skill that can be triggered by Agents: with keys configured and script parameters clear, you can complete dual-image face similarity comparison in conversations. To install or view instructions, please open the SkillHub official page: https://www.skillhub.cn/skills/tencent-adm/tencentcloud-faceid-compareface