关于 recreate-thumbnails
recreate-thumbnails 是用于重制 YouTube 缩略图的技能,可从视频或图片生成以 Your Name 为主体的换脸版本,并支持后续编辑。它通过分析人脸方向,从参考照片中匹配姿势,再生成多个变体。
主要功能
- 01从 YouTube 视频或图片生成缩略图
- 02分析人脸方向并匹配参考照片
- 03生成多个缩略图变体
- 04通过提示词编辑生成图片
适用场景
- 01为 YouTube 视频创建换脸缩略图
- 02按参考照片姿势匹配人脸
- 03调整缩略图中的文字、颜色或背景
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ aiagentwithdhruv/ skills --skill recreate-thumbnails安装后在 Claude Code 中输入/recreate-thumbnails确认已加载。
附带文件scripts/analyze_face_directions.pyscripts/recreate_thumbnails.py
详细介绍
重新制作 YouTube 缩略图
目标
使用 Gemini 图像模型为缩略图换脸,展示 Your Name。系统会分析面部朝向,根据姿势匹配参考照片,并生成多个变体。
脚本
./scripts/recreate_thumbnails.py- 主生成脚本./scripts/analyze_face_directions.py- 参考照片分析器
快速开始
# From YouTube video (auto-downloads thumbnail)
python3 ./scripts/recreate_thumbnails.py --youtube "https://youtube.com/watch?v=VIDEO_ID"
# From local thumbnail
python3 ./scripts/recreate_thumbnails.py --source ".tmp/thumbnails/source.jpg"
# Edit pass on generated thumbnail
python3 ./scripts/recreate_thumbnails.py --edit ".tmp/thumbnails/recreated_v3.png" \
--prompt "Change colors to teal. Change 'AI GOLD RUSH' to 'AGENTIC FLOWS'."
完整工作流
步骤 1:建立参考照片库(仅需一次)
# Drop 30-40 photos of Nick into raw folder
mkdir -p .tmp/reference_photos/raw
# Analyze and rename with face direction metadata
python3 ./scripts/analyze_face_directions.py
创建的文件示例:
nick_yawL30_pitchU10.jpg— 朝左看 30°,朝上看 10°nick_yawR45_pitch0.jpg— 朝右看 45°,水平直视
步骤 2:生成缩略图
# From YouTube URL (analyzes face, finds best reference, generates 3 variations)
python3 ./scripts/recreate_thumbnails.py --youtube "VIDEO_URL"
# Custom variation count
python3 ./scripts/recreate_thumbnails.py --source "thumbnail.jpg" -n 5
# Skip direction matching
python3 ./scripts/recreate_thumbnails.py --source "thumbnail.jpg" --no-match
步骤 3:编辑和优化
# Single edit
python3 ./scripts/recreate_thumbnails.py --edit ".tmp/thumbnails/recreated_v3.png" \
--prompt "Change colors to teal brand colors."
# Chain multiple edits
python3 ./scripts/recreate_thumbnails.py --edit ".tmp/thumbnails/edited_1.png" \
--prompt "Make text bigger. Change background to white."
CLI 参考
| 标志 | 描述 |
|---|---|
--youtube, -y | YouTube 视频 URL |
--source, -s | 源缩略图路径或 URL |
--edit, -e | 要编辑的图像(启用编辑模式) |
--prompt, -p | 编辑说明(编辑模式下必填) |
--variations, -n | 变体数量(默认:3) |
--refs | 参考照片数量(默认:2) |
--no-match | 跳过面部朝向匹配 |
输出组织
.tmp/thumbnails/
├── 20251205/ # Date folder
│ ├── 104016_1.png # Variation 1
│ ├── 104016_2.png # Variation 2
│ ├── 104016_3.png # Variation 3
│ └── 104532_edited.png # Edit pass
API 详情
- 模型:
gemini-3-pro-image-preview(Nano Banana Pro) - 费用: 每次生成或编辑约 $0.14-0.24
- 延迟: 每张图像 10-60+ 秒
- 输出: 约 1376x768(接近 16:9)
经验总结
- 2 张参考照片效果最佳(1 张会损失相似度,3 张及以上会导致重新生成)
- 必须在提示词中明确要求 16:9 格式
- 在提示词中标记图像:“IMAGE 1: Reference, IMAGE 2: Thumbnail”
- “100% exact duplicate except face”这条指令效果很好
- 编辑阶段适用于文字、颜色、图表和背景
环境
NANO_BANANA_API_KEY=your_key
架构
输入
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
youtube_url | string | 否 | YouTube 视频 URL(自动下载缩略图) |
source | file_path | 否 | 源缩略图图像路径 |
variations | integer | 否 | 变体数量(默认:3) |
edit_image | file_path | 否 | 要编辑的图像(启用编辑模式) |
prompt | string | 否 | 编辑模式的编辑说明 |
输出
| 名称 | 类型 | 描述 |
|---|---|---|
thumbnails | array | 生成的缩略图文件路径,位于 .tmp/thumbnails/ |
凭据
| 名称 | 来源 |
|---|---|
NANO_BANANA_API_KEY | .env |
可组合使用
适合与此项组合使用的技能:cross-niche-outliers、youtube-outliers
费用
每次生成 $0.14-0.24
评论
支持 Markdown