关于 face-morphing
face-morphing 是基于 each::sense 的人脸变形技能,可融合多张人脸并生成静态图像或动画,适用于创意图像处理与亲缘相似度可视化。
主要功能
- 01融合两张或多张人脸
- 02生成亲缘相似人脸
- 03创建平滑变形动画
- 04转换面部性别特征
- 05生成多图平均脸
适用场景
- 01混合情侣或名人照片
- 02根据父母照片预测孩子面貌
- 03制作人脸渐变视频
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ eachlabs/ skills --skill face-morphing安装后在 Claude Code 中输入/face-morphing确认已加载。
附带文件references/SSE-EVENTS.md
详细介绍
人脸融合
使用 each::sense 变换和融合人脸。此技能支持人脸融合、将两张或多张人脸合并在一起、预测家族相似特征、创建性别转换效果,以及生成流畅的融合动画。
功能
- 人脸融合:无缝地将两张人脸合并为一张
- 名人融合:将你的脸与名人融合
- 家族预测:根据父母的照片生成孩子可能的长相
- 情侣人脸合并:根据两位伴侣的照片创建融合后的人脸
- 家族相似性:分析并呈现遗传相似特征
- 融合动画:创建人脸之间流畅的视频转场
- 性别转换:转换不同性别之间的面部特征
- 族裔融合:创建融合多种族裔特征的人脸
- 历史人物现代化:将历史人物的面部转换为现代风格
- 平均人脸:根据多个输入生成人脸平均效果
快速开始
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Morph these two faces together into a seamless blend, 50% each"}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/face1.jpg",
"https://example.com/face2.jpg"
],
"mode": "max"
}'
用例示例
1. 融合两张人脸
将两张人脸融合为统一效果的基础人脸融合。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Morph these two faces together. Create a seamless blend that takes facial structure from the first image and some features like eyes and nose from the second image. Make it look natural and realistic."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/person-a.jpg",
"https://example.com/person-b.jpg"
],
"mode": "max"
}'
2. 名人面部融合
将用户照片与名人面部融合,创造有趣的变换效果。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Blend my face with this celebrity photo. Create a 50/50 morph that combines my facial structure with their features. Keep the result looking like a real person, not artificial."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/my-photo.jpg",
"https://example.com/celebrity.jpg"
],
"mode": "max"
}'
3. 父母 + 孩子长相预测
根据父母双方的照片,生成孩子可能的长相。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Based on these two parent photos, generate what their child might look like. Create a baby/toddler face that naturally combines features from both parents - take eye shape from the first parent, nose structure from the second, and blend skin tones appropriately. Make it look like a realistic child portrait."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/parent1.jpg",
"https://example.com/parent2.jpg"
],
"mode": "max"
}'
4. 情侣人脸合并
根据情侣的照片创建一张合并后的人脸。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Merge these two faces from a couple into one face. The result should look like a single person who has balanced features from both individuals. Keep natural proportions and make it look like a genuine portrait photo."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/partner1.jpg",
"https://example.com/partner2.jpg"
],
"mode": "max"
}'
5. 家族相似性生成器
呈现家族成员之间的遗传相似特征。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Analyze these family member photos and create a face that represents the family resemblance - the common features shared across all family members. Highlight the genetic similarities in bone structure, eye shape, and facial proportions."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/family-member1.jpg",
"https://example.com/family-member2.jpg",
"https://example.com/family-member3.jpg"
],
"mode": "max"
}'
6. 渐变融合动画
创建从一张人脸渐变到另一张人脸的流畅视频转场。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Create a gradual morph animation video that smoothly transitions from the first face to the second face over 3 seconds. The transformation should be fluid and show intermediate blended states between both faces. Output as a video."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/start-face.jpg",
"https://example.com/end-face.jpg"
],
"mode": "max"
}'
7. 性别转换
转换面部特征,使其呈现另一种性别的样貌。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Transform this face to show how the person might look as a different gender. Adjust facial features like jawline, brow ridge, cheekbones, and add appropriate hair and makeup while maintaining recognizable features from the original person."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/original-face.jpg"
],
"mode": "max"
}'
8. 族裔融合
创建融合多种族裔特征的人脸。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Blend these faces from different ethnic backgrounds into a single harmonious face. Create a natural-looking result that represents a mix of features from each source face - taking skin tone, eye shape, nose structure, and facial proportions from different inputs."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/face-ethnicity1.jpg",
"https://example.com/face-ethnicity2.jpg",
"https://example.com/face-ethnicity3.jpg"
],
"mode": "max"
}'
9. 历史人物现代化
将历史肖像转换为现代摄影风格。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Take this historical portrait and modernize it. Transform the face to show how this historical figure would look in a modern photograph - update the lighting to contemporary photography style, adjust skin texture to look photorealistic, and give them a modern hairstyle while preserving their distinctive facial features."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/historical-portrait.jpg"
],
"mode": "max"
}'
10. 根据多张照片创建平均人脸
生成人脸平均效果,融合多张输入人脸的特征。
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Create an average face from all these input photos. Blend the facial features mathematically to produce a single face that represents the statistical average of all inputs - averaged bone structure, feature placement, skin tone, and proportions."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/face1.jpg",
"https://example.com/face2.jpg",
"https://example.com/face3.jpg",
"https://example.com/face4.jpg",
"https://example.com/face5.jpg"
],
"mode": "max"
}'
多轮创意迭代
使用 session_id 优化和迭代人脸融合效果:
# Initial morph
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Morph these two faces together with a 50/50 blend"}],
"model": "eachsense/beta",
"stream": true,
"image_urls": [
"https://example.com/face-a.jpg",
"https://example.com/face-b.jpg"
],
"session_id": "morph-project-001"
}'
# Adjust the blend ratio
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Adjust the blend to be 70% first face and 30% second face"}],
"model": "eachsense/beta",
"stream": true,
"session_id": "morph-project-001"
}'
# Request specific feature adjustments
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Accept: text/event-stream" \
-d '{
"messages": [{"role": "user", "content": "Keep the eyes from the first face but use the jawline from the second face"}],
"model": "eachsense/beta",
"stream": true,
"session_id": "morph-project-001"
}'
模式选择
生成前询问用户:
“你想要快速且经济,还是追求高品质?”
| 模式 | 最适合 | 速度 | 品质 |
|---|---|---|---|
max | 最终融合效果、精细融合、动画 | 较慢 | 最高 |
eco | 快速预览、测试不同组合 | 较快 | 良好 |
最佳实践
输入图像质量
- 分辨率:使用高分辨率人脸照片(至少 512x512)
- 光照:输入图像的光照保持一致,融合效果会更好
- 人脸位置:正面且角度相近的照片效果最佳
- 背景:干净的背景有助于分离面部特征
融合质量提示
- 相似姿势:头部位置相近的输入人脸融合效果更好
- 清晰特征:避免使用面部被遮挡的照片(如戴墨镜、用手遮脸)
- 年龄一致性:预测家族成员长相时,请考虑拍摄照片时父母的年龄
- 多次尝试:尝试不同的提示词,找到最佳融合风格
动画注意事项
- 帧数:帧数越多,转场越流畅
- 时长:2-5 秒适合人脸融合动画
- 适合循环播放:用于社交媒体时,可要求生成无缝循环效果
人脸融合提示词建议
创建人脸融合效果时,请在提示词中包含以下细节:
- 融合比例:指定融合比例(50/50、70/30 等)
- 特征重点:说明从哪张脸提取哪些特征
- 输出类型:图像或视频动画
- 风格:写实、艺术化、夸张等
- 目标年龄:预测孩子长相时,指定期望年龄
提示词结构示例
"[Action] these faces with [blend ratio].
Take [features] from the first face and [features] from the second.
Output as [image/video]. Make it look [style descriptor]."
错误处理
| 错误 | 原因 | 解决方案 |
|---|---|---|
Failed to create prediction: HTTP 422 | 余额不足 | 前往 eachlabs.ai 充值 |
No face detected | 输入图像中没有清晰的人脸 | 使用更清晰的人脸照片 |
Face alignment failed | 人脸角度差异过大 | 使用头部姿势相似的照片 |
| 超时 | 生成过程复杂 | 将客户端超时时间设置为至少 10 分钟 |
相关技能
each-sense- 核心 API 文档face-swap- 交换图像中的人脸image-generation- 根据文本描述生成人脸video-generation- 创建人脸动画视频
评论
支持 Markdown