flyworks-avatar-video
Generate videos using Flyworks (a.k.a HiFly) Digital Humans. Create talking photo videos from images, use public avatars with TTS, or clone voices for custom audio.
1How It Works & Mechanism
The entire capability is implemented via a single Python CLI: argparse defines subcommands such as list/create/clone/check/manage_memory, and main() dispatches to the corresponding functions.
parser = argparse.ArgumentParser(description="HiFly Agent Skill Client")
Authentication reads the environment variable HIFLY_API_TOKEN; if unset, it falls back to a hardcoded free trial token in the source code, operating under a 30-second duration and watermark limit.
token = os.environ.get("HIFLY_API_TOKEN")
All requests are directed to a fixed backend BASE_URL with the token included in the Bearer header.
BASE_URL = "https://hfw-api.hifly.cc/api/v2/hifly"
Video, voice, and avatar operations are all asynchronous tasks: after submitting and obtaining a task_id, check_task_status/poll_avatar_task polls status codes (1: pending / 2: processing / 3: success / 4: failed) every 2 seconds.
url = f"{BASE_URL}/{task_type}/task"
Local assets (images/audio) are uploaded in two steps: requesting an upload URL and file_id from /tool/create_upload_url, uploading the file content via PUT, and then submitting for generation using the file_id.
url = f"{BASE_URL}/tool/create_upload_url"
Talking photo is a two-stage pipeline: first calling /avatar/create_by_image to build a custom avatar and polling for avatar_id, then using that avatar to run TTS and generate the video.
url = f"{BASE_URL}/avatar/create_by_image"
Voice cloning submits to /voice/create with voice_type=8, returning a reusable Voice ID once the task completes.
"voice_type": 8
Local alias memory: Persists alias mappings for avatar/voice into memory.json in the same directory as the script for easy cross-session reuse.
MEMORY_FILE = Path(__file__).parent / "memory.json"
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| api | HiFly/Flyworks 数字人 API |
| network | 视频产物 CDN |
| package | requests(HTTP 客户端,requirements.txt) |
| cli | python3(运行 hifly_client.py) |
4Recommended Governance & Evidence
- scripts/: Execute local script or command: python scripts/hifly_client.py <list_public_avatars|list_public_voices|crea
- 网络端点: Declare external network access: https://hfw-api.hifly.cc/api/v2/hifly (avatar/list, voice/list, video/create_b
- 本地工作目录: File read/write and artifact output: load_memory/save_memory writes aliases to memory.json in the script directory.
5Second-Pass Verification
- [ok] 网络端点全部指向 hfw-api.hifly.cc — requests.get/post/put 的 url 均由 BASE_URL 或上传返回的 upload_url 构造,扫到 11 处请求调用,无额外域名。
- [ok] 凭证读取点 — 仅 get_token() 读 HIFLY_API_TOKEN,源码第 15 行;默认 token 第 11 行硬编码。
- [ok] 写盘面 — 仅 save_memory 写 memory.json(第 34 行);未见其它文件写入。
- [ok] 是否有隐藏/混淆脚本 — 目录清单仅 9 个文本文件,无二进制/混淆体;扫描沙箱与危险旗标 0 命中。
- [ok] 能力声明与代码相符 — SKILL/README 声称的公共头像、说话照片、声音克隆在脚本中均有对应函数与端点。
- [ok] 默认 token 有效性声明 — 源码与 references/authentication.md 一致:demo token 自动启用,30s 上限且带水印。
- [ok] 安装方式 — README 的 `npx skills add Flyworks-AI/skills` 属宿主安装行为,非本目录执行,故不计入档位。
6Verdict & Scenarios
a042e06284f41218…