mcpField
F
flyworks-avatar-video

flyworks-avatar-video

github.com/freestylefly创意与媒体470374 次安装20 周前更新
代码仓库

关于 flyworks-avatar-video

用于通过 Flyworks(HiFly 飞影数字人)从文本、音频或照片创建数字人视频的技能。它支持公共形象、照片说话视频和声音克隆,并通过随附的命令行客户端操作;视频限制取决于所用令牌。

主要功能

  1. 01根据文本或音频生成数字人视频
  2. 02将图片制作成照片说话视频
  3. 03从音频样本克隆声音
  4. 04列出公共形象和声音
  5. 05在记忆中保存形象与声音别名

适用场景

  1. 01用公共形象制作语音问候视频
  2. 02为照片配上指定文本和声音
  3. 03从音频样本创建可复用声音
  4. 04重复使用已保存的形象或声音 ID

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/freestylefly/canghe-skills --skill flyworks-avatar-video

安装后在 Claude Code 中输入/flyworks-avatar-video确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

_meta.json
README.md
requirements.txt
references/
authentication.md
avatars.md
video-generation.md
voices.md
scripts/
hifly_client.py

详细介绍

Avatar Video Generation Skill

此技能可让你使用 Flyworks(又称 HiFly 飞影数字人)数字人生成视频。可用功能:

  1. Public Avatar Video:使用预制的高度逼真数字人,通过文本或音频创建视频。
  2. Talking Photo:使用单张图片和文本/音频创建“会说话的照片”视频。
  3. Voice Cloning:从音频样本克隆声音,以便用于 TTS。

如需详细文档,请参阅 references/ 文件夹:

API 令牌与限制

此技能使用默认的免费版令牌,但存在以下限制:

  • 水印:生成的视频会带有水印。
  • 时长限制:视频时长上限为 30 秒。

移除限制:

  1. 在 hifly.cc 或 flyworks.ai 注册。
  2. 在 User Settings 中获取 API 密钥。
  3. 设置环境变量:export HIFLY_API_TOKEN="your_token_here"

工具

scripts/hifly_client.py

所有操作的主要入口。

用法
# List available public avatars
python scripts/hifly_client.py list_public_avatars

# List available public voices
python scripts/hifly_client.py list_public_voices

# Create a video with a public avatar (TTS)
python scripts/hifly_client.py create_video --type tts --text "Hello world" --avatar "avatar_id_or_alias" --voice "voice_id_or_alias"

# Create a video with a public avatar (Audio URL or File)
python scripts/hifly_client.py create_video --audio "https://... or path/to/audio.mp3" --avatar "avatar_id_or_alias"

# Create a talked photo video using bundled assets
python scripts/hifly_client.py create_talking_photo --image assets/avatar.png --title "Bundled Avatar"

# Clone a voice using bundled assets
python scripts/hifly_client.py clone_voice --audio assets/voice.MP3 --title "Bundled Voice"

# Check status of generated tasks
python scripts/hifly_client.py check_task --id "TASK_ID"

# Manage local aliases (saved in memory.json)
python scripts/hifly_client.py manage_memory add my_avatar "av_12345"
python scripts/hifly_client.py manage_memory list

示例

1. 创建简单的问候视频
# First find a voice and avatar
python scripts/hifly_client.py list_public_avatars
python scripts/hifly_client.py list_public_voices

# Generate
python scripts/hifly_client.py create_video --type tts --text "Welcome to our service." --avatar "av_public_01" --voice "voice_public_01"
2. 使用自定义会说话的照片
# Create the avatar from an image URL
python scripts/hifly_client.py create_talking_photo --image "https://mysite.com/photo.jpg" --title "CEO Photo"
# Output will give you an Avatar ID, e.g., av_custom_99

# Save it to memory
python scripts/hifly_client.py manage_memory add ceo av_custom_99

# Generate video using the new avatar
python scripts/hifly_client.py create_video --type tts --text "Here is the quarterly report." --avatar ceo --voice "voice_public_01"

Agent 行为指南

协助用户生成视频时,请遵循以下指南:

必须选择语音

生成视频需要同时提供文本和语音。 如果用户提供了文本但未选择语音:

  1. 先检查本地记忆:运行 manage_memory list,查看用户是否保存了语音别名。

  2. 询问用户选择:

    • “我看到你想用文本‘[text]’创建视频。你想使用哪种语音?”
    • 如果他们保存了语音:“你保存了以下语音:[list]。或者你更想使用公共语音吗?”
    • 如果没有保存的语音:“你想使用公共语音,还是先从音频样本克隆自己的声音?”
  3. 帮助他们选择:

    • 查看公共语音:list_public_voices
    • 克隆语音:clone_voice --audio [file] --title [name]
完整工作流示例

对于类似 “用我的照片制作一段会说话的照片视频,让照片说‘this is my AI twin’” 的提示词:

  1. 询问:“你想让你的 AI twin 使用哪种语音?你可以使用公共语音,也可以克隆自己的声音。”
  2. 如果他们想克隆:使用 clone_voice 协助他们
  3. 同时提供文本和语音,创建会说话的照片:
    python scripts/hifly_client.py create_talking_photo \
      --image user_photo.jpg \
      --text "this is my AI twin" \
      --voice SELECTED_VOICE_ID \
      --title "My AI Twin"
    
保存以供稍后使用

创建数字人或克隆语音后,主动询问是否要保存:

python scripts/hifly_client.py manage_memory add my_avatar AVATAR_ID --kind avatar
python scripts/hifly_client.py manage_memory add my_voice VOICE_ID --kind voice

评论

支持 Markdown