From ad29b02bc1599fa675bde317a78544b8248dc1d9 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:56:46 +0300 Subject: [PATCH] update workflows --- examples/liveportrait_image_example_01.json | 1526 ++++++++-------- .../liveportrait_realtime_example_01.json | 346 ++-- examples/liveportrait_video_example_02.json | 1573 +++++++++-------- 3 files changed, 1798 insertions(+), 1647 deletions(-) diff --git a/examples/liveportrait_image_example_01.json b/examples/liveportrait_image_example_01.json index 43b0868..71c3815 100644 --- a/examples/liveportrait_image_example_01.json +++ b/examples/liveportrait_image_example_01.json @@ -1,6 +1,6 @@ { - "last_node_id": 197, - "last_link_id": 472, + "last_node_id": 200, + "last_link_id": 478, "nodes": [ { "id": 129, @@ -20,10 +20,7 @@ { "name": "cropper", "type": "LPCROPPER", - "links": [ - 444, - 468 - ], + "links": [], "shape": 3, "slot_index": 0 } @@ -36,100 +33,19 @@ true ] }, - { - "id": 82, - "type": "MaskPreview+", - "pos": [ - 1380, - -820 - ], - "size": { - "0": 210, - "1": 246 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "mask", - "type": "MASK", - "link": 187 - } - ], - "properties": { - "Node name for S&R": "MaskPreview+" - } - }, - { - "id": 182, - "type": "GetImageSizeAndCount", - "pos": [ - -831, - 37 - ], - "size": { - "0": 210, - "1": 86 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 436 - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 443, - 451, - 469 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "480 width", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "480 height", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "32 count", - "type": "INT", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GetImageSizeAndCount" - } - }, { "id": 134, "type": "GetImageSizeAndCount", "pos": [ - -193, - 182 + -200, + 360 ], "size": { "0": 210, "1": 86 }, "flags": {}, - "order": 16, + "order": 19, "mode": 0, "inputs": [ { @@ -173,8 +89,8 @@ "id": 188, "type": "Note", "pos": [ - 39, - 137 + 30, + 310 ], "size": { "0": 229.1644287109375, @@ -192,69 +108,6 @@ "color": "#432", "bgcolor": "#653" }, - { - "id": 189, - "type": "LivePortraitCropper", - "pos": [ - -3, - -755 - ], - "size": { - "0": 330, - "1": 242 - }, - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "pipeline", - "type": "LIVEPORTRAITPIPE", - "link": 446, - "slot_index": 0 - }, - { - "name": "cropper", - "type": "LPCROPPER", - "link": 444 - }, - { - "name": "source_image", - "type": "IMAGE", - "link": 445 - } - ], - "outputs": [ - { - "name": "cropped_image", - "type": "IMAGE", - "links": null, - "shape": 3, - "slot_index": 0 - }, - { - "name": "crop_info", - "type": "CROPINFO", - "links": [ - 449 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LivePortraitCropper" - }, - "widgets_values": [ - 512, - 2.3, - 0, - -0.125, - 0, - "large-small", - true - ] - }, { "id": 78, "type": "GetImageSizeAndCount", @@ -267,7 +120,7 @@ "1": 86 }, "flags": {}, - "order": 12, + "order": 15, "mode": 0, "inputs": [ { @@ -310,77 +163,6 @@ "Node name for S&R": "GetImageSizeAndCount" } }, - { - "id": 192, - "type": "Reroute", - "pos": [ - 423, - -466 - ], - "size": [ - 82, - 26 - ], - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 455 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 456, - 457 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, - { - "id": 1, - "type": "DownloadAndLoadLivePortraitModels", - "pos": [ - -1244, - -870 - ], - "size": { - "0": 302.43463134765625, - "1": 58 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "live_portrait_pipe", - "type": "LIVEPORTRAITPIPE", - "links": [ - 446, - 448, - 472 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DownloadAndLoadLivePortraitModels" - }, - "widgets_values": [ - "fp16" - ] - }, { "id": 8, "type": "VHS_LoadVideo", @@ -393,7 +175,7 @@ 572.1555480957031 ], "flags": {}, - "order": 8, + "order": 10, "mode": 0, "inputs": [ { @@ -453,7 +235,7 @@ "force_size": "Disabled", "custom_width": 512, "custom_height": 512, - "frame_load_cap": 32, + "frame_load_cap": 128, "skip_first_frames": 0, "select_every_nth": 1, "choose video to upload": "image", @@ -461,7 +243,7 @@ "hidden": false, "paused": false, "params": { - "frame_load_cap": 32, + "frame_load_cap": 128, "skip_first_frames": 0, "force_rate": 0, "filename": "d6.mp4", @@ -472,321 +254,6 @@ } } }, - { - "id": 186, - "type": "ImageConcanate", - "pos": [ - 1019, - 28 - ], - "size": { - "0": 315, - "1": 102 - }, - "flags": {}, - "order": 21, - "mode": 0, - "inputs": [ - { - "name": "image1", - "type": "IMAGE", - "link": 443 - }, - { - "name": "image2", - "type": "IMAGE", - "link": 440 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 441 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImageConcanate" - }, - "widgets_values": [ - "right", - true - ] - }, - { - "id": 187, - "type": "Note", - "pos": [ - 118, - -243 - ], - "size": { - "0": 210, - "1": 58 - }, - "flags": {}, - "order": 3, - "mode": 0, - "properties": { - "text": "" - }, - "widgets_values": [ - "Connect this if you want to use the eye/lip retargeting mode" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 83, - "type": "CreateShapeMask", - "pos": [ - 660, - -820 - ], - "size": { - "0": 315, - "1": 270 - }, - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "mask", - "type": "MASK", - "links": [ - 192 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "mask_inverted", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "CreateShapeMask" - }, - "widgets_values": [ - "square", - 1, - 256, - 256, - 0, - 512, - 512, - 480, - 480 - ] - }, - { - "id": 81, - "type": "GrowMaskWithBlur", - "pos": [ - 1030, - -820 - ], - "size": { - "0": 315, - "1": 246 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "mask", - "type": "MASK", - "link": 192, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "mask", - "type": "MASK", - "links": [ - 187, - 463 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "mask_inverted", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GrowMaskWithBlur" - }, - "widgets_values": [ - 0, - 0, - true, - false, - 13.9, - 1, - 1, - false - ] - }, - { - "id": 191, - "type": "LivePortraitComposite", - "pos": [ - 1063, - -427 - ], - "size": { - "0": 355.20001220703125, - "1": 86 - }, - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "source_image", - "type": "IMAGE", - "link": 457 - }, - { - "name": "cropped_image", - "type": "IMAGE", - "link": 454 - }, - { - "name": "liveportrait_out", - "type": "LP_OUT", - "link": 452 - }, - { - "name": "mask", - "type": "MASK", - "link": 463 - } - ], - "outputs": [ - { - "name": "full_images", - "type": "IMAGE", - "links": [ - 458 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "mask", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LivePortraitComposite" - } - }, - { - "id": 181, - "type": "GetImageSizeAndCount", - "pos": [ - 1612, - -297 - ], - "size": { - "0": 210, - "1": 86 - }, - "flags": {}, - "order": 20, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 458 - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 440 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "512 width", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "512 height", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "32 count", - "type": "INT", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GetImageSizeAndCount" - } - }, - { - "id": 133, - "type": "PrimitiveNode", - "pos": [ - -1541, - -13 - ], - "size": { - "0": 210, - "1": 82 - }, - "flags": {}, - "order": 5, - "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 302 - ], - "widget": { - "name": "frame_load_cap" - }, - "slot_index": 0 - } - ], - "title": "frame_load_cap", - "properties": { - "Run widget replace on values": false - }, - "widgets_values": [ - 32, - "fixed" - ] - }, { "id": 165, "type": "ImageResizeKJ", @@ -799,7 +266,7 @@ "1": 242 }, "flags": {}, - "order": 9, + "order": 12, "mode": 0, "inputs": [ { @@ -865,169 +332,19 @@ 0 ] }, - { - "id": 196, - "type": "LoadImage", - "pos": [ - -1256, - -572 - ], - "size": { - "0": 315, - "1": 314 - }, - "flags": {}, - "order": 6, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 466 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "oldman.jpg", - "image" - ] - }, - { - "id": 168, - "type": "VHS_VideoCombine", - "pos": [ - 1495, - -143 - ], - "size": [ - 1103.3974609375, - 865.69873046875 - ], - "flags": {}, - "order": 22, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 441 - }, - { - "name": "audio", - "type": "VHS_AUDIO", - "link": null - }, - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "link": null - }, - { - "name": "vae", - "type": "VAE", - "link": null - } - ], - "outputs": [ - { - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 24, - "loop_count": 0, - "filename_prefix": "LivePortrait", - "format": "video/h264-mp4", - "pix_fmt": "yuv420p", - "crf": 19, - "save_metadata": true, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "LivePortrait_00002.mp4", - "subfolder": "", - "type": "temp", - "format": "video/h264-mp4", - "frame_rate": 24 - } - } - } - }, - { - "id": 180, - "type": "LivePortraitRetargeting", - "pos": [ - -320, - -311 - ], - "size": { - "0": 430.8000183105469, - "1": 130 - }, - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "driving_crop_info", - "type": "CROPINFO", - "link": 470, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "retargeting_info", - "type": "RETARGETINGINFO", - "links": [], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LivePortraitRetargeting" - }, - "widgets_values": [ - true, - 1, - true, - 1 - ] - }, { "id": 197, "type": "LivePortraitCropper", "pos": [ - -636, - 187 + -640, + 360 ], "size": { "0": 330, "1": 242 }, "flags": {}, - "order": 13, + "order": 16, "mode": 0, "inputs": [ { @@ -1039,7 +356,7 @@ { "name": "cropper", "type": "LPCROPPER", - "link": 468 + "link": 476 }, { "name": "source_image", @@ -1080,19 +397,300 @@ true ] }, + { + "id": 198, + "type": "LivePortraitLoadMediaPipeCropper", + "pos": [ + -1256, + -893 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "links": [ + 474 + ], + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LivePortraitLoadMediaPipeCropper" + }, + "widgets_values": [ + "CPU", + true + ] + }, + { + "id": 1, + "type": "DownloadAndLoadLivePortraitModels", + "pos": [ + -934, + -1067 + ], + "size": { + "0": 302.43463134765625, + "1": 58 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "live_portrait_pipe", + "type": "LIVEPORTRAITPIPE", + "links": [ + 446, + 448, + 472 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DownloadAndLoadLivePortraitModels" + }, + "widgets_values": [ + "fp16" + ] + }, + { + "id": 200, + "type": "Note", + "pos": [ + -1542, + -877 + ], + "size": [ + 265.68303695794293, + 168.53929752859244 + ], + "flags": {}, + "order": 4, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "Choose your face detector here, MediaPipe doesn't run on GPU and isn't as good at detecting, but is faster on CPU and has Apache 2.0 license.\n\nInsightface can be run on GPU and is better at detecting, but it's model license is NON-COMMERCIAL" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 199, + "type": "Reroute", + "pos": [ + -855, + -812 + ], + "size": [ + 115.6, + 26 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 474 + } + ], + "outputs": [ + { + "name": "LPCROPPER", + "type": "LPCROPPER", + "links": [ + 475, + 476 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 133, + "type": "PrimitiveNode", + "pos": [ + -1533, + -164 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 302 + ], + "widget": { + "name": "frame_load_cap" + }, + "slot_index": 0 + } + ], + "title": "frame_load_cap", + "properties": { + "Run widget replace on values": false + }, + "widgets_values": [ + 128, + "fixed" + ] + }, + { + "id": 187, + "type": "Note", + "pos": [ + 80, + 140 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 6, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "Connect this if you want to use the eye/lip retargeting mode" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 182, + "type": "GetImageSizeAndCount", + "pos": [ + -850, + -195 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 436 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 451, + 469 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "480 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "480 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "128 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 180, + "type": "LivePortraitRetargeting", + "pos": [ + -390, + 120 + ], + "size": { + "0": 430.8000183105469, + "1": 130 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "driving_crop_info", + "type": "CROPINFO", + "link": 470, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "retargeting_info", + "type": "RETARGETINGINFO", + "links": [], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitRetargeting" + }, + "widgets_values": [ + true, + 1, + true, + 1 + ] + }, { "id": 190, "type": "LivePortraitProcess", "pos": [ - 551, - -383 + 166, + -422 ], "size": { "0": 430.8000183105469, "1": 282 }, "flags": {}, - "order": 18, + "order": 21, "mode": 0, "inputs": [ { @@ -1153,6 +751,452 @@ "relative", 0.000003 ] + }, + { + "id": 83, + "type": "CreateShapeMask", + "pos": [ + 407, + -876 + ], + "size": { + "0": 315, + "1": 270 + }, + "flags": {}, + "order": 7, + "mode": 0, + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 192 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask_inverted", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "CreateShapeMask" + }, + "widgets_values": [ + "square", + 1, + 256, + 256, + 0, + 512, + 512, + 480, + 480 + ] + }, + { + "id": 81, + "type": "GrowMaskWithBlur", + "pos": [ + 751, + -873 + ], + "size": { + "0": 315, + "1": 246 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 192, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 187, + 463 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask_inverted", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GrowMaskWithBlur" + }, + "widgets_values": [ + 0, + 0, + true, + false, + 13.9, + 1, + 1, + false + ] + }, + { + "id": 82, + "type": "MaskPreview+", + "pos": [ + 1091, + -873 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 187 + } + ], + "properties": { + "Node name for S&R": "MaskPreview+" + } + }, + { + "id": 181, + "type": "GetImageSizeAndCount", + "pos": [ + 1083, + -443 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 458 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 478 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "512 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "512 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "128 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 168, + "type": "VHS_VideoCombine", + "pos": [ + 630, + -302 + ], + "size": [ + 669.8613793918787, + 973.8613793918787 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 478 + }, + { + "name": "audio", + "type": "VHS_AUDIO", + "link": null + }, + { + "name": "meta_batch", + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "type": "VAE", + "link": null + } + ], + "outputs": [ + { + "name": "Filenames", + "type": "VHS_FILENAMES", + "links": null, + "shape": 3 + } + ], + "properties": { + "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, + "pingpong": false, + "save_output": false, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "LivePortrait_00005.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 16 + } + } + } + }, + { + "id": 196, + "type": "LoadImage", + "pos": [ + -1267, + -582 + ], + "size": [ + 330.4995504373579, + 384.24166509694487 + ], + "flags": {}, + "order": 8, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 466 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "ComfyUI_temp_gjesb_00023_.png", + "image" + ] + }, + { + "id": 192, + "type": "Reroute", + "pos": [ + 73, + -519 + ], + "size": [ + 82, + 26 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 455 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 456, + 457 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 191, + "type": "LivePortraitComposite", + "pos": [ + 673, + -507 + ], + "size": { + "0": 355.20001220703125, + "1": 86 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "source_image", + "type": "IMAGE", + "link": 457 + }, + { + "name": "cropped_image", + "type": "IMAGE", + "link": 454 + }, + { + "name": "liveportrait_out", + "type": "LP_OUT", + "link": 452 + }, + { + "name": "mask", + "type": "MASK", + "link": 463 + } + ], + "outputs": [ + { + "name": "full_images", + "type": "IMAGE", + "links": [ + 458 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LivePortraitComposite" + } + }, + { + "id": 189, + "type": "LivePortraitCropper", + "pos": [ + -203, + -830 + ], + "size": { + "0": 330, + "1": 242 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "LIVEPORTRAITPIPE", + "link": 446, + "slot_index": 0 + }, + { + "name": "cropper", + "type": "LPCROPPER", + "link": 475, + "slot_index": 1 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 445 + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": null, + "shape": 3, + "slot_index": 0 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "links": [ + 449 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LivePortraitCropper" + }, + "widgets_values": [ + 512, + 2.3, + 0, + -0.125, + 0, + "large-small", + true + ] } ], "links": [ @@ -1196,38 +1240,6 @@ 0, "IMAGE" ], - [ - 440, - 181, - 0, - 186, - 1, - "IMAGE" - ], - [ - 441, - 186, - 0, - 168, - 0, - "IMAGE" - ], - [ - 443, - 182, - 0, - 186, - 0, - "IMAGE" - ], - [ - 444, - 129, - 0, - 189, - 1, - "LPCROPPER" - ], [ 445, 78, @@ -1332,14 +1344,6 @@ 0, "IMAGE" ], - [ - 468, - 129, - 0, - 197, - 1, - "LPCROPPER" - ], [ 469, 182, @@ -1371,6 +1375,38 @@ 197, 0, "LIVEPORTRAITPIPE" + ], + [ + 474, + 198, + 0, + 199, + 0, + "*" + ], + [ + 475, + 199, + 0, + 189, + 1, + "LPCROPPER" + ], + [ + 476, + 199, + 0, + 197, + 1, + "LPCROPPER" + ], + [ + 478, + 181, + 0, + 168, + 0, + "IMAGE" ] ], "groups": [], @@ -1379,8 +1415,8 @@ "ds": { "scale": 0.6209213230591553, "offset": { - "0": 1452.6772352406037, - "1": 986.9216386951317 + "0": 1699.882189562642, + "1": 1132.3910371015413 } } }, diff --git a/examples/liveportrait_realtime_example_01.json b/examples/liveportrait_realtime_example_01.json index f86fd5d..827aa48 100644 --- a/examples/liveportrait_realtime_example_01.json +++ b/examples/liveportrait_realtime_example_01.json @@ -1,13 +1,13 @@ { - "last_node_id": 203, - "last_link_id": 477, + "last_node_id": 208, + "last_link_id": 480, "nodes": [ { - "id": 129, - "type": "LivePortraitLoadCropper", + "id": 204, + "type": "LivePortraitLoadMediaPipeCropper", "pos": [ - -1050, - -740 + -1059, + -767 ], "size": { "0": 315, @@ -21,14 +21,13 @@ "name": "cropper", "type": "LPCROPPER", "links": [ - 444 + 478 ], - "shape": 3, - "slot_index": 0 + "shape": 3 } ], "properties": { - "Node name for S&R": "LivePortraitLoadCropper" + "Node name for S&R": "LivePortraitLoadMediaPipeCropper" }, "widgets_values": [ "CPU", @@ -39,8 +38,8 @@ "id": 1, "type": "DownloadAndLoadLivePortraitModels", "pos": [ - -1040, - -850 + -1046, + -904 ], "size": { "0": 302.43463134765625, @@ -72,15 +71,15 @@ "id": 165, "type": "ImageResizeKJ", "pos": [ - -670, - -560 + -715, + -617 ], "size": { "0": 315, "1": 242 }, "flags": {}, - "order": 4, + "order": 6, "mode": 0, "inputs": [ { @@ -146,58 +145,19 @@ 0 ] }, - { - "id": 196, - "type": "LoadImage", - "pos": [ - -1050, - -550 - ], - "size": { - "0": 315, - "1": 314 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 466 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "oldman.jpg", - "image" - ] - }, { "id": 78, "type": "GetImageSizeAndCount", "pos": [ - -310, - -550 + -364, + -619 ], "size": { "0": 210, "1": 86 }, "flags": {}, - "order": 5, + "order": 7, "mode": 0, "inputs": [ { @@ -224,7 +184,7 @@ "shape": 3 }, { - "name": "512 height", + "name": "384 height", "type": "INT", "links": null, "shape": 3 @@ -240,19 +200,177 @@ "Node name for S&R": "GetImageSizeAndCount" } }, + { + "id": 207, + "type": "Note", + "pos": [ + -850, + -202 + ], + "size": [ + 230.3331222759989, + 105.34622315856666 + ], + "flags": {}, + "order": 2, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "Example live inputs, direct webcam capture using cv2 or screencapture using mss. Both are about same speed." + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 206, + "type": "Screencap_mss", + "pos": [ + -568, + -34 + ], + "size": { + "0": 315, + "1": 178 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "Screencap_mss" + }, + "widgets_values": [ + 0, + 0, + 512, + 512, + 1, + 0.1 + ] + }, + { + "id": 198, + "type": "PreviewImage", + "pos": [ + 413, + -826 + ], + "size": { + "0": 521.2196044921875, + "1": 566.1187133789062 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 470 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 196, + "type": "LoadImage", + "pos": [ + -1058, + -623 + ], + "size": { + "0": 315, + "1": 314 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 466 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "Mona-Lisa-oil-wood-panel-Leonardo-da.webp", + "image" + ] + }, + { + "id": 205, + "type": "WebcamCaptureCV2", + "pos": [ + -577, + -283 + ], + "size": { + "0": 315, + "1": 178 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 479 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "WebcamCaptureCV2" + }, + "widgets_values": [ + 0, + 0, + 512, + 512, + 0, + false + ] + }, { "id": 190, "type": "LivePortraitProcess", "pos": [ - 563, - -418 + -79, + -552 ], "size": { "0": 430.8000183105469, "1": 282 }, "flags": {}, - "order": 7, + "order": 9, "mode": 0, "inputs": [ { @@ -273,7 +391,8 @@ { "name": "driving_images", "type": "IMAGE", - "link": 477 + "link": 479, + "slot_index": 3 }, { "name": "opt_retargeting_info", @@ -305,88 +424,26 @@ "widgets_values": [ false, 0.03, - false, + true, 1, "constant", "single_frame", 0.000003 ] }, - { - "id": 198, - "type": "PreviewImage", - "pos": [ - 1027, - -409 - ], - "size": { - "0": 521.2196044921875, - "1": 566.1187133789062 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 470 - } - ], - "properties": { - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 203, - "type": "Screencap_mss", - "pos": [ - 5, - -277 - ], - "size": { - "0": 315, - "1": 178 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 477 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Screencap_mss" - }, - "widgets_values": [ - 0, - 0, - 512, - 512, - 1, - 0.1 - ] - }, { "id": 189, "type": "LivePortraitCropper", "pos": [ - -48, - -851 + -73, + -876 ], "size": { "0": 330, "1": 242 }, "flags": {}, - "order": 6, + "order": 8, "mode": 0, "inputs": [ { @@ -398,7 +455,8 @@ { "name": "cropper", "type": "LPCROPPER", - "link": 444 + "link": 478, + "slot_index": 1 }, { "name": "source_image", @@ -429,9 +487,9 @@ }, "widgets_values": [ 512, - 2.3, - 0, - -0.125, + 2.34, + 0.099, + 0.148, 0, "large-small", false @@ -447,14 +505,6 @@ 0, "IMAGE" ], - [ - 444, - 129, - 0, - 189, - 1, - "LPCROPPER" - ], [ 445, 78, @@ -512,8 +562,16 @@ "IMAGE" ], [ - 477, - 203, + 478, + 204, + 0, + 189, + 1, + "LPCROPPER" + ], + [ + 479, + 205, 0, 190, 3, @@ -526,8 +584,8 @@ "ds": { "scale": 0.7513148009015781, "offset": { - "0": 1170.2642381365986, - "1": 992.3601372540302 + "0": 1468.4081568988054, + "1": 1224.8414164288351 } } }, diff --git a/examples/liveportrait_video_example_02.json b/examples/liveportrait_video_example_02.json index 5689f4a..50c94e1 100644 --- a/examples/liveportrait_video_example_02.json +++ b/examples/liveportrait_video_example_02.json @@ -1,60 +1,7 @@ { - "last_node_id": 195, - "last_link_id": 467, + "last_node_id": 198, + "last_link_id": 477, "nodes": [ - { - "id": 81, - "type": "GrowMaskWithBlur", - "pos": [ - 80, - 441 - ], - "size": { - "0": 315, - "1": 246 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "mask", - "type": "MASK", - "link": 192, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "mask", - "type": "MASK", - "links": [ - 187 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "mask_inverted", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GrowMaskWithBlur" - }, - "widgets_values": [ - 0, - 0, - true, - false, - 13.9, - 1, - 1, - false - ] - }, { "id": 165, "type": "ImageResizeKJ", @@ -67,7 +14,7 @@ "1": 242 }, "flags": {}, - "order": 12, + "order": 14, "mode": 0, "inputs": [ { @@ -133,53 +80,19 @@ 0 ] }, - { - "id": 129, - "type": "LivePortraitLoadCropper", - "pos": [ - -1253, - -757 - ], - "size": { - "0": 315, - "1": 82 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "cropper", - "type": "LPCROPPER", - "links": [ - 444, - 464 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LivePortraitLoadCropper" - }, - "widgets_values": [ - "CPU", - true - ] - }, { "id": 82, "type": "MaskPreview+", "pos": [ - 436, - 434 + 1410, + -810 ], "size": { "0": 210, "1": 246 }, "flags": {}, - "order": 10, + "order": 12, "mode": 0, "inputs": [ { @@ -196,15 +109,15 @@ "id": 83, "type": "CreateShapeMask", "pos": [ - -283, - 441 + 690, + -800 ], "size": { "0": 315, "1": 270 }, "flags": {}, - "order": 1, + "order": 0, "mode": 0, "outputs": [ { @@ -250,7 +163,7 @@ "1": 82 }, "flags": {}, - "order": 2, + "order": 1, "mode": 0, "outputs": [ { @@ -287,7 +200,7 @@ "1": 86 }, "flags": {}, - "order": 11, + "order": 13, "mode": 0, "inputs": [ { @@ -301,7 +214,6 @@ "name": "image", "type": "IMAGE", "links": [ - 443, 451, 465 ], @@ -331,144 +243,6 @@ "Node name for S&R": "GetImageSizeAndCount" } }, - { - "id": 134, - "type": "GetImageSizeAndCount", - "pos": [ - -193, - 182 - ], - "size": { - "0": 210, - "1": 86 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": null - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [], - "shape": 3, - "slot_index": 0 - }, - { - "name": "256 width", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "256 height", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "128 count", - "type": "INT", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GetImageSizeAndCount" - } - }, - { - "id": 188, - "type": "Note", - "pos": [ - 39, - 137 - ], - "size": { - "0": 229.1644287109375, - "1": 95.92726135253906 - }, - "flags": {}, - "order": 4, - "mode": 0, - "properties": { - "text": "" - }, - "widgets_values": [ - "If you want to crop your driving video, use this as driving_images instead" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 189, - "type": "LivePortraitCropper", - "pos": [ - -3, - -755 - ], - "size": { - "0": 330, - "1": 242 - }, - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "pipeline", - "type": "LIVEPORTRAITPIPE", - "link": 446, - "slot_index": 0 - }, - { - "name": "cropper", - "type": "LPCROPPER", - "link": 444 - }, - { - "name": "source_image", - "type": "IMAGE", - "link": 445 - } - ], - "outputs": [ - { - "name": "cropped_image", - "type": "IMAGE", - "links": null, - "shape": 3, - "slot_index": 0 - }, - { - "name": "crop_info", - "type": "CROPINFO", - "links": [ - 449 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LivePortraitCropper" - }, - "widgets_values": [ - 512, - 2.3, - 0, - -0.125, - 0, - "large-small", - true - ] - }, { "id": 78, "type": "GetImageSizeAndCount", @@ -481,7 +255,7 @@ "1": 86 }, "flags": {}, - "order": 16, + "order": 18, "mode": 0, "inputs": [ { @@ -508,7 +282,7 @@ "shape": 3 }, { - "name": "540 height", + "name": "580 height", "type": "INT", "links": null, "shape": 3 @@ -536,7 +310,7 @@ 26 ], "flags": {}, - "order": 19, + "order": 22, "mode": 0, "inputs": [ { @@ -561,151 +335,6 @@ "horizontal": false } }, - { - "id": 191, - "type": "LivePortraitComposite", - "pos": [ - 1025, - -464 - ], - "size": { - "0": 355.20001220703125, - "1": 86 - }, - "flags": {}, - "order": 21, - "mode": 0, - "inputs": [ - { - "name": "source_image", - "type": "IMAGE", - "link": 457 - }, - { - "name": "cropped_image", - "type": "IMAGE", - "link": 454 - }, - { - "name": "liveportrait_out", - "type": "LP_OUT", - "link": 452 - }, - { - "name": "mask", - "type": "MASK", - "link": null - } - ], - "outputs": [ - { - "name": "full_images", - "type": "IMAGE", - "links": [ - 458 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "mask", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LivePortraitComposite" - } - }, - { - "id": 181, - "type": "GetImageSizeAndCount", - "pos": [ - 1379, - -286 - ], - "size": { - "0": 210, - "1": 86 - }, - "flags": {}, - "order": 22, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 458 - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 440 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "1024 width", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "540 height", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "128 count", - "type": "INT", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "GetImageSizeAndCount" - } - }, - { - "id": 1, - "type": "DownloadAndLoadLivePortraitModels", - "pos": [ - -1244, - -870 - ], - "size": { - "0": 302.43463134765625, - "1": 58 - }, - "flags": {}, - "order": 5, - "mode": 0, - "outputs": [ - { - "name": "live_portrait_pipe", - "type": "LIVEPORTRAITPIPE", - "links": [ - 446, - 448, - 466 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DownloadAndLoadLivePortraitModels" - }, - "widgets_values": [ - "fp16" - ] - }, { "id": 8, "type": "VHS_LoadVideo", @@ -718,7 +347,7 @@ 572.1555480957031 ], "flags": {}, - "order": 8, + "order": 9, "mode": 0, "inputs": [ { @@ -797,228 +426,6 @@ } } }, - { - "id": 168, - "type": "VHS_VideoCombine", - "pos": [ - 1495, - -143 - ], - "size": [ - 1103.3974609375, - 693.5853313577586 - ], - "flags": {}, - "order": 24, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 441 - }, - { - "name": "audio", - "type": "VHS_AUDIO", - "link": 462 - }, - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "link": null - }, - { - "name": "vae", - "type": "VAE", - "link": null - }, - { - "name": "frame_rate", - "type": "FLOAT", - "link": 460, - "widget": { - "name": "frame_rate" - }, - "slot_index": 4 - } - ], - "outputs": [ - { - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null, - "shape": 3 - } - ], - "properties": { - "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, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "LivePortrait_00005.mp4", - "subfolder": "", - "type": "temp", - "format": "video/h264-mp4", - "frame_rate": 25 - } - } - } - }, - { - "id": 186, - "type": "ImageConcanate", - "pos": [ - 1019, - 28 - ], - "size": { - "0": 315, - "1": 102 - }, - "flags": {}, - "order": 23, - "mode": 0, - "inputs": [ - { - "name": "image1", - "type": "IMAGE", - "link": 443 - }, - { - "name": "image2", - "type": "IMAGE", - "link": 440 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 441 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImageConcanate" - }, - "widgets_values": [ - "right", - true - ] - }, - { - "id": 146, - "type": "VHS_LoadVideo", - "pos": [ - -1271, - -572 - ], - "size": [ - 340.1555480957031, - 420.83202731609344 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "link": null - }, - { - "name": "vae", - "type": "VAE", - "link": null - }, - { - "name": "frame_load_cap", - "type": "INT", - "link": 324, - "widget": { - "name": "frame_load_cap" - }, - "slot_index": 2 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 433 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "frame_count", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "audio", - "type": "VHS_AUDIO", - "links": [ - 461 - ], - "shape": 3, - "slot_index": 2 - }, - { - "name": "video_info", - "type": "VHS_VIDEOINFO", - "links": [ - 459 - ], - "shape": 3, - "slot_index": 3 - } - ], - "properties": { - "Node name for S&R": "VHS_LoadVideo" - }, - "widgets_values": { - "video": "4098429-uhd_4096_2160_25fps.mp4", - "force_rate": 0, - "force_size": "Disabled", - "custom_width": 512, - "custom_height": 512, - "frame_load_cap": 128, - "skip_first_frames": 0, - "select_every_nth": 1, - "choose video to upload": "image", - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "frame_load_cap": 128, - "skip_first_frames": 0, - "force_rate": 0, - "filename": "4098429-uhd_4096_2160_25fps.mp4", - "type": "input", - "format": "video/mp4", - "select_every_nth": 1 - } - } - } - }, { "id": 193, "type": "VHS_VideoInfo", @@ -1033,7 +440,7 @@ "flags": { "collapsed": true }, - "order": 14, + "order": 16, "mode": 0, "inputs": [ { @@ -1123,7 +530,7 @@ 26 ], "flags": {}, - "order": 13, + "order": 15, "mode": 0, "inputs": [ { @@ -1159,7 +566,7 @@ "1": 58 }, "flags": {}, - "order": 6, + "order": 2, "mode": 0, "properties": { "text": "" @@ -1170,109 +577,6 @@ "color": "#432", "bgcolor": "#653" }, - { - "id": 180, - "type": "LivePortraitRetargeting", - "pos": [ - -320, - -311 - ], - "size": { - "0": 430.8000183105469, - "1": 130 - }, - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "driving_crop_info", - "type": "CROPINFO", - "link": 467, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "retargeting_info", - "type": "RETARGETINGINFO", - "links": [], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LivePortraitRetargeting" - }, - "widgets_values": [ - true, - 1, - true, - 1 - ] - }, - { - "id": 195, - "type": "LivePortraitCropper", - "pos": [ - -636, - 187 - ], - "size": { - "0": 330, - "1": 242 - }, - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "pipeline", - "type": "LIVEPORTRAITPIPE", - "link": 466, - "slot_index": 0 - }, - { - "name": "cropper", - "type": "LPCROPPER", - "link": 464 - }, - { - "name": "source_image", - "type": "IMAGE", - "link": 465 - } - ], - "outputs": [ - { - "name": "cropped_image", - "type": "IMAGE", - "links": null, - "shape": 3 - }, - { - "name": "crop_info", - "type": "CROPINFO", - "links": [ - 467 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LivePortraitCropper" - }, - "widgets_values": [ - 512, - 2.3, - 0, - -0.125, - 0, - "large-small", - true - ] - }, { "id": 190, "type": "LivePortraitProcess", @@ -1285,7 +589,7 @@ "1": 282 }, "flags": {}, - "order": 20, + "order": 23, "mode": 0, "inputs": [ { @@ -1346,6 +650,751 @@ "source_video_smoothed", 0.000003 ] + }, + { + "id": 191, + "type": "LivePortraitComposite", + "pos": [ + 1013, + -440 + ], + "size": { + "0": 355.20001220703125, + "1": 86 + }, + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "source_image", + "type": "IMAGE", + "link": 457 + }, + { + "name": "cropped_image", + "type": "IMAGE", + "link": 454 + }, + { + "name": "liveportrait_out", + "type": "LP_OUT", + "link": 452 + }, + { + "name": "mask", + "type": "MASK", + "link": 471 + } + ], + "outputs": [ + { + "name": "full_images", + "type": "IMAGE", + "links": [ + 458 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LivePortraitComposite" + } + }, + { + "id": 181, + "type": "GetImageSizeAndCount", + "pos": [ + 1400, + -432 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 458 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 469 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "1024 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "580 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "128 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 168, + "type": "VHS_VideoCombine", + "pos": [ + 1012, + -244 + ], + "size": [ + 678.661175161676, + 695.6427014593934 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 469 + }, + { + "name": "audio", + "type": "VHS_AUDIO", + "link": 462 + }, + { + "name": "meta_batch", + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "type": "VAE", + "link": null + }, + { + "name": "frame_rate", + "type": "FLOAT", + "link": 460, + "widget": { + "name": "frame_rate" + }, + "slot_index": 4 + } + ], + "outputs": [ + { + "name": "Filenames", + "type": "VHS_FILENAMES", + "links": null, + "shape": 3 + } + ], + "properties": { + "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, + "pingpong": false, + "save_output": false, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "LivePortrait_00006-audio.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 24.087404244631422 + } + } + } + }, + { + "id": 146, + "type": "VHS_LoadVideo", + "pos": [ + -1271, + -572 + ], + "size": [ + 340.1555480957031, + 433.2201215636055 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "meta_batch", + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "type": "VAE", + "link": null + }, + { + "name": "frame_load_cap", + "type": "INT", + "link": 324, + "widget": { + "name": "frame_load_cap" + }, + "slot_index": 2 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 433 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "frame_count", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "audio", + "type": "VHS_AUDIO", + "links": [ + 461 + ], + "shape": 3, + "slot_index": 2 + }, + { + "name": "video_info", + "type": "VHS_VIDEOINFO", + "links": [ + 459 + ], + "shape": 3, + "slot_index": 3 + } + ], + "properties": { + "Node name for S&R": "VHS_LoadVideo" + }, + "widgets_values": { + "video": "Kung_Fu_Neo_vs_Morpheus_Trim_1.mp4", + "force_rate": 0, + "force_size": "Disabled", + "custom_width": 512, + "custom_height": 512, + "frame_load_cap": 128, + "skip_first_frames": 0, + "select_every_nth": 1, + "choose video to upload": "image", + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "frame_load_cap": 128, + "skip_first_frames": 0, + "force_rate": 0, + "filename": "Kung_Fu_Neo_vs_Morpheus_Trim_1.mp4", + "type": "input", + "format": "video/mp4", + "select_every_nth": 1 + } + } + } + }, + { + "id": 195, + "type": "LivePortraitCropper", + "pos": [ + -636, + 187 + ], + "size": { + "0": 330, + "1": 242 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "LIVEPORTRAITPIPE", + "link": 466, + "slot_index": 0 + }, + { + "name": "cropper", + "type": "LPCROPPER", + "link": 476 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 465 + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": [ + 470 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "links": [ + 467 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LivePortraitCropper" + }, + "widgets_values": [ + 512, + 2.3, + 0, + -0.125, + 0, + "large-small", + true + ] + }, + { + "id": 180, + "type": "LivePortraitRetargeting", + "pos": [ + -265, + 3 + ], + "size": { + "0": 430.8000183105469, + "1": 130 + }, + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "driving_crop_info", + "type": "CROPINFO", + "link": 467, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "retargeting_info", + "type": "RETARGETINGINFO", + "links": [], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitRetargeting" + }, + "widgets_values": [ + true, + 1, + true, + 1 + ] + }, + { + "id": 134, + "type": "GetImageSizeAndCount", + "pos": [ + -241, + 247 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 470 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [], + "shape": 3, + "slot_index": 0 + }, + { + "name": "width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 188, + "type": "Note", + "pos": [ + 13, + 222 + ], + "size": { + "0": 229.1644287109375, + "1": 95.92726135253906 + }, + "flags": {}, + "order": 3, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "If you want to crop your driving video, use this as driving_images instead" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 81, + "type": "GrowMaskWithBlur", + "pos": [ + 1050, + -800 + ], + "size": { + "0": 315, + "1": 246 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 192, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 187, + 471 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "mask_inverted", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GrowMaskWithBlur" + }, + "widgets_values": [ + 0, + 0, + true, + false, + 13.9, + 1, + 1, + false + ] + }, + { + "id": 189, + "type": "LivePortraitCropper", + "pos": [ + -3, + -755 + ], + "size": { + "0": 330, + "1": 242 + }, + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "LIVEPORTRAITPIPE", + "link": 446, + "slot_index": 0 + }, + { + "name": "cropper", + "type": "LPCROPPER", + "link": 477, + "slot_index": 1 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 445 + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": null, + "shape": 3, + "slot_index": 0 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "links": [ + 449 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LivePortraitCropper" + }, + "widgets_values": [ + 512, + 2.3, + 0, + -0.125, + 0, + "large-small", + true + ] + }, + { + "id": 1, + "type": "DownloadAndLoadLivePortraitModels", + "pos": [ + -1247, + -1022 + ], + "size": { + "0": 302.43463134765625, + "1": 58 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "live_portrait_pipe", + "type": "LIVEPORTRAITPIPE", + "links": [ + 446, + 448, + 466 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DownloadAndLoadLivePortraitModels" + }, + "widgets_values": [ + "fp16" + ] + }, + { + "id": 129, + "type": "LivePortraitLoadCropper", + "pos": [ + -1253, + -757 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "links": [], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitLoadCropper" + }, + "widgets_values": [ + "CPU", + true + ] + }, + { + "id": 196, + "type": "LivePortraitLoadMediaPipeCropper", + "pos": [ + -1253, + -896 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "links": [ + 475 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitLoadMediaPipeCropper" + }, + "widgets_values": [ + "CPU", + true + ] + }, + { + "id": 197, + "type": "Reroute", + "pos": [ + -776, + -854 + ], + "size": [ + 115.6, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 475 + } + ], + "outputs": [ + { + "name": "LPCROPPER", + "type": "LPCROPPER", + "links": [ + 476, + 477 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": true, + "horizontal": false + } + }, + { + "id": 198, + "type": "Note", + "pos": [ + -1537, + -865 + ], + "size": { + "0": 265.68304443359375, + "1": 168.53929138183594 + }, + "flags": {}, + "order": 7, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "Choose your face detector here, MediaPipe doesn't run on GPU and isn't as good at detecting, but is faster on CPU and has Apache 2.0 license.\n\nInsightface can be run on GPU and is better at detecting, but it's model license is NON-COMMERCIAL" + ], + "color": "#432", + "bgcolor": "#653" } ], "links": [ @@ -1405,38 +1454,6 @@ 0, "IMAGE" ], - [ - 440, - 181, - 0, - 186, - 1, - "IMAGE" - ], - [ - 441, - 186, - 0, - 168, - 0, - "IMAGE" - ], - [ - 443, - 182, - 0, - 186, - 0, - "IMAGE" - ], - [ - 444, - 129, - 0, - 189, - 1, - "LPCROPPER" - ], [ 445, 78, @@ -1557,14 +1574,6 @@ 1, "VHS_AUDIO" ], - [ - 464, - 129, - 0, - 195, - 1, - "LPCROPPER" - ], [ 465, 182, @@ -1588,16 +1597,64 @@ 180, 0, "CROPINFO" + ], + [ + 469, + 181, + 0, + 168, + 0, + "IMAGE" + ], + [ + 470, + 195, + 0, + 134, + 0, + "IMAGE" + ], + [ + 471, + 81, + 0, + 191, + 3, + "MASK" + ], + [ + 475, + 196, + 0, + 197, + 0, + "*" + ], + [ + 476, + 197, + 0, + 195, + 1, + "LPCROPPER" + ], + [ + 477, + 197, + 0, + 189, + 1, + "LPCROPPER" ] ], "groups": [], "config": {}, "extra": { "ds": { - "scale": 0.6209213230591556, + "scale": 0.6209213230591552, "offset": { - "0": 1561.0563501752945, - "1": 914.6435241564945 + "0": 1804.8014223358243, + "1": 1129.1173424169717 } } },