diff --git a/examples/liveportrait_image_example_01.json b/examples/liveportrait_image_example_01.json new file mode 100644 index 0000000..b741d87 --- /dev/null +++ b/examples/liveportrait_image_example_01.json @@ -0,0 +1,1379 @@ +{ + "last_node_id": 196, + "last_link_id": 466, + "nodes": [ + { + "id": 129, + "type": "LivePortraitLoadCropper", + "pos": [ + -1253, + -757 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "links": [ + 403, + 444 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitLoadCropper" + }, + "widgets_values": [ + "CPU", + 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": [ + 437, + 443, + 451 + ], + "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 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 402 + } + ], + "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": 174, + "type": "LivePortraitCropper", + "pos": [ + -636, + 187 + ], + "size": { + "0": 330, + "1": 246 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "link": 403, + "slot_index": 0 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 437 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": [ + 402 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "links": [ + 426 + ], + "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": [ + -320, + -311 + ], + "size": { + "0": 430.8000183105469, + "1": 130 + }, + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "driving_crop_info", + "type": "CROPINFO", + "link": 426, + "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": 188, + "type": "Note", + "pos": [ + 39, + 137 + ], + "size": { + "0": 229.1644287109375, + "1": 95.92726135253906 + }, + "flags": {}, + "order": 1, + "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": 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", + "pos": [ + -522, + -572 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 434 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 445, + 455 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "512 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "512 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "1 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "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 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DownloadAndLoadLivePortraitModels" + }, + "widgets_values": [ + "fp16" + ] + }, + { + "id": 8, + "type": "VHS_LoadVideo", + "pos": [ + -1253, + 28 + ], + "size": [ + 340.1555480957031, + 572.1555480957031 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "meta_batch", + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "type": "VAE", + "link": null + }, + { + "name": "frame_load_cap", + "type": "INT", + "link": 302, + "widget": { + "name": "frame_load_cap" + } + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 436 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "frame_count", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "audio", + "type": "VHS_AUDIO", + "links": null, + "shape": 3 + }, + { + "name": "video_info", + "type": "VHS_VIDEOINFO", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "VHS_LoadVideo" + }, + "widgets_values": { + "video": "d6.mp4", + "force_rate": 0, + "force_size": "Disabled", + "custom_width": 512, + "custom_height": 512, + "frame_load_cap": 32, + "skip_first_frames": 0, + "select_every_nth": 1, + "choose video to upload": "image", + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "frame_load_cap": 32, + "skip_first_frames": 0, + "force_rate": 0, + "filename": "d6.mp4", + "type": "input", + "format": "video/mp4", + "select_every_nth": 1 + } + } + } + }, + { + "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", + "pos": [ + -873, + -573 + ], + "size": { + "0": 315, + "1": 242 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 466 + }, + { + "name": "get_image_size", + "type": "IMAGE", + "link": null + }, + { + "name": "width_input", + "type": "INT", + "link": null, + "widget": { + "name": "width_input" + } + }, + { + "name": "height_input", + "type": "INT", + "link": null, + "widget": { + "name": "height_input" + } + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 434 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "height", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "ImageResizeKJ" + }, + "widgets_values": [ + 512, + 512, + "lanczos", + true, + 2, + 0, + 0 + ] + }, + { + "id": 196, + "type": "LoadImage", + "pos": [ + -1256, + -572 + ], + "size": [ + 315, + 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": 190, + "type": "LivePortraitProcess", + "pos": [ + 551, + -383 + ], + "size": { + "0": 430.8000183105469, + "1": 282 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "LIVEPORTRAITPIPE", + "link": 448 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "link": 449 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 456 + }, + { + "name": "driving_images", + "type": "IMAGE", + "link": 451 + }, + { + "name": "opt_retargeting_info", + "type": "RETARGETINGINFO", + "link": null + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": [ + 454 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "output", + "type": "LP_OUT", + "links": [ + 452 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LivePortraitProcess" + }, + "widgets_values": [ + false, + 0.03, + true, + 1, + "constant", + "relative", + 0.000003 + ] + }, + { + "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_00001.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 24 + } + } + } + } + ], + "links": [ + [ + 187, + 81, + 0, + 82, + 0, + "MASK" + ], + [ + 192, + 83, + 0, + 81, + 0, + "MASK" + ], + [ + 302, + 133, + 0, + 8, + 2, + "INT" + ], + [ + 402, + 174, + 0, + 134, + 0, + "IMAGE" + ], + [ + 403, + 129, + 0, + 174, + 0, + "LPCROPPER" + ], + [ + 426, + 174, + 1, + 180, + 0, + "CROPINFO" + ], + [ + 434, + 165, + 0, + 78, + 0, + "IMAGE" + ], + [ + 436, + 8, + 0, + 182, + 0, + "IMAGE" + ], + [ + 437, + 182, + 0, + 174, + 1, + "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, + 0, + 189, + 2, + "IMAGE" + ], + [ + 446, + 1, + 0, + 189, + 0, + "LIVEPORTRAITPIPE" + ], + [ + 448, + 1, + 0, + 190, + 0, + "LIVEPORTRAITPIPE" + ], + [ + 449, + 189, + 1, + 190, + 1, + "CROPINFO" + ], + [ + 451, + 182, + 0, + 190, + 3, + "IMAGE" + ], + [ + 452, + 190, + 1, + 191, + 2, + "LP_OUT" + ], + [ + 454, + 190, + 0, + 191, + 1, + "IMAGE" + ], + [ + 455, + 78, + 0, + 192, + 0, + "*" + ], + [ + 456, + 192, + 0, + 190, + 2, + "IMAGE" + ], + [ + 457, + 192, + 0, + 191, + 0, + "IMAGE" + ], + [ + 458, + 191, + 0, + 181, + 0, + "IMAGE" + ], + [ + 463, + 81, + 0, + 191, + 3, + "MASK" + ], + [ + 466, + 196, + 0, + 165, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.5644739300537774, + "offset": { + "0": 1531.7385101344028, + "1": 1081.4586534396992 + } + } + }, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/liveportrait_realtime_example_01.json b/examples/liveportrait_realtime_example_01.json new file mode 100644 index 0000000..38f1cf2 --- /dev/null +++ b/examples/liveportrait_realtime_example_01.json @@ -0,0 +1,631 @@ +{ + "last_node_id": 202, + "last_link_id": 476, + "nodes": [ + { + "id": 129, + "type": "LivePortraitLoadCropper", + "pos": [ + -1050, + -740 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "cropper", + "type": "LPCROPPER", + "links": [ + 444 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LivePortraitLoadCropper" + }, + "widgets_values": [ + "CPU", + true + ] + }, + { + "id": 1, + "type": "DownloadAndLoadLivePortraitModels", + "pos": [ + -1040, + -850 + ], + "size": { + "0": 302.43463134765625, + "1": 58 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "live_portrait_pipe", + "type": "LIVEPORTRAITPIPE", + "links": [ + 446, + 448 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DownloadAndLoadLivePortraitModels" + }, + "widgets_values": [ + "fp16" + ] + }, + { + "id": 165, + "type": "ImageResizeKJ", + "pos": [ + -670, + -560 + ], + "size": { + "0": 315, + "1": 242 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 466 + }, + { + "name": "get_image_size", + "type": "IMAGE", + "link": null + }, + { + "name": "width_input", + "type": "INT", + "link": null, + "widget": { + "name": "width_input" + } + }, + { + "name": "height_input", + "type": "INT", + "link": null, + "widget": { + "name": "height_input" + } + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 434 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "height", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "ImageResizeKJ" + }, + "widgets_values": [ + 512, + 512, + "lanczos", + true, + 2, + 0, + 0 + ] + }, + { + "id": 196, + "type": "LoadImage", + "pos": [ + -1050, + -550 + ], + "size": [ + 315, + 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": 199, + "type": "GetImageSizeAndCount", + "pos": [ + 202, + -239 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 474 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 472 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "512 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "512 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "1 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 78, + "type": "GetImageSizeAndCount", + "pos": [ + -310, + -550 + ], + "size": { + "0": 210, + "1": 86 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 434 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 445, + 475 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "512 width", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "512 height", + "type": "INT", + "links": null, + "shape": 3 + }, + { + "name": "1 count", + "type": "INT", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "GetImageSizeAndCount" + } + }, + { + "id": 189, + "type": "LivePortraitCropper", + "pos": [ + -48, + -851 + ], + "size": { + "0": 330, + "1": 242 + }, + "flags": {}, + "order": 8, + "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": 202, + "type": "PreviewImage", + "pos": [ + 147.3814710186748, + -76.18841642883467 + ], + "size": { + "0": 521.2196044921875, + "1": 566.1187133789062 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 476 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 201, + "type": "ImageGrabPIL", + "pos": [ + -208, + -232 + ], + "size": { + "0": 315, + "1": 178 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 474, + 476 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageGrabPIL" + }, + "widgets_values": [ + 0, + 0, + 512, + 512, + 1, + 0.1 + ] + }, + { + "id": 190, + "type": "LivePortraitProcess", + "pos": [ + 563, + -418 + ], + "size": { + "0": 430.8000183105469, + "1": 282 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "LIVEPORTRAITPIPE", + "link": 448 + }, + { + "name": "crop_info", + "type": "CROPINFO", + "link": 449 + }, + { + "name": "source_image", + "type": "IMAGE", + "link": 475 + }, + { + "name": "driving_images", + "type": "IMAGE", + "link": 472 + }, + { + "name": "opt_retargeting_info", + "type": "RETARGETINGINFO", + "link": null + } + ], + "outputs": [ + { + "name": "cropped_image", + "type": "IMAGE", + "links": [ + 470 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "output", + "type": "LP_OUT", + "links": [], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LivePortraitProcess" + }, + "widgets_values": [ + false, + 0.03, + false, + 1, + "constant", + "single_frame", + 0.000003 + ] + }, + { + "id": 198, + "type": "PreviewImage", + "pos": [ + 1027, + -409 + ], + "size": [ + 521.2195999999999, + 566.1186964538573 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 470 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + } + ], + "links": [ + [ + 434, + 165, + 0, + 78, + 0, + "IMAGE" + ], + [ + 444, + 129, + 0, + 189, + 1, + "LPCROPPER" + ], + [ + 445, + 78, + 0, + 189, + 2, + "IMAGE" + ], + [ + 446, + 1, + 0, + 189, + 0, + "LIVEPORTRAITPIPE" + ], + [ + 448, + 1, + 0, + 190, + 0, + "LIVEPORTRAITPIPE" + ], + [ + 449, + 189, + 1, + 190, + 1, + "CROPINFO" + ], + [ + 466, + 196, + 0, + 165, + 0, + "IMAGE" + ], + [ + 470, + 190, + 0, + 198, + 0, + "IMAGE" + ], + [ + 472, + 199, + 0, + 190, + 3, + "IMAGE" + ], + [ + 474, + 201, + 0, + 199, + 0, + "IMAGE" + ], + [ + 475, + 78, + 0, + 190, + 2, + "IMAGE" + ], + [ + 476, + 201, + 0, + 202, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.7513148009015781, + "offset": { + "0": 1419.6048777240007, + "1": 976.38813725403 + } + } + }, + "version": 0.4 +} \ No newline at end of file diff --git a/liveportrait/utils/crop.py b/liveportrait/utils/crop.py index b88fb13..567e54d 100644 --- a/liveportrait/utils/crop.py +++ b/liveportrait/utils/crop.py @@ -155,7 +155,14 @@ def parse_pt2_from_pt9(pt9, use_lip=True): def parse_pt2_from_pt68(pt68, use_lip=True): ''' -face = {"keypoints": ['right cheekbone 1', 'right cheekbone 2', 'right cheek 1', 'right cheek 2', 'right cheek 3', 'right cheek 4', 'right cheek 5', 'right chin', 'chin center', 'left chin', 'left cheek 5', 'left cheek 4', 'left cheek 3', 'left cheek 2', 'left cheek 1', 'left cheekbone 2', 'left cheekbone 1', 'right eyebrow 1', 'right eyebrow 2', 'right eyebrow 3', 'right eyebrow 4', 'right eyebrow 5', 'left eyebrow 1', 'left eyebrow 2', 'left eyebrow 3', 'left eyebrow 4', 'left eyebrow 5', 'nasal bridge 1', 'nasal bridge 2', 'nasal bridge 3', 'nasal bridge 4', 'right nasal wing 1', 'right nasal wing 2', 'nasal wing center', 'left nasal wing 1', 'left nasal wing 2', 'right eye eye corner 1', 'right eye upper eyelid 1', 'right eye upper eyelid 2', 'right eye eye corner 2', 'right eye lower eyelid 2', 'right eye lower eyelid 1', 'left eye eye corner 1', 'left eye upper eyelid 1', 'left eye upper eyelid 2', 'left eye eye corner 2', 'left eye lower eyelid 2', 'left eye lower eyelid 1', 'right mouth corner', 'upper lip outer edge 1', 'upper lip outer edge 2', 'upper lip outer edge 3', 'upper lip outer edge 4', 'upper lip outer edge 5', 'left mouth corner', 'lower lip outer edge 5', 'lower lip outer edge 4', 'lower lip outer edge 3', 'lower lip outer edge 2', 'lower lip outer edge 1', 'upper lip inter edge 1', 'upper lip inter edge 2', 'upper lip inter edge 3', 'upper lip inter edge 4', 'upper lip inter edge 5', 'lower lip inter edge 3', 'lower lip inter edge 2', 'lower lip inter edge 1'], "skeleton": []} +face = {"keypoints": ['right cheekbone 1', 'right cheekbone 2', 'right cheek 1', 'right cheek 2', 'right cheek 3', 'right cheek 4', 'right cheek 5', 'right chin', 'chin center', +'left chin', 'left cheek 5', 'left cheek 4', 'left cheek 3', 'left cheek 2', 'left cheek 1', 'left cheekbone 2', 'left cheekbone 1', 'right eyebrow 1', 'right eyebrow 2', 'right eyebrow 3', +'right eyebrow 4', 'right eyebrow 5', 'left eyebrow 1', 'left eyebrow 2', 'left eyebrow 3', 'left eyebrow 4', 'left eyebrow 5', 'nasal bridge 1', 'nasal bridge 2', 'nasal bridge 3', 'nasal bridge 4', +'right nasal wing 1', 'right nasal wing 2', 'nasal wing center', 'left nasal wing 1', 'left nasal wing 2', 'right eye eye corner 1', 'right eye upper eyelid 1', 'right eye upper eyelid 2', +'right eye eye corner 2', 'right eye lower eyelid 2', 'right eye lower eyelid 1', 'left eye eye corner 1', 'left eye upper eyelid 1', 'left eye upper eyelid 2', 'left eye eye corner 2', 'left eye lower eyelid 2', +'left eye lower eyelid 1', 'right mouth corner', 'upper lip outer edge 1', 'upper lip outer edge 2', 'upper lip outer edge 3', 'upper lip outer edge 4', 'upper lip outer edge 5', 'left mouth corner', +'lower lip outer edge 5', 'lower lip outer edge 4', 'lower lip outer edge 3', 'lower lip outer edge 2', 'lower lip outer edge 1', 'upper lip inter edge 1', 'upper lip inter edge 2', 'upper lip inter edge 3', +'upper lip inter edge 4', 'upper lip inter edge 5', 'lower lip inter edge 3', 'lower lip inter edge 2', 'lower lip inter edge 1'], "skeleton": []} ''' @@ -456,4 +463,3 @@ def average_bbox_lst(bbox_lst): return None bbox_arr = np.array(bbox_lst) return np.mean(bbox_arr, axis=0).tolist() -