什么是 LivePortrait?
LivePortrait 是为了配合别的视频或参数让 1 张脸部照片动起来的 基于关键点的 Talking Head 模型。
以在照片中的脸部打的关键点为线索,以 AI 1 秒几十次自动执行 Photoshop 的“液化工具”那样的印象使其变形。
可以让其做与参照视频相同的表情・摇头,也可以按脸部的部件(眼・口・首的方向等)进行微调。
虽然没有最近使用视频生成模型的东西那样的“什么都有感”,但 正因为不是扩散模型所以非常轻,几乎能实时让其动作 是其巨大的特征。
用于装置也可以,用于“让眼睑稍微闭上”“让脸稍微朝下”等,在此微调生成的图像也相当方便。
自定义节点
image2image
变化输入的人物图像的脸的方向・表情。
大体有 2 种控制方法。
- 用参数调整表情
- 设为与参照图像相同的表情
用参数调整表情
{
"id": "dba15c18-c2e7-4547-8472-85361bc55454",
"revision": 0,
"last_node_id": 15,
"last_link_id": 15,
"nodes": [
{
"id": 10,
"type": "PreviewImage",
"pos": [
1699.0274397476157,
93.3821815696158
],
"size": [
312.7272727272725,
485.090909090909
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 14
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 8,
"type": "LoadImage",
"pos": [
1052.5387244959265,
93.3821815696158
],
"size": [
282.1988281250001,
508.7
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
13
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"pasted/image (105).png",
"image"
]
},
{
"id": 14,
"type": "ExpressionEditor",
"pos": [
1374.372496184271,
93.3821815696158
],
"size": [
285.0200000000002,
781.96
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "src_image",
"shape": 7,
"type": "IMAGE",
"link": 13
},
{
"name": "motion_link",
"shape": 7,
"type": "EDITOR_LINK",
"link": null
},
{
"name": "sample_image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "add_exp",
"shape": 7,
"type": "EXP_DATA",
"link": null
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
14
]
},
{
"name": "motion_link",
"type": "EDITOR_LINK",
"links": null
},
{
"name": "save_exp",
"type": "EXP_DATA",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-advancedliveportrait",
"ver": "3bba732915e22f18af0d221b9c5c282990181f1b",
"Node name for S&R": "ExpressionEditor"
},
"widgets_values": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
"All",
1.7
],
"color": "#232",
"bgcolor": "#353"
}
],
"links": [
[
13,
8,
0,
14,
0,
"IMAGE"
],
[
14,
14,
0,
10,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.7513148009015777,
"offset": [
-422.25595692540645,
168.35165163849862
]
},
"frontendVersion": "1.35.0",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
- 虽然有各种参数,但试着摸一下比较快呢。
- 像这个视频那样,使用
▷ Run (On Change)比较方便。
从参照图像编辑

{
"id": "dba15c18-c2e7-4547-8472-85361bc55454",
"revision": 0,
"last_node_id": 18,
"last_link_id": 19,
"nodes": [
{
"id": 15,
"type": "PreviewImage",
"pos": [
1701.7023235943498,
98.72387954106597
],
"size": [
312.7272727272725,
485.090909090909
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 13
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 9,
"type": "LoadImage",
"pos": [
1081.3225849102464,
207.48210643813542
],
"size": [
271.6843277493424,
470.9630353117956
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"pasted/image (107).png",
"image"
]
},
{
"id": 14,
"type": "LoadImage",
"pos": [
766.4372083426591,
98.72387954106597
],
"size": [
282.1988281250001,
508.70000000000005
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
14
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"pasted/image (105).png",
"image"
]
},
{
"id": 11,
"type": "ExpressionEditor",
"pos": [
1385.6934611021761,
98.72387954106597
],
"size": [
283.32231404958657,
756
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "src_image",
"shape": 7,
"type": "IMAGE",
"link": 14
},
{
"name": "motion_link",
"shape": 7,
"type": "EDITOR_LINK",
"link": null
},
{
"name": "sample_image",
"shape": 7,
"type": "IMAGE",
"link": 9
},
{
"name": "add_exp",
"shape": 7,
"type": "EXP_DATA",
"link": null
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
13
]
},
{
"name": "motion_link",
"type": "EDITOR_LINK",
"links": []
},
{
"name": "save_exp",
"type": "EXP_DATA",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-advancedliveportrait",
"ver": "3bba732915e22f18af0d221b9c5c282990181f1b",
"Node name for S&R": "ExpressionEditor"
},
"widgets_values": [
0,
17.5,
5.5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
"All",
1.7
],
"color": "#232",
"bgcolor": "#353"
}
],
"links": [
[
9,
9,
0,
11,
2,
"IMAGE"
],
[
13,
11,
0,
15,
0,
"IMAGE"
],
[
14,
14,
0,
11,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.6830134553650705,
"offset": [
-175.963708342659,
209.17832045893417
]
},
"frontendVersion": "1.35.0",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
- 只是向刚才的工作流加入
sample_image。 - 可以从
sample_parts,选择让哪个部位跟随参照图像。OnlyExpression… 仅表情OnlyRotation… 仅脸的方向OnlyMouth… 仅口OnlyEyes… 仅眼All… 全部
让其变成参照图像的表情(方向)的基础上,也可以使用参数进行微调。
image2video
把图像内的人物,依照参数或参照视频使其动作。
motion_link
在 Expression Editor (PHM) 制作好几个表情,通过让那个表情一个接一个变化可以制作视频。
- 🟨
Advanced Live Portrait (PHM)节点- 将
animate_without_vid设为true - 在其下的命令栏,设定对哪个表情花多少变化。
- 将
命令栏的格式是如下那样的印象。
表情的索引 = 向那个表情“变化用的帧数”:“保持那个表情等待的帧数”
例如,考虑如下写的情况。
1 = 1:0
2 = 15:0
3 = 20:10
-
1 = 1:0- 变化帧 1、等待帧 0
- 从这个表情开始,马上向下一个表情变化。
-
2 = 15:0- 花 15 帧从 1 的表情向这个表情变化,马上移向下一个表情。
-
3 = 20:10- 花 20 帧从 2 的表情向这个表情变化,之后保持 10 帧。
这种情况下,能做出合计 46 帧的视频。
从参照视频传送
虽然上面做了稍微取巧的事,但实际上这边的使用方法才是主流。

{
"id": "dba15c18-c2e7-4547-8472-85361bc55454",
"revision": 0,
"last_node_id": 25,
"last_link_id": 28,
"nodes": [
{
"id": 8,
"type": "LoadImage",
"pos": [
1053.8902782149364,
-0.15546305848340092
],
"size": [
282.1988281250001,
508.7
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
17
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.76",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"pasted/image (105).png",
"image"
]
},
{
"id": 21,
"type": "VHS_VideoCombine",
"pos": [
2019.7634896752875,
-1.365463058483401
],
"size": [
344.2576171874998,
780.8260157993859
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 19
},
{
"name": "audio",
"shape": 7,
"type": "AUDIO",
"link": null
},
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "Filenames",
"type": "VHS_FILENAMES",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "8923bd836bdab8b7bbdf4ed104b7d045e70c66e2",
"Node name for S&R": "VHS_VideoCombine"
},
"widgets_values": {
"frame_rate": 16,
"loop_count": 0,
"filename_prefix": "LivePortrait",
"format": "video/h264-mp4",
"pix_fmt": "yuv420p",
"crf": 19,
"save_metadata": true,
"trim_to_audio": false,
"pingpong": false,
"save_output": true,
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "LivePortrait_00002.mp4",
"subfolder": "",
"type": "output",
"format": "video/h264-mp4",
"frame_rate": 8,
"workflow": "LivePortrait_00002.png",
"fullpath": "D:\\AI\\ComfyUI_windows_portable\\ComfyUI\\output\\LivePortrait_00002.mp4"
}
}
}
},
{
"id": 20,
"type": "AdvancedLivePortrait",
"pos": [
1665.2686130082168,
-1.365463058483401
],
"size": [
311.2184264611833,
272
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "src_images",
"shape": 7,
"type": "IMAGE",
"link": 17
},
{
"name": "motion_link",
"shape": 7,
"type": "EDITOR_LINK",
"link": null
},
{
"name": "driving_images",
"shape": 7,
"type": "IMAGE",
"link": 28
}
],
"outputs": [
{
"name": "images",
"type": "IMAGE",
"links": [
19
]
}
],
"properties": {
"cnr_id": "comfyui-advancedliveportrait",
"ver": "3bba732915e22f18af0d221b9c5c282990181f1b",
"Node name for S&R": "AdvancedLivePortrait"
},
"widgets_values": [
0,
0,
1.7,
true,
false,
false,
""
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 25,
"type": "VHS_LoadVideo",
"pos": [
1371.2861499441556,
114.0272015894756
],
"size": [
261.6533203125,
460.08634187370603
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
28
]
},
{
"name": "frame_count",
"type": "INT",
"links": null
},
{
"name": "audio",
"type": "AUDIO",
"links": null
},
{
"name": "video_info",
"type": "VHS_VIDEOINFO",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "8923bd836bdab8b7bbdf4ed104b7d045e70c66e2",
"Node name for S&R": "VHS_LoadVideo"
},
"widgets_values": {
"video": "7327398-uhd_3840_2160_25fps.mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1,
"format": "None",
"choose video to upload": "image",
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "7327398-uhd_3840_2160_25fps.mp4",
"type": "input",
"format": "video/mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1
}
}
}
}
],
"links": [
[
17,
8,
0,
20,
0,
"IMAGE"
],
[
19,
20,
0,
21,
0,
"IMAGE"
],
[
28,
25,
0,
20,
2,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.9090909090909091,
"offset": [
-786.1067299591815,
216.72498248265038
]
},
"frontendVersion": "1.35.0",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
- 🟨 只是向
driving_images输入参照视频。
将参照视频侧的表情・摇头,原样传送到输入图像。
当然,也可以与上面的 motion_link 组合使用。
video2video
将视频中的人物的表情配合参照视频。
{
"id": "dba15c18-c2e7-4547-8472-85361bc55454",
"revision": 0,
"last_node_id": 26,
"last_link_id": 29,
"nodes": [
{
"id": 20,
"type": "AdvancedLivePortrait",
"pos": [
1673.4228458122946,
-1.365463058483401
],
"size": [
311.2184264611833,
480
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "src_images",
"shape": 7,
"type": "IMAGE",
"link": 29
},
{
"name": "motion_link",
"shape": 7,
"type": "EDITOR_LINK",
"link": null
},
{
"name": "driving_images",
"shape": 7,
"type": "IMAGE",
"link": 28
}
],
"outputs": [
{
"name": "images",
"type": "IMAGE",
"links": [
19
]
}
],
"properties": {
"cnr_id": "comfyui-advancedliveportrait",
"ver": "3bba732915e22f18af0d221b9c5c282990181f1b",
"Node name for S&R": "AdvancedLivePortrait"
},
"widgets_values": [
0,
0,
1.7,
true,
false,
false,
""
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 25,
"type": "VHS_LoadVideo",
"pos": [
1376.647308097985,
111.5478627465004
],
"size": [
261.6533203125,
460.08634187370603
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
28
]
},
{
"name": "frame_count",
"type": "INT",
"links": null
},
{
"name": "audio",
"type": "AUDIO",
"links": null
},
{
"name": "video_info",
"type": "VHS_VIDEOINFO",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "8923bd836bdab8b7bbdf4ed104b7d045e70c66e2",
"Node name for S&R": "VHS_LoadVideo"
},
"widgets_values": {
"video": "7327398-uhd_3840_2160_25fps.mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1,
"format": "None",
"choose video to upload": "image",
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "7327398-uhd_3840_2160_25fps.mp4",
"type": "input",
"format": "video/mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1
}
}
}
},
{
"id": 26,
"type": "VHS_LoadVideo",
"pos": [
1079.8717703836753,
-1.365463058483401
],
"size": [
261.6533203125,
460.08634187370603
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
29
]
},
{
"name": "frame_count",
"type": "INT",
"links": null
},
{
"name": "audio",
"type": "AUDIO",
"links": null
},
{
"name": "video_info",
"type": "VHS_VIDEOINFO",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "8923bd836bdab8b7bbdf4ed104b7d045e70c66e2",
"Node name for S&R": "VHS_LoadVideo"
},
"widgets_values": {
"video": "3762907-uhd_3840_2160_25fps.mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1,
"format": "None",
"choose video to upload": "image",
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "3762907-uhd_3840_2160_25fps.mp4",
"type": "input",
"format": "video/mp4",
"force_rate": 16,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 48,
"skip_first_frames": 0,
"select_every_nth": 1
}
}
}
},
{
"id": 21,
"type": "VHS_VideoCombine",
"pos": [
2019.7634896752875,
-1.365463058483401
],
"size": [
480.98761718749984,
607.3055346679687
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 19
},
{
"name": "audio",
"shape": 7,
"type": "AUDIO",
"link": null
},
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "Filenames",
"type": "VHS_FILENAMES",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "8923bd836bdab8b7bbdf4ed104b7d045e70c66e2",
"Node name for S&R": "VHS_VideoCombine"
},
"widgets_values": {
"frame_rate": 16,
"loop_count": 0,
"filename_prefix": "LivePortrait",
"format": "video/h264-mp4",
"pix_fmt": "yuv420p",
"crf": 19,
"save_metadata": true,
"trim_to_audio": false,
"pingpong": false,
"save_output": true,
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "LivePortrait_00005.mp4",
"subfolder": "",
"type": "output",
"format": "video/h264-mp4",
"frame_rate": 16,
"workflow": "LivePortrait_00005.png",
"fullpath": "D:\\AI\\ComfyUI_windows_portable\\ComfyUI\\output\\LivePortrait_00005.mp4"
}
}
}
}
],
"links": [
[
19,
20,
0,
21,
0,
"IMAGE"
],
[
28,
25,
0,
20,
2,
"IMAGE"
],
[
29,
26,
0,
20,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.8264462809917354,
"offset": [
-698.8176497225181,
308.1820919619897
]
},
"frontendVersion": "1.35.0",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
- 🟨 只是将
src_images、driving_images双方设为视频。
- 可以保持基础视频的运镜和背景原样,只替换人物的表情・对口型。