From 7eafe77ba019f35c6785b66486f8313bae583b3b Mon Sep 17 00:00:00 2001 From: kabachuha Date: Tue, 16 Sep 2025 21:07:39 +0300 Subject: [PATCH 01/10] update magcache ratios --- nodes_model_loading.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nodes_model_loading.py b/nodes_model_loading.py index ccae150..4de8219 100644 --- a/nodes_model_loading.py +++ b/nodes_model_loading.py @@ -1177,6 +1177,15 @@ class WanVideoModelLoader: "e": [-114.36346466, 65.26524496, -18.82220707, 4.91518089, -0.23412683], "e0": [8.10705460e+03, 2.13393892e+03, -3.72934672e+02, 1.66203073e+01, -4.17769401e-02], }, + # Placeholders until TeaCache for Wan2.2 is obtained + "14B_2.2": { + "e": [-5784.54975374, 5449.50911966, -1811.16591783, 256.27178429, -13.02252404], + "e0": [-3.03318725e+05, 4.90537029e+04, -2.65530556e+03, 5.87365115e+01, -3.15583525e-01], + }, + "i2v_14B_2.2":{ + "e": [-114.36346466, 65.26524496, -18.82220707, 4.91518089, -0.23412683], + "e0": [8.10705460e+03, 2.13393892e+03, -3.72934672e+02, 1.66203073e+01, -4.17769401e-02], + }, } magcache_ratios_map = { @@ -1184,6 +1193,8 @@ class WanVideoModelLoader: "14B": np.array([1.0]*2+[1.02504, 1.03017, 1.00025, 1.00251, 0.9985, 0.99962, 0.99779, 0.99771, 0.9966, 0.99658, 0.99482, 0.99476, 0.99467, 0.99451, 0.99664, 0.99656, 0.99434, 0.99431, 0.99533, 0.99545, 0.99468, 0.99465, 0.99438, 0.99434, 0.99516, 0.99517, 0.99384, 0.9938, 0.99404, 0.99401, 0.99517, 0.99516, 0.99409, 0.99408, 0.99428, 0.99426, 0.99347, 0.99343, 0.99418, 0.99416, 0.99271, 0.99269, 0.99313, 0.99311, 0.99215, 0.99215, 0.99218, 0.99215, 0.99216, 0.99217, 0.99163, 0.99161, 0.99138, 0.99135, 0.98982, 0.9898, 0.98996, 0.98995, 0.9887, 0.98866, 0.98772, 0.9877, 0.98767, 0.98765, 0.98573, 0.9857, 0.98501, 0.98498, 0.9838, 0.98376, 0.98177, 0.98173, 0.98037, 0.98035, 0.97678, 0.97677, 0.97546, 0.97543, 0.97184, 0.97183, 0.96711, 0.96708, 0.96349, 0.96345, 0.95629, 0.95625, 0.94926, 0.94929, 0.93964, 0.93961, 0.92511, 0.92504, 0.90693, 0.90678, 0.8796, 0.87945, 0.86111, 0.86189]), "i2v_480": np.array([1.0]*2+[0.98783, 0.98993, 0.97559, 0.97593, 0.98311, 0.98319, 0.98202, 0.98225, 0.9888, 0.98878, 0.98762, 0.98759, 0.98957, 0.98971, 0.99052, 0.99043, 0.99383, 0.99384, 0.98857, 0.9886, 0.99065, 0.99068, 0.98845, 0.98847, 0.99057, 0.99057, 0.98957, 0.98961, 0.98601, 0.9861, 0.98823, 0.98823, 0.98756, 0.98759, 0.98808, 0.98814, 0.98721, 0.98724, 0.98571, 0.98572, 0.98543, 0.98544, 0.98157, 0.98165, 0.98411, 0.98413, 0.97952, 0.97953, 0.98149, 0.9815, 0.9774, 0.97742, 0.97825, 0.97826, 0.97355, 0.97361, 0.97085, 0.97087, 0.97056, 0.97055, 0.96588, 0.96587, 0.96113, 0.96124, 0.9567, 0.95681, 0.94961, 0.94969, 0.93973, 0.93988, 0.93217, 0.93224, 0.91878, 0.91896, 0.90955, 0.90954, 0.92617, 0.92616]), "i2v_720": np.array([1.0]*2+[0.99428, 0.99498, 0.98588, 0.98621, 0.98273, 0.98281, 0.99018, 0.99023, 0.98911, 0.98917, 0.98646, 0.98652, 0.99454, 0.99456, 0.9891, 0.98909, 0.99124, 0.99127, 0.99102, 0.99103, 0.99215, 0.99212, 0.99515, 0.99515, 0.99576, 0.99572, 0.99068, 0.99072, 0.99097, 0.99097, 0.99166, 0.99169, 0.99041, 0.99042, 0.99201, 0.99198, 0.99101, 0.99101, 0.98599, 0.98603, 0.98845, 0.98844, 0.98848, 0.98851, 0.98862, 0.98857, 0.98718, 0.98719, 0.98497, 0.98497, 0.98264, 0.98263, 0.98389, 0.98393, 0.97938, 0.9794, 0.97535, 0.97536, 0.97498, 0.97499, 0.973, 0.97301, 0.96827, 0.96828, 0.96261, 0.96263, 0.95335, 0.9534, 0.94649, 0.94655, 0.93397, 0.93414, 0.91636, 0.9165, 0.89088, 0.89109, 0.8679, 0.86768]), + "14B_2.2": np.array([1.0]*2+[0.99505, 0.99389, 0.99441, 0.9957, 0.99558, 0.99551, 0.99499, 0.9945, 0.99534, 0.99548, 0.99468, 0.9946, 0.99463, 0.99458, 0.9946, 0.99453, 0.99408, 0.99404, 0.9945, 0.99441, 0.99409, 0.99398, 0.99403, 0.99397, 0.99382, 0.99377, 0.99349, 0.99343, 0.99377, 0.99378, 0.9933, 0.99328, 0.99303, 0.99301, 0.99217, 0.99216, 0.992, 0.99201, 0.99201, 0.99202, 0.99133, 0.99132, 0.99112, 0.9911, 0.99155, 0.99155, 0.98958, 0.98957, 0.98959, 0.98958, 0.98838, 0.98835, 0.98826, 0.98825, 0.9883, 0.98828, 0.98711, 0.98709, 0.98562, 0.98561, 0.98511, 0.9851, 0.98414, 0.98412, 0.98284, 0.98282, 0.98104, 0.98101, 0.97981, 0.97979, 0.97849, 0.97849, 0.97557, 0.97554, 0.97398, 0.97395, 0.97171, 0.97166, 0.96917, 0.96913, 0.96511, 0.96507, 0.96263, 0.96257, 0.95839, 0.95835, 0.95483, 0.95475, 0.94942, 0.94936, 0.9468, 0.94678, 0.94583, 0.94594, 0.94843, 0.94872, 0.96949, 0.97015]), + "i2v_14B_2.2": np.array([1.0]*2+[0.99512, 0.99559, 0.99559, 0.99561, 0.99595, 0.99577, 0.99512, 0.99512, 0.99546, 0.99534, 0.99543, 0.99531, 0.99496, 0.99491, 0.99504, 0.99499, 0.99444, 0.99449, 0.99481, 0.99481, 0.99435, 0.99435, 0.9943, 0.99431, 0.99411, 0.99406, 0.99373, 0.99376, 0.99413, 0.99405, 0.99363, 0.99359, 0.99335, 0.99331, 0.99244, 0.99243, 0.99229, 0.99229, 0.99239, 0.99236, 0.99163, 0.9916, 0.99149, 0.99151, 0.99191, 0.99192, 0.9898, 0.98981, 0.9899, 0.98987, 0.98849, 0.98849, 0.98846, 0.98846, 0.98861, 0.98861, 0.9874, 0.98738, 0.98588, 0.98589, 0.98539, 0.98534, 0.98444, 0.98439, 0.9831, 0.98309, 0.98119, 0.98118, 0.98001, 0.98, 0.97862, 0.97859, 0.97555, 0.97558, 0.97392, 0.97388, 0.97152, 0.97145, 0.96871, 0.9687, 0.96435, 0.96434, 0.96129, 0.96127, 0.95639, 0.95638, 0.95176, 0.95175, 0.94446, 0.94452, 0.93972, 0.93974, 0.93575, 0.9359, 0.93537, 0.93552, 0.96655, 0.96616]), } model_variant = "14B" #default to this @@ -1199,6 +1210,13 @@ class WanVideoModelLoader: model_variant = "1_3B" if dim == 3072: log.info(f"5B model detected, no Teacache or MagCache coefficients available, consider using EasyCache for this model") + + if "high" in model.lower() or "low" in model.lower(): + if "i2v" in model.lower(): + model_variant = "i2v_14B_2.2" + else: + model_variant = "14B_2.2" + log.info(f"Model variant detected: {model_variant}") TRANSFORMER_CONFIG= { From 700aae60afff23b21be8eda68e4cdd2994e0dae4 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:31:31 +0300 Subject: [PATCH 02/10] Add example for WanAnimate with the new preprocessor --- ...ideo_WanAnimate_preprocess_example_02.json | 3850 +++++++++++++++++ 1 file changed, 3850 insertions(+) create mode 100644 example_workflows/wanvideo_WanAnimate_preprocess_example_02.json diff --git a/example_workflows/wanvideo_WanAnimate_preprocess_example_02.json b/example_workflows/wanvideo_WanAnimate_preprocess_example_02.json new file mode 100644 index 0000000..b4203d3 --- /dev/null +++ b/example_workflows/wanvideo_WanAnimate_preprocess_example_02.json @@ -0,0 +1,3850 @@ +{ + "id": "8b7a9a57-2303-4ef5-9fc2-bf41713bd1fc", + "revision": 0, + "last_node_id": 185, + "last_link_id": 321, + "nodes": [ + { + "id": 66, + "type": "ImageConcatMulti", + "pos": [ + 2660.1005859375, + -950.2750244140625 + ], + "size": [ + 270, + 150 + ], + "flags": {}, + "order": 59, + "mode": 0, + "inputs": [ + { + "name": "image_1", + "type": "IMAGE", + "link": 87 + }, + { + "name": "image_2", + "shape": 7, + "type": "IMAGE", + "link": 107 + } + ], + "outputs": [ + { + "name": "images", + "type": "IMAGE", + "links": [ + 89 + ] + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "468fcc86f0b29e79a8510e8239eb15714d6747a6" + }, + "widgets_values": [ + 2, + "left", + true, + null + ] + }, + { + "id": 137, + "type": "GetNode", + "pos": [ + 2441.813232421875, + -1173.92919921875 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 239 + ] + } + ], + "title": "Get_face_images", + "properties": {}, + "widgets_values": [ + "face_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 140, + "type": "GetNode", + "pos": [ + 2441.813232421875, + -1124.576904296875 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 243 + ] + } + ], + "title": "Get_pose_images", + "properties": {}, + "widgets_values": [ + "pose_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 134, + "type": "GetNode", + "pos": [ + 2443.561279296875, + -1227.2171630859375 + ], + "size": [ + 210, + 34 + ], + "flags": { + "collapsed": true + }, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 236 + ] + } + ], + "title": "Get_reference_image", + "properties": {}, + "widgets_values": [ + "reference_image" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 148, + "type": "SetNode", + "pos": [ + -548.7736206054688, + -2964.476318359375 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "AUDIO", + "type": "AUDIO", + "link": 255 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_input_audio", + "properties": { + "previousName": "input_audio" + }, + "widgets_values": [ + "input_audio" + ] + }, + { + "id": 149, + "type": "GetNode", + "pos": [ + 3043.859130859375, + -1156.882080078125 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "AUDIO", + "type": "AUDIO", + "links": [ + 256 + ] + } + ], + "title": "Get_input_audio", + "properties": {}, + "widgets_values": [ + "input_audio" + ] + }, + { + "id": 153, + "type": "SetNode", + "pos": [ + -1605.1839599609375, + -2832.218994140625 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "INT", + "type": "INT", + "link": 263 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_width", + "properties": { + "previousName": "width" + }, + "widgets_values": [ + "width" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 155, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -167.58360290527344 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 265 + ] + } + ], + "title": "Get_width", + "properties": {}, + "widgets_values": [ + "width" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 156, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -117.76973724365234 + ], + "size": [ + 210, + 50 + ], + "flags": { + "collapsed": true + }, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 266 + ] + } + ], + "title": "Get_height", + "properties": {}, + "widgets_values": [ + "height" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 154, + "type": "SetNode", + "pos": [ + -1617.8741455078125, + -2533.993408203125 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "INT", + "type": "INT", + "link": 264 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_height", + "properties": { + "previousName": "height" + }, + "widgets_values": [ + "height" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 63, + "type": "VHS_LoadVideo", + "pos": [ + -876.9246826171875, + -3084.905517578125 + ], + "size": [ + 315.8014221191406, + 491.6708679199219 + ], + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "meta_batch", + "shape": 7, + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "name": "custom_width", + "type": "INT", + "widget": { + "name": "custom_width" + }, + "link": 257 + }, + { + "name": "custom_height", + "type": "INT", + "widget": { + "name": "custom_height" + }, + "link": 258 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 248 + ] + }, + { + "name": "frame_count", + "type": "INT", + "links": [ + 267 + ] + }, + { + "name": "audio", + "type": "AUDIO", + "links": [ + 255 + ] + }, + { + "name": "video_info", + "type": "VHS_VIDEOINFO", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "8e4d79471bf1952154768e8435a9300077b534fa", + "Node name for S&R": "VHS_LoadVideo" + }, + "widgets_values": { + "video": "raw.mp4", + "force_rate": 16, + "custom_width": 960, + "custom_height": 544, + "frame_load_cap": 0, + "skip_first_frames": 0, + "select_every_nth": 1, + "format": "AnimateDiff", + "choose video to upload": "image", + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "raw.mp4", + "type": "input", + "format": "video/mp4", + "force_rate": 16, + "custom_width": 960, + "custom_height": 544, + "frame_load_cap": 0, + "skip_first_frames": 0, + "select_every_nth": 1 + } + } + } + }, + { + "id": 158, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -70.84321594238281 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 268 + ] + } + ], + "title": "Get_frame_count", + "properties": {}, + "widgets_values": [ + "frame_count" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 131, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -266.1221923828125 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 234 + ] + } + ], + "title": "Get_background_image", + "properties": {}, + "widgets_values": [ + "background_image" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 143, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -213.2382354736328 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 8, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 247 + ] + } + ], + "title": "Get_mask", + "properties": {}, + "widgets_values": [ + "mask" + ], + "color": "#1c5715", + "bgcolor": "#1f401b" + }, + { + "id": 157, + "type": "SetNode", + "pos": [ + -528.8223266601562, + -3030.21337890625 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "INT", + "type": "INT", + "link": 267 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_frame_count", + "properties": { + "previousName": "frame_count" + }, + "widgets_values": [ + "frame_count" + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 144, + "type": "SetNode", + "pos": [ + -522.720947265625, + -3107.148681640625 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "link": 248 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": [ + 306 + ] + } + ], + "title": "Set_input_video", + "properties": { + "previousName": "input_video" + }, + "widgets_values": [ + "input_video" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 128, + "type": "SetNode", + "pos": [ + -459.54620361328125, + -1650.783935546875 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 46, + "mode": 0, + "inputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "link": 231 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_reference_image", + "properties": { + "previousName": "reference_image" + }, + "widgets_values": [ + "reference_image" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 64, + "type": "ImageResizeKJv2", + "pos": [ + -772.3116455078125, + -1675.555419921875 + ], + "size": [ + 270, + 336 + ], + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 82 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": null + }, + { + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 286 + }, + { + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 287 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 231 + ] + }, + { + "name": "width", + "type": "INT", + "links": [] + }, + { + "name": "height", + "type": "INT", + "links": [] + }, + { + "name": "mask", + "type": "MASK", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "468fcc86f0b29e79a8510e8239eb15714d6747a6", + "Node name for S&R": "ImageResizeKJv2" + }, + "widgets_values": [ + 832, + 480, + "lanczos", + "pad_edge_pixel", + "0, 0, 0", + "top", + 16, + "cpu", + "Output: 1 x 832 x 480 | 4.57MB" + ] + }, + { + "id": 57, + "type": "LoadImage", + "pos": [ + -1116.435791015625, + -1679.51318359375 + ], + "size": [ + 274.080078125, + 314 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 82 + ] + }, + { + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.57", + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "refer.jpeg", + "image" + ] + }, + { + "id": 142, + "type": "SetNode", + "pos": [ + 1086.6927490234375, + -2124.5263671875 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 63, + "mode": 0, + "inputs": [ + { + "name": "MASK", + "type": "MASK", + "link": 245 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 246 + ] + } + ], + "title": "Set_mask", + "properties": { + "previousName": "mask" + }, + "widgets_values": [ + "mask" + ], + "color": "#1c5715", + "bgcolor": "#1f401b" + }, + { + "id": 99, + "type": "DrawMaskOnImage", + "pos": [ + 1222.5340576171875, + -2132.91455078125 + ], + "size": [ + 270, + 78 + ], + "flags": {}, + "order": 64, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 250 + }, + { + "name": "mask", + "type": "MASK", + "link": 246 + } + ], + "outputs": [ + { + "name": "images", + "type": "IMAGE", + "links": [ + 233 + ] + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "623b5913dc7f240fd8b26422e99f8849a21c5473", + "Node name for S&R": "DrawMaskOnImage" + }, + "widgets_values": [ + "0, 0, 0" + ] + }, + { + "id": 146, + "type": "GetNode", + "pos": [ + 1086.932861328125, + -2184.602783203125 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 10, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 250 + ] + } + ], + "title": "Get_input_video", + "properties": {}, + "widgets_values": [ + "input_video" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 130, + "type": "SetNode", + "pos": [ + 1294.1051025390625, + -2211.976806640625 + ], + "size": [ + 211.05747985839844, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 65, + "mode": 0, + "inputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "link": 233 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 251 + ] + } + ], + "title": "Set_background_image", + "properties": { + "previousName": "background_image" + }, + "widgets_values": [ + "background_image" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 163, + "type": "GetNode", + "pos": [ + 1571.3441162109375, + -468.3181457519531 + ], + "size": [ + 210, + 34 + ], + "flags": { + "collapsed": true + }, + "order": 11, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "WANVAE", + "type": "WANVAE", + "links": [ + 280 + ] + } + ], + "title": "Get_VAE", + "properties": {}, + "widgets_values": [ + "VAE" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 71, + "type": "CLIPVisionLoader", + "pos": [ + -512.5712890625, + -245.34796142578125 + ], + "size": [ + 270, + 58 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP_VISION", + "type": "CLIP_VISION", + "links": [ + 97 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.59", + "Node name for S&R": "CLIPVisionLoader" + }, + "widgets_values": [ + "clip_vision_h.safetensors" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 70, + "type": "WanVideoClipVisionEncode", + "pos": [ + 989.1386108398438, + -306.2594299316406 + ], + "size": [ + 280.9771423339844, + 262 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 97 + }, + { + "name": "image_1", + "type": "IMAGE", + "link": 235 + }, + { + "name": "image_2", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "negative_image", + "shape": 7, + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "image_embeds", + "type": "WANVIDIMAGE_CLIPEMBEDS", + "links": [ + 96 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "2bdd81a10b03c14443c79bdf3b783b1feb3d1fa3", + "Node name for S&R": "WanVideoClipVisionEncode" + }, + "widgets_values": [ + 1, + 1, + "center", + "average", + true, + 0, + 0.5 + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 133, + "type": "GetNode", + "pos": [ + 995.1069946289062, + -382.21319580078125 + ], + "size": [ + 210, + 50 + ], + "flags": { + "collapsed": true + }, + "order": 13, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 235, + 282 + ] + } + ], + "title": "Get_reference_image", + "properties": {}, + "widgets_values": [ + "reference_image" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 141, + "type": "GetNode", + "pos": [ + 1320.70703125, + -392.9727478027344 + ], + "size": [ + 210, + 34 + ], + "flags": { + "collapsed": true + }, + "order": 14, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 244 + ] + } + ], + "title": "Get_pose_images", + "properties": {}, + "widgets_values": [ + "pose_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 35, + "type": "WanVideoTorchCompileSettings", + "pos": [ + -1146.0887451171875, + -909.5626831054688 + ], + "size": [ + 390.5999755859375, + 202 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "torch_compile_args", + "type": "WANCOMPILEARGS", + "slot_index": 0, + "links": [ + 100 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoTorchCompileSettings" + }, + "widgets_values": [ + "inductor", + false, + "default", + false, + 64, + true, + 128 + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 38, + "type": "WanVideoVAELoader", + "pos": [ + -569.7952880859375, + -499.9053649902344 + ], + "size": [ + 416.25482177734375, + 82 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "compile_args", + "shape": 7, + "type": "WANCOMPILEARGS", + "link": null + } + ], + "outputs": [ + { + "name": "vae", + "type": "WANVAE", + "slot_index": 0, + "links": [ + 278 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoVAELoader" + }, + "widgets_values": [ + "wanvideo\\Wan2_1_VAE_bf16.safetensors", + "bf16" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 161, + "type": "SetNode", + "pos": [ + -259.3302001953125, + -357.3097839355469 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "WANVAE", + "type": "WANVAE", + "link": 278 + } + ], + "outputs": [ + { + "name": "*", + "type": "*", + "links": null + } + ], + "title": "Set_VAE", + "properties": { + "previousName": "VAE" + }, + "widgets_values": [ + "VAE" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 77, + "type": "ImageConcatMulti", + "pos": [ + 2653.37939453125, + -1220.90087890625 + ], + "size": [ + 270, + 190 + ], + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "image_1", + "type": "IMAGE", + "link": 236 + }, + { + "name": "image_2", + "shape": 7, + "type": "IMAGE", + "link": 239 + }, + { + "name": "image_3", + "shape": 7, + "type": "IMAGE", + "link": 243 + }, + { + "name": "image_4", + "shape": 7, + "type": "IMAGE", + "link": 249 + } + ], + "outputs": [ + { + "name": "images", + "type": "IMAGE", + "links": [ + 107 + ] + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "468fcc86f0b29e79a8510e8239eb15714d6747a6" + }, + "widgets_values": [ + 4, + "down", + true, + null + ] + }, + { + "id": 145, + "type": "GetNode", + "pos": [ + 2463.91552734375, + -1073.7054443359375 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 17, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 249 + ] + } + ], + "title": "Get_input_video", + "properties": {}, + "widgets_values": [ + "input_video" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 28, + "type": "WanVideoDecode", + "pos": [ + 2485.57177734375, + -441.313720703125 + ], + "size": [ + 280.3896179199219, + 198 + ], + "flags": {}, + "order": 51, + "mode": 0, + "inputs": [ + { + "name": "vae", + "type": "WANVAE", + "link": 279 + }, + { + "name": "samples", + "type": "LATENT", + "link": 33 + } + ], + "outputs": [ + { + "name": "images", + "type": "IMAGE", + "slot_index": 0, + "links": [ + 48 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoDecode" + }, + "widgets_values": [ + false, + 272, + 272, + 144, + 128, + "default" + ] + }, + { + "id": 162, + "type": "GetNode", + "pos": [ + 2483.826171875, + -523.2938842773438 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 18, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "WANVAE", + "type": "WANVAE", + "links": [ + 279 + ] + } + ], + "title": "Get_VAE", + "properties": {}, + "widgets_values": [ + "VAE" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 42, + "type": "GetImageSizeAndCount", + "pos": [ + 2555.719482421875, + -692.73095703125 + ], + "size": [ + 277.20001220703125, + 86 + ], + "flags": {}, + "order": 55, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 48 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "slot_index": 0, + "links": [ + 87 + ] + }, + { + "label": "832 width", + "name": "width", + "type": "INT", + "links": null + }, + { + "label": "480 height", + "name": "height", + "type": "INT", + "links": null + }, + { + "label": "153 count", + "name": "count", + "type": "INT", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "36f6fdd7d4c393675ac622bd300ef667ee65d8b8", + "Node name for S&R": "GetImageSizeAndCount" + }, + "widgets_values": [] + }, + { + "id": 110, + "type": "WanVideoContextOptions", + "pos": [ + 1829.0579833984375, + -868.31298828125 + ], + "size": [ + 275.783203125, + 202 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "reference_latent", + "shape": 7, + "type": "LATENT", + "link": null + } + ], + "outputs": [ + { + "name": "context_options", + "type": "WANVIDCONTEXT", + "links": [] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "2bdd81a10b03c14443c79bdf3b783b1feb3d1fa3", + "Node name for S&R": "WanVideoContextOptions" + }, + "widgets_values": [ + "static_standard", + 81, + 4, + 32, + true, + false, + "linear" + ] + }, + { + "id": 65, + "type": "WanVideoTextEncodeCached", + "pos": [ + 1329.64208984375, + 68.953125 + ], + "size": [ + 488.4488220214844, + 362.56817626953125 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "extender_args", + "shape": 7, + "type": "WANVIDEOPROMPTEXTENDER_ARGS", + "link": null + } + ], + "outputs": [ + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "links": [ + 281 + ] + }, + { + "name": "negative_text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "links": null + }, + { + "name": "positive_prompt", + "type": "STRING", + "links": null + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "761b1d191e50d589465e31dc0d40ff7c59b1b7b0", + "Node name for S&R": "WanVideoTextEncodeCached" + }, + "widgets_values": [ + "umt5-xxl-enc-bf16.safetensors", + "bf16", + "man is walking, style is soft 3D render style, night time, moonlight", + "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走", + "disabled", + false, + "gpu" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 169, + "type": "Note", + "pos": [ + 1282.7142333984375, + -825.0780029296875 + ], + "size": [ + 484.7705383300781, + 194.427978515625 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "For long generations you can use either context options, or the original long gen method, which is activated when frame_window_size is smaller than total frames(num_frames). When using this method the window size stays constant, extra frames are generated in the case the last window is cut short.\n\nWhen using context options, set num_frames and frame_window_size to be equal\n\nOtherwise set frame_window_size to something the model is capable of doing normally, original default is 77, 81 seems to work too.\n\nOriginal method is probably better for motion etc, and is faster, but the benefit of context windows is that it doesn't degrade over time on long clips." + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 62, + "type": "WanVideoAnimateEmbeds", + "pos": [ + 1567.48046875, + -396.0700988769531 + ], + "size": [ + 274.2164001464844, + 370 + ], + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "vae", + "type": "WANVAE", + "link": 280 + }, + { + "name": "clip_embeds", + "shape": 7, + "type": "WANVIDIMAGE_CLIPEMBEDS", + "link": 96 + }, + { + "name": "ref_images", + "shape": 7, + "type": "IMAGE", + "link": 282 + }, + { + "name": "pose_images", + "shape": 7, + "type": "IMAGE", + "link": 244 + }, + { + "name": "face_images", + "shape": 7, + "type": "IMAGE", + "link": 240 + }, + { + "name": "bg_images", + "shape": 7, + "type": "IMAGE", + "link": 234 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": 247 + }, + { + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 265 + }, + { + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 266 + }, + { + "name": "num_frames", + "type": "INT", + "widget": { + "name": "num_frames" + }, + "link": 268 + } + ], + "outputs": [ + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "links": [ + 84 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "761b1d191e50d589465e31dc0d40ff7c59b1b7b0", + "Node name for S&R": "WanVideoAnimateEmbeds" + }, + "widgets_values": [ + 832, + 480, + 501, + false, + 77, + "disabled", + 1, + 1, + false + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 22, + "type": "WanVideoModelLoader", + "pos": [ + -700.9990844726562, + -908.7992553710938 + ], + "size": [ + 601.9249267578125, + 318 + ], + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "compile_args", + "shape": 7, + "type": "WANCOMPILEARGS", + "link": 100 + }, + { + "name": "block_swap_args", + "shape": 7, + "type": "BLOCKSWAPARGS", + "link": null + }, + { + "name": "lora", + "shape": 7, + "type": "WANVIDLORA", + "link": null + }, + { + "name": "vram_management_args", + "shape": 7, + "type": "VRAM_MANAGEMENTARGS", + "link": null + }, + { + "name": "extra_model", + "shape": 7, + "type": "VACEPATH", + "link": null + }, + { + "name": "fantasytalking_model", + "shape": 7, + "type": "FANTASYTALKINGMODEL", + "link": null + }, + { + "name": "multitalk_model", + "shape": 7, + "type": "MULTITALKMODEL", + "link": null + }, + { + "name": "fantasyportrait_model", + "shape": 7, + "type": "FANTASYPORTRAITMODEL", + "link": null + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "slot_index": 0, + "links": [ + 59 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoModelLoader" + }, + "widgets_values": [ + "WanVideo\\2_2\\Wan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors", + "fp16_fast", + "disabled", + "offload_device", + "sageattn", + "default" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 151, + "type": "INTConstant", + "pos": [ + -1704.931640625, + -2640.54638671875 + ], + "size": [ + 210, + 58 + ], + "flags": { + "collapsed": false + }, + "order": 22, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "value", + "type": "INT", + "links": [ + 258, + 264, + 287 + ] + } + ], + "title": "Height", + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "37659859825cea55940a58110525795ce5deb8be", + "Node name for S&R": "INTConstant" + }, + "widgets_values": [ + 480 + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 51, + "type": "WanVideoBlockSwap", + "pos": [ + -20.855491638183594, + -308.51751708984375 + ], + "size": [ + 281.404296875, + 202 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "block_swap_args", + "type": "BLOCKSWAPARGS", + "links": [ + 64 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoBlockSwap" + }, + "widgets_values": [ + 25, + false, + false, + true, + 0, + 1, + false + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 50, + "type": "WanVideoSetBlockSwap", + "pos": [ + 299.8666076660156, + -422.0509338378906 + ], + "size": [ + 201.76815795898438, + 46 + ], + "flags": {}, + "order": 47, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 62 + }, + { + "name": "block_swap_args", + "shape": 7, + "type": "BLOCKSWAPARGS", + "link": 64 + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "links": [ + 63 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoSetBlockSwap" + }, + "widgets_values": [], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 48, + "type": "WanVideoSetLoRAs", + "pos": [ + -5.091688632965088, + -420.6256103515625 + ], + "size": [ + 174.53378295898438, + 46 + ], + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 59 + }, + { + "name": "lora", + "shape": 7, + "type": "WANVIDLORA", + "link": 289 + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "links": [ + 62 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoSetLoRAs" + }, + "widgets_values": [], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 171, + "type": "WanVideoLoraSelectMulti", + "pos": [ + 3.4800829887390137, + -932.2160034179688 + ], + "size": [ + 583.3719482421875, + 342 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "prev_lora", + "shape": 7, + "type": "WANVIDLORA", + "link": null + }, + { + "name": "blocks", + "shape": 7, + "type": "SELECTEDBLOCKS", + "link": null + } + ], + "outputs": [ + { + "name": "lora", + "type": "WANVIDLORA", + "links": [ + 289 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "b2c8cf969fcf60a38884ea2c29af177ae1f28b29", + "Node name for S&R": "WanVideoLoraSelectMulti" + }, + "widgets_values": [ + "WanVideo\\WanAnimate_relight_lora_fp16.safetensors", + 1, + "WanVideo\\Lightx2v\\lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors", + 1.2, + "none", + 1, + "none", + 1, + "none", + 1, + false, + false + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 178, + "type": "OnnxDetectionModelLoader", + "pos": [ + -506.44635009765625, + -2398.935302734375 + ], + "size": [ + 351.52410888671875, + 106 + ], + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "model", + "type": "POSEMODEL", + "links": [ + 290 + ] + } + ], + "properties": { + "aux_id": "kijai/ComfyUI-WanAnimatePreprocess", + "ver": "e63d6e71ae4c271f3f81211a7ca7f87607b7e50d", + "Node name for S&R": "OnnxDetectionModelLoader" + }, + "widgets_values": [ + "vitpose-l-wholebody.onnx", + "onnx\\yolov10m.onnx", + "CUDAExecutionProvider" + ] + }, + { + "id": 182, + "type": "GrowMaskWithBlur", + "pos": [ + 431.7315368652344, + -2222.123779296875 + ], + "size": [ + 292.748046875, + 246 + ], + "flags": {}, + "order": 58, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 314 + } + ], + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 315 + ] + }, + { + "name": "mask_inverted", + "type": "MASK", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "bb205d809b467307b8ec3bb1a22680a4873187f8", + "Node name for S&R": "GrowMaskWithBlur" + }, + "widgets_values": [ + 10, + 0, + true, + false, + 0, + 1, + 1, + false + ] + }, + { + "id": 108, + "type": "BlockifyMask", + "pos": [ + 779.2421264648438, + -2222.2099609375 + ], + "size": [ + 270, + 58 + ], + "flags": {}, + "order": 61, + "mode": 0, + "inputs": [ + { + "name": "masks", + "type": "MASK", + "link": 315 + } + ], + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 245 + ] + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "00da1910634fbf314d407608efb281ae6f7f1ba2", + "Node name for S&R": "BlockifyMask" + }, + "widgets_values": [ + 32 + ] + }, + { + "id": 127, + "type": "Note", + "pos": [ + 983.2726440429688, + -2067.319580078125 + ], + "size": [ + 210, + 88 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "These are new nodes in KJNodes" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 104, + "type": "Sam2Segmentation", + "pos": [ + 83.82372283935547, + -2220.965576171875 + ], + "size": [ + 272.087890625, + 182 + ], + "flags": {}, + "order": 54, + "mode": 0, + "inputs": [ + { + "name": "sam2_model", + "type": "SAM2MODEL", + "link": 185 + }, + { + "name": "image", + "type": "IMAGE", + "link": 316 + }, + { + "name": "coordinates_positive", + "shape": 7, + "type": "STRING", + "link": null + }, + { + "name": "coordinates_negative", + "shape": 7, + "type": "STRING", + "link": null + }, + { + "name": "bboxes", + "shape": 7, + "type": "BBOX", + "link": 321 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "mask", + "type": "MASK", + "links": [ + 314 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-segment-anything-2", + "ver": "c59676b008a76237002926f684d0ca3a9b29ac54", + "Node name for S&R": "Sam2Segmentation" + }, + "widgets_values": [ + false, + false + ] + }, + { + "id": 180, + "type": "GetImageSizeAndCount", + "pos": [ + -246.24586486816406, + -3011.47705078125 + ], + "size": [ + 190.86483764648438, + 86 + ], + "flags": {}, + "order": 48, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 306 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 309, + 316 + ] + }, + { + "label": "832 width", + "name": "width", + "type": "INT", + "links": [ + 307, + 310 + ] + }, + { + "label": "480 height", + "name": "height", + "type": "INT", + "links": [ + 308, + 311 + ] + }, + { + "label": "109 count", + "name": "count", + "type": "INT", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "bb205d809b467307b8ec3bb1a22680a4873187f8", + "Node name for S&R": "GetImageSizeAndCount" + }, + "widgets_values": [] + }, + { + "id": 173, + "type": "DrawViTPose", + "pos": [ + 120.56317138671875, + -2811.226318359375 + ], + "size": [ + 270, + 178 + ], + "flags": {}, + "order": 52, + "mode": 0, + "inputs": [ + { + "name": "pose_data", + "type": "POSEDATA", + "link": 294 + }, + { + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 307 + }, + { + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 308 + } + ], + "outputs": [ + { + "name": "pose_images", + "type": "IMAGE", + "links": [ + 319 + ] + } + ], + "properties": { + "aux_id": "kijai/ComfyUI-WanAnimatePreprocess", + "ver": "e63d6e71ae4c271f3f81211a7ca7f87607b7e50d", + "Node name for S&R": "DrawViTPose" + }, + "widgets_values": [ + 832, + 480, + 16, + -1, + -1, + "True" + ] + }, + { + "id": 75, + "type": "VHS_VideoCombine", + "pos": [ + 2010.67431640625, + -3041.57568359375 + ], + "size": [ + 743.6680297851562, + 765.5007934570312 + ], + "flags": {}, + "order": 66, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 251 + }, + { + "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": "8e4d79471bf1952154768e8435a9300077b534fa", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 16, + "loop_count": 0, + "filename_prefix": "WanVideo2_1_T2V", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "WanVideo2_1_T2V_00004.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 16, + "workflow": "WanVideo2_1_T2V_00004.png", + "fullpath": "N:\\AI\\ComfyUI\\temp\\WanVideo2_1_T2V_00004.mp4" + } + } + } + }, + { + "id": 181, + "type": "VHS_VideoCombine", + "pos": [ + 1137.4183349609375, + -3026.80517578125 + ], + "size": [ + 743.6680297851562, + 765.5007934570312 + ], + "flags": {}, + "order": 60, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 320 + }, + { + "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": "8e4d79471bf1952154768e8435a9300077b534fa", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 16, + "loop_count": 0, + "filename_prefix": "WanVideo2_1_T2V", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "WanVideo2_1_T2V_00002.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 16, + "workflow": "WanVideo2_1_T2V_00002.png", + "fullpath": "N:\\AI\\ComfyUI\\temp\\WanVideo2_1_T2V_00002.mp4" + } + } + } + }, + { + "id": 174, + "type": "VHS_VideoCombine", + "pos": [ + 714.7760009765625, + -3057.50341796875 + ], + "size": [ + 214.7587890625, + 542.7587890625 + ], + "flags": {}, + "order": 57, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 318 + }, + { + "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": "0edce8ef7ce173ac97a3ed3d6f4636029d1a4530", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 16, + "loop_count": 0, + "filename_prefix": "vitpose", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "vitpose_00004.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 16, + "workflow": "vitpose_00004.png", + "fullpath": "N:\\AI\\ComfyUI\\temp\\vitpose_00004.mp4" + } + } + } + }, + { + "id": 183, + "type": "SetNode", + "pos": [ + 464.6632080078125, + -3038.54296875 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 53, + "mode": 0, + "inputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "link": 317 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 318 + ] + } + ], + "title": "Set_face_images", + "properties": { + "previousName": "face_images" + }, + "widgets_values": [ + "face_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 184, + "type": "SetNode", + "pos": [ + 442.45526123046875, + -2784.734375 + ], + "size": [ + 210, + 60 + ], + "flags": { + "collapsed": true + }, + "order": 56, + "mode": 0, + "inputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "link": 319 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 320 + ] + } + ], + "title": "Set_pose_images", + "properties": { + "previousName": "pose_images" + }, + "widgets_values": [ + "pose_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 138, + "type": "GetNode", + "pos": [ + 1319.8330078125, + -314.357421875 + ], + "size": [ + 210, + 50 + ], + "flags": { + "collapsed": true + }, + "order": 27, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 240 + ] + } + ], + "title": "Get_face_images", + "properties": {}, + "widgets_values": [ + "face_images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 172, + "type": "PoseAndFaceDetection", + "pos": [ + 104.5530014038086, + -3028.416015625 + ], + "size": [ + 313.125, + 142 + ], + "flags": {}, + "order": 50, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "POSEMODEL", + "link": 290 + }, + { + "name": "images", + "type": "IMAGE", + "link": 309 + }, + { + "name": "retarget_image", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 310 + }, + { + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 311 + } + ], + "outputs": [ + { + "name": "pose_data", + "type": "POSEDATA", + "links": [ + 294 + ] + }, + { + "name": "face_images", + "type": "IMAGE", + "links": [ + 317 + ] + }, + { + "name": "key_frame_body_points", + "type": "STRING", + "links": null + }, + { + "name": "bboxes", + "type": "BBOX", + "links": [ + 321 + ] + } + ], + "properties": { + "aux_id": "kijai/ComfyUI-WanAnimatePreprocess", + "ver": "e63d6e71ae4c271f3f81211a7ca7f87607b7e50d", + "Node name for S&R": "PoseAndFaceDetection" + }, + "widgets_values": [ + 832, + 480 + ] + }, + { + "id": 102, + "type": "DownloadAndLoadSAM2Model", + "pos": [ + -470.4329528808594, + -2221.738037109375 + ], + "size": [ + 334.4137268066406, + 130 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "sam2_model", + "type": "SAM2MODEL", + "links": [ + 185 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-segment-anything-2", + "ver": "c59676b008a76237002926f684d0ca3a9b29ac54", + "Node name for S&R": "DownloadAndLoadSAM2Model" + }, + "widgets_values": [ + "sam2.1_hiera_base_plus.safetensors", + "video", + "cuda", + "fp16" + ] + }, + { + "id": 185, + "type": "Note", + "pos": [ + 257.0601806640625, + -2465.42041015625 + ], + "size": [ + 236.14007568359375, + 88 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Note: SAM2 detection", + "properties": {}, + "widgets_values": [ + "You can use either the detected bbox or the kay_frame_body_points to positive coordinates, if one fails to creater proper mask, try the other" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 150, + "type": "INTConstant", + "pos": [ + -1695.39013671875, + -2773.4970703125 + ], + "size": [ + 210, + 58 + ], + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "value", + "type": "INT", + "links": [ + 257, + 263, + 286 + ] + } + ], + "title": "Width", + "properties": { + "cnr_id": "comfyui-kjnodes", + "ver": "37659859825cea55940a58110525795ce5deb8be", + "Node name for S&R": "INTConstant" + }, + "widgets_values": [ + 832 + ], + "color": "#1b4669", + "bgcolor": "#29699c" + }, + { + "id": 27, + "type": "WanVideoSampler", + "pos": [ + 2107.4375, + -539.1071166992188 + ], + "size": [ + 315, + 874.1923217773438 + ], + "flags": {}, + "order": 49, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 63 + }, + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "link": 84 + }, + { + "name": "text_embeds", + "shape": 7, + "type": "WANVIDEOTEXTEMBEDS", + "link": 281 + }, + { + "name": "samples", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "feta_args", + "shape": 7, + "type": "FETAARGS", + "link": null + }, + { + "name": "context_options", + "shape": 7, + "type": "WANVIDCONTEXT", + "link": null + }, + { + "name": "cache_args", + "shape": 7, + "type": "CACHEARGS", + "link": null + }, + { + "name": "flowedit_args", + "shape": 7, + "type": "FLOWEDITARGS", + "link": null + }, + { + "name": "slg_args", + "shape": 7, + "type": "SLGARGS", + "link": null + }, + { + "name": "loop_args", + "shape": 7, + "type": "LOOPARGS", + "link": null + }, + { + "name": "experimental_args", + "shape": 7, + "type": "EXPERIMENTALARGS", + "link": null + }, + { + "name": "sigmas", + "shape": 7, + "type": "SIGMAS", + "link": null + }, + { + "name": "unianimate_poses", + "shape": 7, + "type": "UNIANIMATE_POSE", + "link": null + }, + { + "name": "fantasytalking_embeds", + "shape": 7, + "type": "FANTASYTALKING_EMBEDS", + "link": null + }, + { + "name": "uni3c_embeds", + "shape": 7, + "type": "UNI3C_EMBEDS", + "link": null + }, + { + "name": "multitalk_embeds", + "shape": 7, + "type": "MULTITALK_EMBEDS", + "link": null + }, + { + "name": "freeinit_args", + "shape": 7, + "type": "FREEINITARGS", + "link": null + } + ], + "outputs": [ + { + "name": "samples", + "type": "LATENT", + "slot_index": 0, + "links": [ + 33 + ] + }, + { + "name": "denoised_samples", + "type": "LATENT", + "links": null + } + ], + "properties": { + "cnr_id": "ComfyUI-WanVideoWrapper", + "ver": "e5ef9752a7e846b232fc05fd993327a2e870a788", + "Node name for S&R": "WanVideoSampler" + }, + "widgets_values": [ + 4, + 1, + 5, + 42, + "fixed", + true, + "dpm++_sde", + 0, + 1, + "", + "comfy", + 0, + -1, + false + ] + }, + { + "id": 30, + "type": "VHS_VideoCombine", + "pos": [ + 3064.7763671875, + -1021.487548828125 + ], + "size": [ + 1478.035400390625, + 1042.3026123046875 + ], + "flags": {}, + "order": 62, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 89 + }, + { + "name": "audio", + "shape": 7, + "type": "AUDIO", + "link": 256 + }, + { + "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": "8e4d79471bf1952154768e8435a9300077b534fa", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 16, + "loop_count": 0, + "filename_prefix": "Wanimate", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": true, + "pingpong": false, + "save_output": true, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "Wanimate_00002-audio.mp4", + "subfolder": "", + "type": "temp", + "format": "video/h264-mp4", + "frame_rate": 16, + "workflow": "Wanimate_00002.png", + "fullpath": "N:\\AI\\ComfyUI\\temp\\Wanimate_00002-audio.mp4" + } + } + } + }, + { + "id": 164, + "type": "MarkdownNote", + "pos": [ + -1191.340087890625, + -515.903564453125 + ], + "size": [ + 541.7905883789062, + 240.68362426757812 + ], + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Markdown Note: Model Links", + "properties": {}, + "widgets_values": [ + "Model links:\n\n[https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/tree/main/Wan22Animate](https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/tree/main/Wan22Animate)\n\nLoRA:\n\n[https://huggingface.co/Kijai/WanVideo_comfy/tree/main/Lightx2v](https://huggingface.co/Kijai/WanVideo_comfy/tree/main/Lightx2v)\n\n[https://huggingface.co/Kijai/WanVideo_comfy/tree/main/LoRAs/Wan22_relight](https://huggingface.co/Kijai/WanVideo_comfy/tree/main/LoRAs/Wan22_relight)\n\nText encoder:\n\n[https://huggingface.co/Kijai/WanVideo_comfy/blob/main/umt5-xxl-enc-bf16.safetensors](https://huggingface.co/Kijai/WanVideo_comfy/blob/main/umt5-xxl-enc-bf16.safetensors)\n\nVAE:\n\n[https://huggingface.co/Kijai/WanVideo_comfy/blob/main/Wan2_1_VAE_bf16.safetensors](https://huggingface.co/Kijai/WanVideo_comfy/blob/main/Wan2_1_VAE_bf16.safetensors)" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 177, + "type": "MarkdownNote", + "pos": [ + -1088.8204345703125, + -2393.302978515625 + ], + "size": [ + 536.27783203125, + 330.03546142578125 + ], + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Preprocessor links", + "properties": {}, + "widgets_values": [ + "Nodes:\n\n[https://github.com/kijai/ComfyUI-WanAnimatePreprocess](https://github.com/kijai/ComfyUI-WanAnimatePreprocess)\n\nModels:\n\nYOLO:\n\n[https://huggingface.co/Wan-AI/Wan2.2-Animate-14B/blob/main/process_checkpoint/det/yolov10m.onnx](https://huggingface.co/Wan-AI/Wan2.2-Animate-14B/blob/main/process_checkpoint/det/yolov10m.onnx)\n\nViTPose\n\nLarge:\n\n[https://huggingface.co/JunkyByte/easy_ViTPose/blob/main/onnx/wholebody/vitpose-l-wholebody.onnx](https://huggingface.co/JunkyByte/easy_ViTPose/blob/main/onnx/wholebody/vitpose-l-wholebody.onnx)\n\nHuge (needs both files):\n\n[https://huggingface.co/Kijai/vitpose_comfy/blob/main/onnx/vitpose_h_wholebody_model.onnx](https://huggingface.co/Kijai/vitpose_comfy/blob/main/onnx/vitpose_h_wholebody_model.onnx)\n\n[https://huggingface.co/Kijai/vitpose_comfy/blob/main/onnx/vitpose_h_wholebody_data.bin](https://huggingface.co/Kijai/vitpose_comfy/blob/main/onnx/vitpose_h_wholebody_data.bin)" + ], + "color": "#432", + "bgcolor": "#653" + } + ], + "links": [ + [ + 33, + 27, + 0, + 28, + 1, + "LATENT" + ], + [ + 48, + 28, + 0, + 42, + 0, + "IMAGE" + ], + [ + 59, + 22, + 0, + 48, + 0, + "WANVIDEOMODEL" + ], + [ + 62, + 48, + 0, + 50, + 0, + "WANVIDEOMODEL" + ], + [ + 63, + 50, + 0, + 27, + 0, + "WANVIDEOMODEL" + ], + [ + 64, + 51, + 0, + 50, + 1, + "BLOCKSWAPARGS" + ], + [ + 82, + 57, + 0, + 64, + 0, + "IMAGE" + ], + [ + 84, + 62, + 0, + 27, + 1, + "WANVIDIMAGE_EMBEDS" + ], + [ + 87, + 42, + 0, + 66, + 0, + "IMAGE" + ], + [ + 89, + 66, + 0, + 30, + 0, + "IMAGE" + ], + [ + 96, + 70, + 0, + 62, + 1, + "WANVIDIMAGE_CLIPEMBEDS" + ], + [ + 97, + 71, + 0, + 70, + 0, + "CLIP_VISION" + ], + [ + 100, + 35, + 0, + 22, + 0, + "WANCOMPILEARGS" + ], + [ + 107, + 77, + 0, + 66, + 1, + "IMAGE" + ], + [ + 185, + 102, + 0, + 104, + 0, + "SAM2MODEL" + ], + [ + 231, + 64, + 0, + 128, + 0, + "*" + ], + [ + 233, + 99, + 0, + 130, + 0, + "*" + ], + [ + 234, + 131, + 0, + 62, + 5, + "IMAGE" + ], + [ + 235, + 133, + 0, + 70, + 1, + "IMAGE" + ], + [ + 236, + 134, + 0, + 77, + 0, + "IMAGE" + ], + [ + 239, + 137, + 0, + 77, + 1, + "IMAGE" + ], + [ + 240, + 138, + 0, + 62, + 4, + "IMAGE" + ], + [ + 243, + 140, + 0, + 77, + 2, + "IMAGE" + ], + [ + 244, + 141, + 0, + 62, + 3, + "IMAGE" + ], + [ + 245, + 108, + 0, + 142, + 0, + "*" + ], + [ + 246, + 142, + 0, + 99, + 1, + "MASK" + ], + [ + 247, + 143, + 0, + 62, + 6, + "MASK" + ], + [ + 248, + 63, + 0, + 144, + 0, + "*" + ], + [ + 249, + 145, + 0, + 77, + 3, + "IMAGE" + ], + [ + 250, + 146, + 0, + 99, + 0, + "IMAGE" + ], + [ + 251, + 130, + 0, + 75, + 0, + "IMAGE" + ], + [ + 255, + 63, + 2, + 148, + 0, + "*" + ], + [ + 256, + 149, + 0, + 30, + 1, + "AUDIO" + ], + [ + 257, + 150, + 0, + 63, + 2, + "INT" + ], + [ + 258, + 151, + 0, + 63, + 3, + "INT" + ], + [ + 263, + 150, + 0, + 153, + 0, + "*" + ], + [ + 264, + 151, + 0, + 154, + 0, + "*" + ], + [ + 265, + 155, + 0, + 62, + 7, + "INT" + ], + [ + 266, + 156, + 0, + 62, + 8, + "INT" + ], + [ + 267, + 63, + 1, + 157, + 0, + "*" + ], + [ + 268, + 158, + 0, + 62, + 9, + "INT" + ], + [ + 278, + 38, + 0, + 161, + 0, + "*" + ], + [ + 279, + 162, + 0, + 28, + 0, + "WANVAE" + ], + [ + 280, + 163, + 0, + 62, + 0, + "WANVAE" + ], + [ + 281, + 65, + 0, + 27, + 2, + "WANVIDEOTEXTEMBEDS" + ], + [ + 282, + 133, + 0, + 62, + 2, + "IMAGE" + ], + [ + 286, + 150, + 0, + 64, + 2, + "INT" + ], + [ + 287, + 151, + 0, + 64, + 3, + "INT" + ], + [ + 289, + 171, + 0, + 48, + 1, + "WANVIDLORA" + ], + [ + 290, + 178, + 0, + 172, + 0, + "POSEMODEL" + ], + [ + 294, + 172, + 0, + 173, + 0, + "POSEDATA" + ], + [ + 306, + 144, + 0, + 180, + 0, + "IMAGE" + ], + [ + 307, + 180, + 1, + 173, + 1, + "INT" + ], + [ + 308, + 180, + 2, + 173, + 2, + "INT" + ], + [ + 309, + 180, + 0, + 172, + 1, + "IMAGE" + ], + [ + 310, + 180, + 1, + 172, + 3, + "INT" + ], + [ + 311, + 180, + 2, + 172, + 4, + "INT" + ], + [ + 314, + 104, + 0, + 182, + 0, + "MASK" + ], + [ + 315, + 182, + 0, + 108, + 0, + "MASK" + ], + [ + 316, + 180, + 0, + 104, + 1, + "IMAGE" + ], + [ + 317, + 172, + 1, + 183, + 0, + "*" + ], + [ + 318, + 183, + 0, + 174, + 0, + "IMAGE" + ], + [ + 319, + 173, + 0, + 184, + 0, + "*" + ], + [ + 320, + 184, + 0, + 181, + 0, + "IMAGE" + ], + [ + 321, + 172, + 3, + 104, + 4, + "BBOX" + ] + ], + "groups": [ + { + "id": 1, + "title": "Reference Image", + "bounding": [ + -1209.306884765625, + -1833.3065185546875, + 990.079833984375, + 724.450439453125 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 3, + "title": "Preprocessing", + "bounding": [ + -1227.062744140625, + -3202.685302734375, + 4104.810546875, + 1281.6610107421875 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 4, + "title": "Models", + "bounding": [ + -1224.449951171875, + -1055.772705078125, + 2156.392578125, + 1012.5536499023438 + ], + "color": "#88A", + "font_size": 24, + "flags": {} + }, + { + "id": 5, + "title": "Result collage", + "bounding": [ + 2370.66357421875, + -1369.016845703125, + 629.7467041015625, + 605.8086547851562 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + } + ], + "config": {}, + "extra": { + "ds": { + "scale": 0.32349184307607143, + "offset": [ + 3509.4229336496064, + 2961.5041530294056 + ] + }, + "frontendVersion": "1.28.1", + "node_versions": { + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "ComfyUI-KJNodes": "a5bd3c86c8ed6b83c55c2d0e7a59515b15a0137f", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8" + }, + "VHS_latentpreview": true, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file From f66c5df07d3cf040ffb6a6a5c84907e8c654365b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Sepp=C3=A4nen?= <40791699+kijai@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:39:18 +0300 Subject: [PATCH 03/10] Update readme with example links Added links to WanAnimate and ReCamMaster examples. --- readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.md b/readme.md index c767612..f2b3dad 100644 --- a/readme.md +++ b/readme.md @@ -72,8 +72,13 @@ Stand-In: https://github.com/WeChatCV/Stand-In Examples: --- +WanAnimate: + +https://github.com/user-attachments/assets/f370b001-0f98-4c4c-bcb5-cfad0b330697 + [ReCamMaster](https://github.com/KwaiVGI/ReCamMaster): + https://github.com/user-attachments/assets/c58a12c2-13ba-4af8-8041-e283dbef197e From 300e8a47865d14b2a502043f758fd99a62a73b87 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:23:39 +0300 Subject: [PATCH 04/10] Update readme.md --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index c767612..460e477 100644 --- a/readme.md +++ b/readme.md @@ -68,6 +68,10 @@ EchoShot: https://github.com/D2I-ai/EchoShot Stand-In: https://github.com/WeChatCV/Stand-In +HuMo: https://github.com/Phantom-video/HuMo + +WanAnimate: https://github.com/Wan-Video/Wan2.2/tree/main/wan/modules/animate + Examples: --- From d380c7d2194786c50983ce1d829d4a090fa86200 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 01:14:25 +0300 Subject: [PATCH 05/10] Add TSR (Temporal Score Rescaling) to experimental args https://github.com/temporalscorerescaling/TSR --- nodes.py | 5 ++++- nodes_sampler.py | 15 +++++++++++++-- utils.py | 13 +++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 27131bc..cbab84f 100644 --- a/nodes.py +++ b/nodes.py @@ -1738,7 +1738,10 @@ class WanVideoExperimentalArgs: "fresca_freq_cutoff": ("INT", {"default": 20, "min": 0, "max": 10000, "step": 1}), "use_tcfg": ("BOOLEAN", {"default": False, "tooltip": "https://arxiv.org/abs/2503.18137 TCFG: Tangential Damping Classifier-free Guidance. CFG artifacts reduction."}), "raag_alpha": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "Alpha value for RAAG, 1.0 is default, 0.0 is disabled."}), - "bidirectional_sampling": ("BOOLEAN", {"default": False, "tooltip": "Enable bidirectional sampling, based on https://github.com/ff2416/WanFM"}) + "bidirectional_sampling": ("BOOLEAN", {"default": False, "tooltip": "Enable bidirectional sampling, based on https://github.com/ff2416/WanFM"}), + "temporal_score_rescaling": ("BOOLEAN", {"default": False, "tooltip": "Enable temporal score rescaling: https://github.com/temporalscorerescaling/TSR/"}), + "tsr_k": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "The sampling temperature"}), + "tsr_sigma": ("FLOAT", {"default": 0.1, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "How early TSR steer the sampling process"}), }, } diff --git a/nodes_sampler.py b/nodes_sampler.py index ab3e6e0..d1b7412 100644 --- a/nodes_sampler.py +++ b/nodes_sampler.py @@ -12,7 +12,7 @@ from .wanvideo.schedulers import get_scheduler, get_sampling_sigmas, retrieve_ti from .gguf.gguf import set_lora_params_gguf from .multitalk.multitalk import timestep_transform, add_noise from .utils import(log, print_memory, apply_lora, clip_encode_image_tiled, fourier_filter, optimized_scale, setup_radial_attention, - compile_model, dict_to_device, tangential_projection, set_module_tensor_to_device, get_raag_guidance) + compile_model, dict_to_device, tangential_projection, set_module_tensor_to_device, get_raag_guidance, temporal_score_rescaling) from .cache_methods.cache_methods import cache_report from .nodes_model_loading import load_weights from .enhance_a_video.globals import set_enhance_weight, set_num_frames @@ -933,7 +933,7 @@ class WanVideoSampler: timesteps[-drift_steps:] = drift_timesteps[-drift_steps:] # Experimental args - use_cfg_zero_star = use_tangential = use_fresca = bidirectional_sampling =False + use_cfg_zero_star = use_tangential = use_fresca = bidirectional_sampling = use_tsr = False raag_alpha = 0.0 if experimental_args is not None: video_attention_split_steps = experimental_args.get("video_attention_split_steps", []) @@ -957,6 +957,9 @@ class WanVideoSampler: bidirectional_sampling = experimental_args.get("bidirectional_sampling", False) if bidirectional_sampling: sample_scheduler_flipped = copy.deepcopy(sample_scheduler) + use_tsr = experimental_args.get("temporal_score_rescaling", False) + tsr_k = experimental_args.get("tsr_k", 1.0) + tsr_sigma = experimental_args.get("tsr_sigma", 1.0) # Rotary positional embeddings (RoPE) @@ -2157,6 +2160,8 @@ class WanVideoSampler: step_iteration_count += 1 # update latent + if use_tsr: + noise_pred = temporal_score_rescaling(noise_pred, latent, timestep, tsr_k, tsr_sigma) if scheduler == "multitalk": noise_pred = -noise_pred dt = (timesteps[i] - timesteps[i + 1]) / 1000 @@ -2627,6 +2632,9 @@ class WanVideoSampler: sampling_pbar.update(1) step_iteration_count += 1 + if use_tsr: + noise_pred = temporal_score_rescaling(noise_pred, latent, timestep, tsr_k, tsr_sigma) + latent = sample_scheduler.step(noise_pred.unsqueeze(0), timestep, latent.unsqueeze(0).to(noise_pred.device), **scheduler_step_args)[0].squeeze(0) del noise_pred, latent_model_input, timestep @@ -2731,6 +2739,9 @@ class WanVideoSampler: if flowedit_args is None: latent = latent.to(intermediate_device) + if use_tsr: + noise_pred = temporal_score_rescaling(noise_pred, latent, timestep, tsr_k, tsr_sigma) + if len(timestep.shape) != 1 and not is_pusa: #5b # all_indices is a list of indices to skip total_indices = list(range(latent.shape[1])) diff --git a/utils.py b/utils.py index e7069a2..1e97fd4 100644 --- a/utils.py +++ b/utils.py @@ -588,3 +588,16 @@ def check_duplicate_nodes(): wanvideo_dirs.append(str(path)) return wanvideo_dirs + +#https://github.com/temporalscorerescaling/TSR/ +def temporal_score_rescaling(model_output, sample, timestep, k=1.0, tsr_sigma=0.1): + t = (timestep / 1000) + if t == 0.0: + ratio = k + else: + snr_t = (1 - t)**2 / t**2 + ratio = (snr_t * tsr_sigma**2 + 1) / (snr_t * tsr_sigma**2 / k + 1) + + if not t == 1.0: + model_output = (ratio * ((1-t) * model_output + sample) - sample) / (1 - t) + return model_output From 00a5cb8e5c78f9e2aa30b2bb4cc2223136b3c08d Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 01:27:32 +0300 Subject: [PATCH 06/10] Update nodes.py --- nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index cbab84f..9e8e45a 100644 --- a/nodes.py +++ b/nodes.py @@ -1740,7 +1740,7 @@ class WanVideoExperimentalArgs: "raag_alpha": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "Alpha value for RAAG, 1.0 is default, 0.0 is disabled."}), "bidirectional_sampling": ("BOOLEAN", {"default": False, "tooltip": "Enable bidirectional sampling, based on https://github.com/ff2416/WanFM"}), "temporal_score_rescaling": ("BOOLEAN", {"default": False, "tooltip": "Enable temporal score rescaling: https://github.com/temporalscorerescaling/TSR/"}), - "tsr_k": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "The sampling temperature"}), + "tsr_k": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 100.0, "step": 0.01, "tooltip": "The sampling temperature"}), "tsr_sigma": ("FLOAT", {"default": 0.1, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "How early TSR steer the sampling process"}), }, } From 05232fb9660e2567978672bc414cb47dfefaf603 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 01:37:12 +0300 Subject: [PATCH 07/10] Update nodes.py --- nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 9e8e45a..9ee8994 100644 --- a/nodes.py +++ b/nodes.py @@ -1740,8 +1740,8 @@ class WanVideoExperimentalArgs: "raag_alpha": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "Alpha value for RAAG, 1.0 is default, 0.0 is disabled."}), "bidirectional_sampling": ("BOOLEAN", {"default": False, "tooltip": "Enable bidirectional sampling, based on https://github.com/ff2416/WanFM"}), "temporal_score_rescaling": ("BOOLEAN", {"default": False, "tooltip": "Enable temporal score rescaling: https://github.com/temporalscorerescaling/TSR/"}), - "tsr_k": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 100.0, "step": 0.01, "tooltip": "The sampling temperature"}), - "tsr_sigma": ("FLOAT", {"default": 0.1, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "How early TSR steer the sampling process"}), + "tsr_k": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 100.0, "step": 0.01, "tooltip": "The sampling temperature"}), + "tsr_sigma": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "How early TSR steer the sampling process"}), }, } From d20d271a2468fae26b8fdb9701dbf5e5cdc8ccb2 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 12:19:43 +0300 Subject: [PATCH 08/10] Update nodes_model_loading.py --- nodes_model_loading.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodes_model_loading.py b/nodes_model_loading.py index e8e3eb3..5f5f78b 100644 --- a/nodes_model_loading.py +++ b/nodes_model_loading.py @@ -531,6 +531,8 @@ class WanVideoLoraSelectMulti: "low_mem_load": low_mem_load, "merge_loras": merge_loras, }) + if len(loras_list) == 0: + return None, return (loras_list,) class WanVideoVACEModelSelect: From 3167e088edca37fe2cbaa03d34dedcd53dd62c56 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 12:26:44 +0300 Subject: [PATCH 09/10] Update fp8_optimization.py --- fp8_optimization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fp8_optimization.py b/fp8_optimization.py index 217ab86..7abe973 100644 --- a/fp8_optimization.py +++ b/fp8_optimization.py @@ -13,9 +13,10 @@ def fp8_linear_forward(cls, base_dtype, input): if scale_weight is None: scale_weight = torch.ones((), device=input.device, dtype=torch.float32) else: - scale_weight = scale_weight.to(input.device) + scale_weight = scale_weight.to(input.device).squeeze() + + scale_input = torch.ones((), device=input.device, dtype=torch.float32).squeeze() - scale_input = torch.ones((), device=input.device, dtype=torch.float32) input = torch.clamp(input, min=-448, max=448, out=input) inn = input.reshape(-1, input_shape[2]).to(torch.float8_e4m3fn).contiguous() #always e4m3fn because e5m2 * e5m2 is not supported From d3010e37abdec4c85716bff8bc4dfd00fd2a496c Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 5 Oct 2025 12:31:45 +0300 Subject: [PATCH 10/10] Fix some torch compile + fp8_fast issues --- fp8_optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp8_optimization.py b/fp8_optimization.py index 7abe973..ae5164c 100644 --- a/fp8_optimization.py +++ b/fp8_optimization.py @@ -15,7 +15,7 @@ def fp8_linear_forward(cls, base_dtype, input): else: scale_weight = scale_weight.to(input.device).squeeze() - scale_input = torch.ones((), device=input.device, dtype=torch.float32).squeeze() + scale_input = torch.ones((), device=input.device, dtype=torch.float32) input = torch.clamp(input, min=-448, max=448, out=input) inn = input.reshape(-1, input_shape[2]).to(torch.float8_e4m3fn).contiguous() #always e4m3fn because e5m2 * e5m2 is not supported