From 2863956da755b6b538a11fb9136f56ca652cddb9 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sat, 22 Mar 2025 02:45:11 +0200 Subject: [PATCH] workflow updates --- .../wanvideo_1_3B_control_example_01.json | 400 ++--- .../wanvideo_480p_I2V_example_02.json | 1484 +++++++++-------- .../wanvideo_T2V_example_02.json | 261 +-- .../wanvideo_long_T2V_example_01.json | 464 +++--- .../wanvideo_vid2vid_example_01.json | 212 ++- wanvideo/modules/model.py | 2 +- 6 files changed, 1546 insertions(+), 1277 deletions(-) diff --git a/example_workflows/wanvideo_1_3B_control_example_01.json b/example_workflows/wanvideo_1_3B_control_example_01.json index ae4a0cf..9d474e9 100644 --- a/example_workflows/wanvideo_1_3B_control_example_01.json +++ b/example_workflows/wanvideo_1_3B_control_example_01.json @@ -1,4 +1,6 @@ { + "id": "04f1de76-e363-4c27-bec7-eb184ac6e476", + "revision": 0, "last_node_id": 106, "last_link_id": 149, "nodes": [ @@ -44,10 +46,10 @@ { "name": "wan_t5_model", "type": "WANTEXTENCODER", + "slot_index": 0, "links": [ 15 - ], - "slot_index": 0 + ] } ], "properties": { @@ -81,8 +83,8 @@ { "name": "torch_compile_args", "type": "WANCOMPILEARGS", - "links": [], - "slot_index": 0 + "slot_index": 0, + "links": [] } ], "properties": { @@ -141,8 +143,8 @@ { "name": "torch_compile_args", "type": "WANCOMPILEARGS", - "links": [], - "slot_index": 0 + "slot_index": 0, + "links": [] } ], "properties": { @@ -245,10 +247,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 145 - ], - "slot_index": 0 + ] } ], "properties": { @@ -283,16 +285,22 @@ "name": "t5", "type": "WANTEXTENCODER", "link": 15 + }, + { + "name": "model_to_offload", + "shape": 7, + "type": "WANVIDEOMODEL", + "link": null } ], "outputs": [ { "name": "text_embeds", "type": "WANVIDEOTEXTEMBEDS", + "slot_index": 0, "links": [ 30 - ], - "slot_index": 0 + ] } ], "properties": { @@ -306,69 +314,6 @@ "color": "#332922", "bgcolor": "#593930" }, - { - "id": 22, - "type": "WanVideoModelLoader", - "pos": [ - 148.01803588867188, - -780 - ], - "size": [ - 477.4410095214844, - 226.43276977539062 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "compile_args", - "type": "WANCOMPILEARGS", - "shape": 7, - "link": null - }, - { - "name": "block_swap_args", - "type": "BLOCKSWAPARGS", - "shape": 7, - "link": null - }, - { - "name": "lora", - "type": "WANVIDLORA", - "shape": 7, - "link": 136 - }, - { - "name": "vram_management_args", - "type": "VRAM_MANAGEMENTARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "links": [ - 29 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoModelLoader" - }, - "widgets_values": [ - "WanVideo\\Wan2_1-T2V-1_3B_fp32.safetensors", - "fp16", - "disabled", - "offload_device", - "sageattn" - ], - "color": "#223", - "bgcolor": "#335" - }, { "id": 30, "type": "VHS_VideoCombine", @@ -391,20 +336,20 @@ }, { "name": "audio", - "type": "AUDIO", "shape": 7, + "type": "AUDIO", "link": null }, { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -444,99 +389,6 @@ } } }, - { - "id": 27, - "type": "WanVideoSampler", - "pos": [ - 1335.9598388671875, - -353.7341003417969 - ], - "size": [ - 315, - 699 - ], - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "link": 29 - }, - { - "name": "text_embeds", - "type": "WANVIDEOTEXTEMBEDS", - "link": 30 - }, - { - "name": "image_embeds", - "type": "WANVIDIMAGE_EMBEDS", - "link": 133 - }, - { - "name": "samples", - "type": "LATENT", - "shape": 7, - "link": null - }, - { - "name": "feta_args", - "type": "FETAARGS", - "shape": 7, - "link": null - }, - { - "name": "context_options", - "type": "WANVIDCONTEXT", - "shape": 7, - "link": null - }, - { - "name": "teacache_args", - "type": "TEACACHEARGS", - "shape": 7, - "link": 103 - }, - { - "name": "flowedit_args", - "type": "FLOWEDITARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "samples", - "type": "LATENT", - "links": [ - 33 - ], - "slot_index": 0 - }, - { - "name": "maskimagetest", - "type": "IMAGE", - "links": [], - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "WanVideoSampler" - }, - "widgets_values": [ - 30, - 6, - 5, - 0, - "fixed", - true, - "unipc", - 0, - 1, - "" - ] - }, { "id": 38, "type": "WanVideoVAELoader", @@ -556,11 +408,11 @@ { "name": "vae", "type": "WANVAE", + "slot_index": 0, "links": [ 43, 135 - ], - "slot_index": 0 + ] } ], "properties": { @@ -590,14 +442,14 @@ "inputs": [ { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -605,10 +457,10 @@ { "name": "IMAGE", "type": "IMAGE", + "slot_index": 0, "links": [ 147 - ], - "slot_index": 0 + ] }, { "name": "frame_count", @@ -683,8 +535,8 @@ }, { "name": "mask", - "type": "MASK", "shape": 7, + "type": "MASK", "link": null } ], @@ -735,11 +587,11 @@ { "name": "IMAGE", "type": "IMAGE", + "slot_index": 0, "links": [ 148, 149 - ], - "slot_index": 0 + ] } ], "properties": { @@ -780,10 +632,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 146 - ], - "slot_index": 0 + ] } ], "properties": {}, @@ -803,7 +655,7 @@ ], "size": [ 315, - 102 + 126 ], "flags": {}, "order": 9, @@ -811,14 +663,14 @@ "inputs": [ { "name": "prev_lora", - "type": "WANVIDLORA", "shape": 7, + "type": "WANVIDLORA", "link": null }, { "name": "blocks", - "type": "SELECTEDBLOCKS", "shape": 7, + "type": "SELECTEDBLOCKS", "link": null } ], @@ -836,7 +688,8 @@ }, "widgets_values": [ "WanVid\\wan2.1-1.3b-control-lora-tile-v0.1_comfy.safetensors", - 1 + 1, + false ] }, { @@ -910,10 +763,10 @@ { "name": "image_embeds", "type": "WANVIDIMAGE_EMBEDS", + "slot_index": 0, "links": [ 133 - ], - "slot_index": 0 + ] } ], "properties": { @@ -923,6 +776,175 @@ 0, 0.7 ] + }, + { + "id": 27, + "type": "WanVideoSampler", + "pos": [ + 1335.9598388671875, + -353.7341003417969 + ], + "size": [ + 315, + 699 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 29 + }, + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "link": 30 + }, + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "link": 133 + }, + { + "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": "teacache_args", + "shape": 7, + "type": "TEACACHEARGS", + "link": 103 + }, + { + "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 + } + ], + "outputs": [ + { + "name": "samples", + "type": "LATENT", + "slot_index": 0, + "links": [ + 33 + ] + }, + { + "name": "maskimagetest", + "type": "IMAGE", + "slot_index": 1, + "links": [] + } + ], + "properties": { + "Node name for S&R": "WanVideoSampler" + }, + "widgets_values": [ + 30, + 6, + 5, + 0, + "fixed", + true, + "unipc", + 0, + 1, + "", + "comfy" + ] + }, + { + "id": 22, + "type": "WanVideoModelLoader", + "pos": [ + 148.01803588867188, + -780 + ], + "size": [ + 477.4410095214844, + 226.43276977539062 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "compile_args", + "shape": 7, + "type": "WANCOMPILEARGS", + "link": null + }, + { + "name": "block_swap_args", + "shape": 7, + "type": "BLOCKSWAPARGS", + "link": null + }, + { + "name": "lora", + "shape": 7, + "type": "WANVIDLORA", + "link": 136 + }, + { + "name": "vram_management_args", + "shape": 7, + "type": "VRAM_MANAGEMENTARGS", + "link": null + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "slot_index": 0, + "links": [ + 29 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoModelLoader" + }, + "widgets_values": [ + "WanVideo\\wan2.1_t2v_1.3B_fp16.safetensors", + "fp16", + "disabled", + "offload_device", + "sdpa" + ], + "color": "#223", + "bgcolor": "#335" } ], "links": [ @@ -1058,10 +1080,10 @@ ] }, "node_versions": { - "ComfyUI-WanVideoWrapper": "9e83063dcfc43d5166c87fd9e387f7384c9f9d9c", - "ComfyUI-VideoHelperSuite": "2c25b8b53835aaeb63f831b3137c705cf9f85dce", + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8", "comfy-core": "0.3.26", - "ComfyUI-KJNodes": "263961539ee6d374fa145175fee9b21dbd88f00c" + "ComfyUI-KJNodes": "a5bd3c86c8ed6b83c55c2d0e7a59515b15a0137f" }, "VHS_latentpreview": true, "VHS_latentpreviewrate": 0, diff --git a/example_workflows/wanvideo_480p_I2V_example_02.json b/example_workflows/wanvideo_480p_I2V_example_02.json index 41145ff..7c66b1b 100644 --- a/example_workflows/wanvideo_480p_I2V_example_02.json +++ b/example_workflows/wanvideo_480p_I2V_example_02.json @@ -1,6 +1,8 @@ { - "last_node_id": 62, - "last_link_id": 64, + "id": "206247b6-9fec-4ed2-8927-e4f388c674d4", + "revision": 0, + "last_node_id": 67, + "last_link_id": 80, "nodes": [ { "id": 46, @@ -14,7 +16,7 @@ 46 ], "flags": {}, - "order": 25, + "order": 22, "mode": 2, "inputs": [ { @@ -52,7 +54,7 @@ 200 ], "flags": {}, - "order": 21, + "order": 19, "mode": 2, "inputs": [ { @@ -65,10 +67,10 @@ { "name": "CONDITIONING", "type": "CONDITIONING", + "slot_index": 0, "links": [ 55 - ], - "slot_index": 0 + ] } ], "properties": { @@ -97,11 +99,11 @@ { "name": "CLIP", "type": "CLIP", + "slot_index": 0, "links": [ 52, 53 - ], - "slot_index": 0 + ] } ], "properties": { @@ -125,7 +127,7 @@ 200 ], "flags": {}, - "order": 20, + "order": 18, "mode": 2, "inputs": [ { @@ -138,10 +140,10 @@ { "name": "CONDITIONING", "type": "CONDITIONING", + "slot_index": 0, "links": [ 54 - ], - "slot_index": 0 + ] } ], "properties": { @@ -151,93 +153,6 @@ "high quality nature video featuring a red panda balancing on a bamboo stem while a bird lands on it's head, on the background there is a waterfall" ] }, - { - "id": 27, - "type": "WanVideoSampler", - "pos": [ - 1315.2401123046875, - -401.48028564453125 - ], - "size": [ - 315, - 699 - ], - "flags": {}, - "order": 26, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "link": 29 - }, - { - "name": "text_embeds", - "type": "WANVIDEOTEXTEMBEDS", - "link": 30 - }, - { - "name": "image_embeds", - "type": "WANVIDIMAGE_EMBEDS", - "link": 64 - }, - { - "name": "samples", - "type": "LATENT", - "shape": 7, - "link": null - }, - { - "name": "feta_args", - "type": "FETAARGS", - "shape": 7, - "link": 57 - }, - { - "name": "context_options", - "type": "WANVIDCONTEXT", - "shape": 7, - "link": null - }, - { - "name": "teacache_args", - "type": "TEACACHEARGS", - "shape": 7, - "link": 56 - }, - { - "name": "flowedit_args", - "type": "FLOWEDITARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "samples", - "type": "LATENT", - "links": [ - 33 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoSampler" - }, - "widgets_values": [ - 25, - 6, - 5, - 1057359483639287, - "fixed", - true, - "unipc", - 0, - 1, - "" - ] - }, { "id": 42, "type": "Note", @@ -361,29 +276,6 @@ "color": "#432", "bgcolor": "#653" }, - { - "id": 60, - "type": "Note", - "pos": [ - -432.5627136230469, - -224.5513458251953 - ], - "size": [ - 253.16725158691406, - 88 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [], - "outputs": [], - "properties": {}, - "widgets_values": [ - "You can use either the original clip vision or the normal comfyui clip vision loader, they are the same model in the end." - ], - "color": "#432", - "bgcolor": "#653" - }, { "id": 62, "type": "Note", @@ -396,7 +288,7 @@ 90.03050994873047 ], "flags": {}, - "order": 7, + "order": 6, "mode": 0, "inputs": [], "outputs": [], @@ -407,130 +299,6 @@ "color": "#432", "bgcolor": "#653" }, - { - "id": 59, - "type": "CLIPVisionLoader", - "pos": [ - -158.17127990722656, - -210.2847442626953 - ], - "size": [ - 315, - 58 - ], - "flags": {}, - "order": 8, - "mode": 2, - "inputs": [], - "outputs": [ - { - "name": "CLIP_VISION", - "type": "CLIP_VISION", - "links": null - } - ], - "properties": { - "Node name for S&R": "CLIPVisionLoader" - }, - "widgets_values": [ - "clip_vision_h.safetensors" - ], - "color": "#2a363b", - "bgcolor": "#3f5159" - }, - { - "id": 56, - "type": "LoadWanVideoClipTextEncoder", - "pos": [ - -357.8293762207031, - -83.7756118774414 - ], - "size": [ - 510.6601257324219, - 106 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "wan_clip_vision", - "type": "CLIP_VISION", - "links": [ - 58 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LoadWanVideoClipTextEncoder" - }, - "widgets_values": [ - "open-clip-xlm-roberta-large-vit-huge-14_visual_fp16.safetensors", - "fp16", - "offload_device" - ], - "color": "#2a363b", - "bgcolor": "#3f5159" - }, - { - "id": 57, - "type": "WanVideoImageClipEncode", - "pos": [ - 286.400390625, - -86.68402099609375 - ], - "size": [ - 315, - 266 - ], - "flags": {}, - "order": 23, - "mode": 0, - "inputs": [ - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 58 - }, - { - "name": "image", - "type": "IMAGE", - "link": 59 - }, - { - "name": "vae", - "type": "WANVAE", - "link": 63 - } - ], - "outputs": [ - { - "name": "image_embeds", - "type": "WANVIDIMAGE_EMBEDS", - "links": [ - 64 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoImageClipEncode" - }, - "widgets_values": [ - 832, - 480, - 81, - true, - 0.030000000000000006, - 1, - 1, - true - ], - "color": "#2a363b", - "bgcolor": "#3f5159" - }, { "id": 11, "type": "LoadWanVideoT5TextEncoder", @@ -543,17 +311,17 @@ 130 ], "flags": {}, - "order": 10, + "order": 7, "mode": 0, "inputs": [], "outputs": [ { "name": "wan_t5_model", "type": "WANTEXTENCODER", + "slot_index": 0, "links": [ 15 - ], - "slot_index": 0 + ] } ], "properties": { @@ -568,183 +336,6 @@ "color": "#332922", "bgcolor": "#593930" }, - { - "id": 16, - "type": "WanVideoTextEncode", - "pos": [ - 787.8640747070312, - -91.52558898925781 - ], - "size": [ - 420.30511474609375, - 261.5306701660156 - ], - "flags": {}, - "order": 22, - "mode": 0, - "inputs": [ - { - "name": "t5", - "type": "WANTEXTENCODER", - "link": 15 - } - ], - "outputs": [ - { - "name": "text_embeds", - "type": "WANVIDEOTEXTEMBEDS", - "links": [ - 30 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoTextEncode" - }, - "widgets_values": [ - "an old man is stroking his beard thoughtfully", - "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走", - true - ], - "color": "#332922", - "bgcolor": "#593930" - }, - { - "id": 58, - "type": "LoadImage", - "pos": [ - -275.1466369628906, - 108.30052185058594 - ], - "size": [ - 413.10479736328125, - 498.3180847167969 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 59 - ] - }, - { - "name": "MASK", - "type": "MASK", - "links": null - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "oldman_upscaled.png", - "image" - ], - "color": "#2a363b", - "bgcolor": "#3f5159" - }, - { - "id": 22, - "type": "WanVideoModelLoader", - "pos": [ - 150, - -780 - ], - "size": [ - 477.4410095214844, - 226.43276977539062 - ], - "flags": {}, - "order": 24, - "mode": 0, - "inputs": [ - { - "name": "compile_args", - "type": "WANCOMPILEARGS", - "shape": 7, - "link": null - }, - { - "name": "block_swap_args", - "type": "BLOCKSWAPARGS", - "shape": 7, - "link": 50 - }, - { - "name": "lora", - "type": "WANVIDLORA", - "shape": 7, - "link": null - }, - { - "name": "vram_management_args", - "type": "VRAM_MANAGEMENTARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "links": [ - 29 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoModelLoader" - }, - "widgets_values": [ - "WanVideo\\Wan2_1-I2V-14B-480P_fp8_e4m3fn.safetensors", - "fp16", - "fp8_e4m3fn", - "offload_device", - "sdpa" - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 55, - "type": "WanVideoEnhanceAVideo", - "pos": [ - 1312.6407470703125, - -596.7884521484375 - ], - "size": [ - 315, - 106 - ], - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "feta_args", - "type": "FETAARGS", - "links": [ - 57 - ] - } - ], - "properties": { - "Node name for S&R": "WanVideoEnhanceAVideo" - }, - "widgets_values": [ - 2, - 0, - 1 - ] - }, { "id": 52, "type": "WanVideoTeaCache", @@ -754,10 +345,10 @@ ], "size": [ 315, - 130 + 154 ], "flags": {}, - "order": 13, + "order": 8, "mode": 0, "inputs": [], "outputs": [ @@ -792,7 +383,7 @@ 88 ], "flags": {}, - "order": 14, + "order": 9, "mode": 0, "inputs": [], "outputs": [], @@ -815,7 +406,7 @@ 159.47401428222656 ], "flags": {}, - "order": 15, + "order": 10, "mode": 0, "inputs": [], "outputs": [], @@ -826,6 +417,685 @@ "color": "#432", "bgcolor": "#653" }, + { + "id": 44, + "type": "Note", + "pos": [ + -620.9041137695312, + -1049.732421875 + ], + "size": [ + 303.0501403808594, + 88 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "If you have Triton installed, connect this for ~30% speed increase" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 39, + "type": "WanVideoBlockSwap", + "pos": [ + -210, + -760 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "block_swap_args", + "type": "BLOCKSWAPARGS", + "slot_index": 0, + "links": [ + 50 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoBlockSwap" + }, + "widgets_values": [ + 10, + false, + false, + true + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 35, + "type": "WanVideoTorchCompileSettings", + "pos": [ + -276.8500671386719, + -1050.6326904296875 + ], + "size": [ + 390.5999755859375, + 178 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "torch_compile_args", + "type": "WANCOMPILEARGS", + "slot_index": 0, + "links": [] + } + ], + "properties": { + "Node name for S&R": "WanVideoTorchCompileSettings" + }, + "widgets_values": [ + "inductor", + false, + "default", + false, + 64, + true + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 58, + "type": "LoadImage", + "pos": [ + -650.719482421875, + 173.7036895751953 + ], + "size": [ + 413.10479736328125, + 498.3180847167969 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 72 + ] + }, + { + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "oldman_upscaled.png", + "image", + "" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 66, + "type": "ImageResizeKJ", + "pos": [ + -175.95899963378906, + 176.40057373046875 + ], + "size": [ + 315, + 266 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 72 + }, + { + "name": "get_image_size", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "width_input", + "shape": 7, + "type": "INT", + "widget": { + "name": "width_input" + }, + "link": null + }, + { + "name": "height_input", + "shape": 7, + "type": "INT", + "widget": { + "name": "height_input" + }, + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 73, + 74 + ] + }, + { + "name": "width", + "type": "INT", + "links": [ + 75 + ] + }, + { + "name": "height", + "type": "INT", + "links": [ + 76 + ] + } + ], + "properties": { + "Node name for S&R": "ImageResizeKJ" + }, + "widgets_values": [ + 624, + 624, + "lanczos", + false, + 16, + 0, + 0, + "disabled" + ] + }, + { + "id": 63, + "type": "WanVideoImageToVideoEncode", + "pos": [ + 304.6556091308594, + -129.80532836914062 + ], + "size": [ + 352.79998779296875, + 262 + ], + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "start_image", + "type": "IMAGE", + "link": 74 + }, + { + "name": "vae", + "type": "WANVAE", + "link": 77 + }, + { + "name": "clip_embeds", + "type": "WANVIDIMAGE_CLIPEMBEDS", + "link": 69 + }, + { + "name": "end_image", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 75 + }, + { + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 76 + } + ], + "outputs": [ + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "links": [ + 66 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoImageToVideoEncode" + }, + "widgets_values": [ + 832, + 480, + 81, + 0.030000000000000006, + 1, + 1, + true + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 38, + "type": "WanVideoVAELoader", + "pos": [ + 169.25408935546875, + -322.9471740722656 + ], + "size": [ + 372.7727966308594, + 82 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "vae", + "type": "WANVAE", + "slot_index": 0, + "links": [ + 43, + 77 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoVAELoader" + }, + "widgets_values": [ + "wanvideo\\Wan2_1_VAE_bf16.safetensors", + "bf16" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 59, + "type": "CLIPVisionLoader", + "pos": [ + -583.8698120117188, + -168.6510009765625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP_VISION", + "type": "CLIP_VISION", + "links": [ + 70 + ] + } + ], + "properties": { + "Node name for S&R": "CLIPVisionLoader" + }, + "widgets_values": [ + "clip_vision_h.safetensors" + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 65, + "type": "WanVideoClipVisionEncode", + "pos": [ + -176.9497833251953, + -167.4617462158203 + ], + "size": [ + 327.5999755859375, + 242 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 70 + }, + { + "name": "image_1", + "type": "IMAGE", + "link": 73 + }, + { + "name": "image_2", + "shape": 7, + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "image_embeds", + "type": "WANVIDIMAGE_CLIPEMBEDS", + "links": [ + 69 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoClipVisionEncode" + }, + "widgets_values": [ + 1, + 1, + "center", + "average", + true, + 4, + 0.20000000000000004 + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 16, + "type": "WanVideoTextEncode", + "pos": [ + 787.8640747070312, + -91.52558898925781 + ], + "size": [ + 420.30511474609375, + 261.5306701660156 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "t5", + "type": "WANTEXTENCODER", + "link": 15 + }, + { + "name": "model_to_offload", + "shape": 7, + "type": "WANVIDEOMODEL", + "link": 79 + } + ], + "outputs": [ + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "slot_index": 0, + "links": [ + 30 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoTextEncode" + }, + "widgets_values": [ + "an old man is stroking his beard thoughtfully", + "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走", + true + ], + "color": "#332922", + "bgcolor": "#593930" + }, + { + "id": 27, + "type": "WanVideoSampler", + "pos": [ + 1315.2401123046875, + -401.48028564453125 + ], + "size": [ + 315, + 787 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 29 + }, + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "link": 30 + }, + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "link": 66 + }, + { + "name": "samples", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "feta_args", + "shape": 7, + "type": "FETAARGS", + "link": 80 + }, + { + "name": "context_options", + "shape": 7, + "type": "WANVIDCONTEXT", + "link": null + }, + { + "name": "teacache_args", + "shape": 7, + "type": "TEACACHEARGS", + "link": 56 + }, + { + "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 + } + ], + "outputs": [ + { + "name": "samples", + "type": "LATENT", + "slot_index": 0, + "links": [ + 33 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoSampler" + }, + "widgets_values": [ + 25, + 6, + 5, + 1057359483639287, + "fixed", + true, + "unipc", + 0, + 1, + "", + "comfy", + "" + ] + }, + { + "id": 55, + "type": "WanVideoEnhanceAVideo", + "pos": [ + 1312.6407470703125, + -596.7884521484375 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "feta_args", + "type": "FETAARGS", + "links": [ + 80 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoEnhanceAVideo" + }, + "widgets_values": [ + 2, + 0, + 1 + ] + }, + { + "id": 30, + "type": "VHS_VideoCombine", + "pos": [ + 1684.1597900390625, + -394.2595520019531 + ], + "size": [ + 1245.8460693359375, + 1573.8460693359375 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 36 + }, + { + "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": { + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 16, + "loop_count": 0, + "filename_prefix": "WanVideoWrapper_I2V", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": true, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "WanVideoWrapper_I2V_00709.mp4", + "subfolder": "", + "type": "output", + "format": "video/h264-mp4", + "frame_rate": 16, + "workflow": "WanVideoWrapper_I2V_00709.png", + "fullpath": "N:\\AI\\ComfyUI\\output\\WanVideoWrapper_I2V_00709.mp4" + } + } + } + }, { "id": 28, "type": "WanVideoDecode", @@ -856,17 +1126,17 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 36 - ], - "slot_index": 0 + ] } ], "properties": { "Node name for S&R": "WanVideoDecode" }, "widgets_values": [ - true, + false, 272, 272, 144, @@ -876,208 +1146,65 @@ "bgcolor": "#533" }, { - "id": 35, - "type": "WanVideoTorchCompileSettings", + "id": 22, + "type": "WanVideoModelLoader", "pos": [ - -276.8500671386719, - -1050.6326904296875 + 150, + -780 ], "size": [ - 390.5999755859375, - 178 + 477.4410095214844, + 226.43276977539062 ], "flags": {}, - "order": 16, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "torch_compile_args", - "type": "WANCOMPILEARGS", - "links": [], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoTorchCompileSettings" - }, - "widgets_values": [ - "inductor", - false, - "default", - false, - 64, - true - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 44, - "type": "Note", - "pos": [ - -620.9041137695312, - -1049.732421875 - ], - "size": [ - 303.0501403808594, - 88 - ], - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [], - "outputs": [], - "properties": {}, - "widgets_values": [ - "If you have Triton installed, connect this for ~30% speed increase" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 30, - "type": "VHS_VideoCombine", - "pos": [ - 1684.1597900390625, - -394.2595520019531 - ], - "size": [ - 1245.8460693359375, - 1573.8460693359375 - ], - "flags": {}, - "order": 28, + "order": 20, "mode": 0, "inputs": [ { - "name": "images", - "type": "IMAGE", - "link": 36 - }, - { - "name": "audio", - "type": "AUDIO", + "name": "compile_args", "shape": 7, + "type": "WANCOMPILEARGS", "link": null }, - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "shape": 7, - "link": null - }, - { - "name": "vae", - "type": "VAE", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null - } - ], - "properties": { - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 16, - "loop_count": 0, - "filename_prefix": "WanVideoWrapper_I2V", - "format": "video/h264-mp4", - "pix_fmt": "yuv420p", - "crf": 19, - "save_metadata": true, - "trim_to_audio": false, - "pingpong": false, - "save_output": true, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "WanVideo2_1_T2V_00256.mp4", - "subfolder": "", - "type": "output", - "format": "video/h264-mp4", - "frame_rate": 16, - "workflow": "WanVideo2_1_T2V_00256.png", - "fullpath": "N:\\AI\\ComfyUI\\output\\WanVideo2_1_T2V_00256.mp4" - } - } - } - }, - { - "id": 38, - "type": "WanVideoVAELoader", - "pos": [ - 169.25408935546875, - -322.9471740722656 - ], - "size": [ - 372.7727966308594, - 82 - ], - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "vae", - "type": "WANVAE", - "links": [ - 43, - 63 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoVAELoader" - }, - "widgets_values": [ - "wanvideo\\Wan2_1_VAE_bf16.safetensors", - "bf16" - ], - "color": "#322", - "bgcolor": "#533" - }, - { - "id": 39, - "type": "WanVideoBlockSwap", - "pos": [ - -210, - -760 - ], - "size": [ - 315, - 106 - ], - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [], - "outputs": [ { "name": "block_swap_args", + "shape": 7, "type": "BLOCKSWAPARGS", + "link": 50 + }, + { + "name": "lora", + "shape": 7, + "type": "WANVIDLORA", + "link": null + }, + { + "name": "vram_management_args", + "shape": 7, + "type": "VRAM_MANAGEMENTARGS", + "link": null + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "slot_index": 0, "links": [ - 50 - ], - "slot_index": 0 + 29, + 79 + ] } ], "properties": { - "Node name for S&R": "WanVideoBlockSwap" + "Node name for S&R": "WanVideoModelLoader" }, "widgets_values": [ - 20, - false, - false + "WanVideo\\Wan2_1-I2V-14B-480P_fp8_e4m3fn.safetensors", + "fp16", + "fp8_e4m3fn", + "offload_device", + "sdpa" ], "color": "#223", "bgcolor": "#335" @@ -1181,44 +1308,92 @@ "TEACACHEARGS" ], [ - 57, + 66, + 63, + 0, + 27, + 2, + "WANVIDIMAGE_EMBEDS" + ], + [ + 69, + 65, + 0, + 63, + 2, + "WANVIDIMAGE_CLIPEMBEDS" + ], + [ + 70, + 59, + 0, + 65, + 0, + "CLIP_VISION" + ], + [ + 72, + 58, + 0, + 66, + 0, + "IMAGE" + ], + [ + 73, + 66, + 0, + 65, + 1, + "IMAGE" + ], + [ + 74, + 66, + 0, + 63, + 0, + "IMAGE" + ], + [ + 75, + 66, + 1, + 63, + 4, + "INT" + ], + [ + 76, + 66, + 2, + 63, + 5, + "INT" + ], + [ + 77, + 38, + 0, + 63, + 1, + "WANVAE" + ], + [ + 79, + 22, + 0, + 16, + 1, + "WANVIDEOMODEL" + ], + [ + 80, 55, 0, 27, 4, "FETAARGS" - ], - [ - 58, - 56, - 0, - 57, - 0, - "CLIP_VISION" - ], - [ - 59, - 58, - 0, - 57, - 1, - "IMAGE" - ], - [ - 63, - 38, - 0, - 57, - 2, - "WANVAE" - ], - [ - 64, - 57, - 0, - 27, - 2, - "WANVIDIMAGE_EMBEDS" ] ], "groups": [ @@ -1239,16 +1414,17 @@ "config": {}, "extra": { "ds": { - "scale": 0.4594972986357498, + "scale": 0.6115909044841832, "offset": [ - 1140.269833168491, - 1117.2515633785054 + 1066.099511487144, + 1189.0841914350103 ] }, "node_versions": { - "ComfyUI-WanVideoWrapper": "721cd65e7b5224c70a3d20446d9d561f1732216b", - "comfy-core": "0.3.19", - "ComfyUI-VideoHelperSuite": "2c25b8b53835aaeb63f831b3137c705cf9f85dce" + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "comfy-core": "0.3.26", + "ComfyUI-KJNodes": "a5bd3c86c8ed6b83c55c2d0e7a59515b15a0137f", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8" }, "VHS_latentpreview": true, "VHS_latentpreviewrate": 0, diff --git a/example_workflows/wanvideo_T2V_example_02.json b/example_workflows/wanvideo_T2V_example_02.json index efc4370..124f772 100644 --- a/example_workflows/wanvideo_T2V_example_02.json +++ b/example_workflows/wanvideo_T2V_example_02.json @@ -1,4 +1,6 @@ { + "id": "c6e410bc-5e2c-460b-ae81-c91b6094fbb1", + "revision": 0, "last_node_id": 55, "last_link_id": 57, "nodes": [ @@ -21,10 +23,10 @@ { "name": "wan_t5_model", "type": "WANTEXTENCODER", + "slot_index": 0, "links": [ 15 - ], - "slot_index": 0 + ] } ], "properties": { @@ -102,10 +104,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 36 - ], - "slot_index": 0 + ] } ], "properties": { @@ -192,10 +194,10 @@ { "name": "CONDITIONING", "type": "CONDITIONING", + "slot_index": 0, "links": [ 55 - ], - "slot_index": 0 + ] } ], "properties": { @@ -226,11 +228,11 @@ { "name": "CLIP", "type": "CLIP", + "slot_index": 0, "links": [ 52, 53 - ], - "slot_index": 0 + ] } ], "properties": { @@ -292,10 +294,10 @@ { "name": "CONDITIONING", "type": "CONDITIONING", + "slot_index": 0, "links": [ 54 - ], - "slot_index": 0 + ] } ], "properties": { @@ -307,92 +309,6 @@ "color": "#432", "bgcolor": "#653" }, - { - "id": 27, - "type": "WanVideoSampler", - "pos": [ - 1315.2401123046875, - -401.48028564453125 - ], - "size": [ - 315, - 574.1923217773438 - ], - "flags": {}, - "order": 21, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "link": 29 - }, - { - "name": "text_embeds", - "type": "WANVIDEOTEXTEMBEDS", - "link": 30 - }, - { - "name": "image_embeds", - "type": "WANVIDIMAGE_EMBEDS", - "link": 42 - }, - { - "name": "samples", - "type": "LATENT", - "shape": 7, - "link": null - }, - { - "name": "feta_args", - "type": "FETAARGS", - "shape": 7, - "link": 57 - }, - { - "name": "context_options", - "type": "WANVIDCONTEXT", - "shape": 7, - "link": null - }, - { - "name": "teacache_args", - "type": "TEACACHEARGS", - "shape": 7, - "link": 56 - }, - { - "name": "flowedit_args", - "type": "FLOWEDITARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "samples", - "type": "LATENT", - "links": [ - 33 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoSampler" - }, - "widgets_values": [ - 25, - 6, - 5, - 1057359483639287, - "fixed", - true, - "unipc", - 0, - 1 - ] - }, { "id": 45, "type": "WanVideoVRAMManagement", @@ -578,8 +494,8 @@ { "name": "torch_compile_args", "type": "WANCOMPILEARGS", - "links": [], - "slot_index": 0 + "slot_index": 0, + "links": [] } ], "properties": { @@ -626,7 +542,7 @@ ], "size": [ 315, - 106 + 130 ], "flags": {}, "order": 14, @@ -636,10 +552,10 @@ { "name": "block_swap_args", "type": "BLOCKSWAPARGS", + "slot_index": 0, "links": [ 50 - ], - "slot_index": 0 + ] } ], "properties": { @@ -648,7 +564,8 @@ "widgets_values": [ 20, false, - false + false, + true ], "color": "#223", "bgcolor": "#335" @@ -662,7 +579,7 @@ ], "size": [ 1245.8460693359375, - 334 + 1055.2188720703125 ], "flags": {}, "order": 23, @@ -675,20 +592,20 @@ }, { "name": "audio", - "type": "AUDIO", "shape": 7, + "type": "AUDIO", "link": null }, { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -745,26 +662,26 @@ "inputs": [ { "name": "compile_args", - "type": "WANCOMPILEARGS", "shape": 7, + "type": "WANCOMPILEARGS", "link": null }, { "name": "block_swap_args", - "type": "BLOCKSWAPARGS", "shape": 7, + "type": "BLOCKSWAPARGS", "link": 50 }, { "name": "lora", - "type": "WANVIDLORA", "shape": 7, + "type": "WANVIDLORA", "link": null }, { "name": "vram_management_args", - "type": "VRAM_MANAGEMENTARGS", "shape": 7, + "type": "VRAM_MANAGEMENTARGS", "link": null } ], @@ -772,10 +689,10 @@ { "name": "model", "type": "WANVIDEOMODEL", + "slot_index": 0, "links": [ 29 - ], - "slot_index": 0 + ] } ], "properties": { @@ -810,16 +727,22 @@ "name": "t5", "type": "WANTEXTENCODER", "link": 15 + }, + { + "name": "model_to_offload", + "shape": 7, + "type": "WANVIDEOMODEL", + "link": null } ], "outputs": [ { "name": "text_embeds", "type": "WANVIDEOTEXTEMBEDS", + "slot_index": 0, "links": [ 30 - ], - "slot_index": 0 + ] } ], "properties": { @@ -852,10 +775,10 @@ { "name": "vae", "type": "WANVAE", + "slot_index": 0, "links": [ 43 - ], - "slot_index": 0 + ] } ], "properties": { @@ -905,6 +828,106 @@ "Node name for S&R": "WanVideoTextEmbedBridge" }, "widgets_values": [] + }, + { + "id": 27, + "type": "WanVideoSampler", + "pos": [ + 1315.2401123046875, + -401.48028564453125 + ], + "size": [ + 315, + 574.1923217773438 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 29 + }, + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "link": 30 + }, + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "link": 42 + }, + { + "name": "samples", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "feta_args", + "shape": 7, + "type": "FETAARGS", + "link": 57 + }, + { + "name": "context_options", + "shape": 7, + "type": "WANVIDCONTEXT", + "link": null + }, + { + "name": "teacache_args", + "shape": 7, + "type": "TEACACHEARGS", + "link": 56 + }, + { + "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 + } + ], + "outputs": [ + { + "name": "samples", + "type": "LATENT", + "slot_index": 0, + "links": [ + 33 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoSampler" + }, + "widgets_values": [ + 25, + 6, + 5, + 1057359483639287, + "fixed", + true, + "unipc", + 0, + 1, + false, + "comfy" + ] } ], "links": [ @@ -1046,9 +1069,9 @@ ] }, "node_versions": { - "ComfyUI-WanVideoWrapper": "bc11af31e4e720e6926a0612e88b65c3d1c49fc7", - "comfy-core": "0.3.23", - "ComfyUI-VideoHelperSuite": "2c25b8b53835aaeb63f831b3137c705cf9f85dce" + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "comfy-core": "0.3.26", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8" }, "VHS_latentpreview": true, "VHS_latentpreviewrate": 0, diff --git a/example_workflows/wanvideo_long_T2V_example_01.json b/example_workflows/wanvideo_long_T2V_example_01.json index fd41120..5188e4a 100644 --- a/example_workflows/wanvideo_long_T2V_example_01.json +++ b/example_workflows/wanvideo_long_T2V_example_01.json @@ -1,4 +1,6 @@ { + "id": "8b7a9a57-2303-4ef5-9fc2-bf41713bd1fc", + "revision": 0, "last_node_id": 46, "last_link_id": 58, "nodes": [ @@ -44,10 +46,10 @@ { "name": "wan_t5_model", "type": "WANTEXTENCODER", + "slot_index": 0, "links": [ 15 - ], - "slot_index": 0 + ] } ], "properties": { @@ -90,10 +92,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 48 - ], - "slot_index": 0 + ] } ], "properties": { @@ -107,67 +109,6 @@ 128 ] }, - { - "id": 22, - "type": "WanVideoModelLoader", - "pos": [ - 620.3950805664062, - -357.8426818847656 - ], - "size": [ - 477.4410095214844, - 226.43276977539062 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "compile_args", - "type": "WANCOMPILEARGS", - "shape": 7, - "link": 54 - }, - { - "name": "block_swap_args", - "type": "BLOCKSWAPARGS", - "shape": 7, - "link": null - }, - { - "name": "lora", - "type": "WANVIDLORA", - "shape": 7, - "link": null - }, - { - "name": "vram_management_args", - "type": "VRAM_MANAGEMENTARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "links": [ - 29 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoModelLoader" - }, - "widgets_values": [ - "WanVideo\\Wan2_1-T2V-1_3B_fp32.safetensors", - "fp16", - "disabled", - "offload_device", - "sageattn" - ] - }, { "id": 38, "type": "WanVideoVAELoader", @@ -187,10 +128,10 @@ { "name": "vae", "type": "WANVAE", + "slot_index": 0, "links": [ 43 - ], - "slot_index": 0 + ] } ], "properties": { @@ -226,26 +167,26 @@ { "name": "image", "type": "IMAGE", + "slot_index": 0, "links": [ 56 - ], - "slot_index": 0 + ] }, { - "name": "width", "label": "832 width", + "name": "width", "type": "INT", "links": null }, { - "name": "height", "label": "480 height", + "name": "height", "type": "INT", "links": null }, { - "name": "count", "label": "257 count", + "name": "count", "type": "INT", "links": null } @@ -267,23 +208,29 @@ 261.5306701660156 ], "flags": {}, - "order": 9, + "order": 10, "mode": 0, "inputs": [ { "name": "t5", "type": "WANTEXTENCODER", "link": 15 + }, + { + "name": "model_to_offload", + "shape": 7, + "type": "WANVIDEOMODEL", + "link": null } ], "outputs": [ { "name": "text_embeds", "type": "WANVIDEOTEXTEMBEDS", + "slot_index": 0, "links": [ 30 - ], - "slot_index": 0 + ] } ], "properties": { @@ -317,20 +264,20 @@ }, { "name": "audio", - "type": "AUDIO", "shape": 7, + "type": "AUDIO", "link": null }, { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -422,10 +369,8 @@ { "name": "torch_compile_args", "type": "WANCOMPILEARGS", - "links": [ - 54 - ], - "slot_index": 0 + "slot_index": 0, + "links": [] } ], "properties": { @@ -440,130 +385,6 @@ true ] }, - { - "id": 43, - "type": "WanVideoContextOptions", - "pos": [ - 1306.3160400390625, - -808.3861083984375 - ], - "size": [ - 315, - 178 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "context_options", - "type": "WANVIDCONTEXT", - "links": [ - 57 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoContextOptions" - }, - "widgets_values": [ - "uniform_standard", - 81, - 4, - 16, - true, - false - ] - }, - { - "id": 27, - "type": "WanVideoSampler", - "pos": [ - 1315.2401123046875, - -401.48028564453125 - ], - "size": [ - 315, - 574.1923217773438 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "WANVIDEOMODEL", - "link": 29 - }, - { - "name": "text_embeds", - "type": "WANVIDEOTEXTEMBEDS", - "link": 30 - }, - { - "name": "image_embeds", - "type": "WANVIDIMAGE_EMBEDS", - "link": 42 - }, - { - "name": "samples", - "type": "LATENT", - "shape": 7, - "link": null - }, - { - "name": "feta_args", - "type": "FETAARGS", - "shape": 7, - "link": null - }, - { - "name": "context_options", - "type": "WANVIDCONTEXT", - "shape": 7, - "link": 57 - }, - { - "name": "teacache_args", - "type": "TEACACHEARGS", - "shape": 7, - "link": 58 - }, - { - "name": "flowedit_args", - "type": "FLOWEDITARGS", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "samples", - "type": "LATENT", - "links": [ - 33 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoSampler" - }, - "widgets_values": [ - 30, - 6, - 5, - 1057359483639288, - "fixed", - true, - "unipc", - 0, - 1, - "" - ] - }, { "id": 45, "type": "WanVideoTeaCache", @@ -576,7 +397,7 @@ 154 ], "flags": {}, - "order": 6, + "order": 5, "mode": 0, "inputs": [], "outputs": [ @@ -611,7 +432,7 @@ 108.62744140625 ], "flags": {}, - "order": 7, + "order": 6, "mode": 0, "inputs": [], "outputs": [], @@ -634,7 +455,7 @@ 88 ], "flags": {}, - "order": 8, + "order": 7, "mode": 0, "inputs": [], "outputs": [], @@ -644,6 +465,213 @@ ], "color": "#432", "bgcolor": "#653" + }, + { + "id": 27, + "type": "WanVideoSampler", + "pos": [ + 1315.2401123046875, + -401.48028564453125 + ], + "size": [ + 315, + 574.1923217773438 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "link": 29 + }, + { + "name": "text_embeds", + "type": "WANVIDEOTEXTEMBEDS", + "link": 30 + }, + { + "name": "image_embeds", + "type": "WANVIDIMAGE_EMBEDS", + "link": 42 + }, + { + "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": 57 + }, + { + "name": "teacache_args", + "shape": 7, + "type": "TEACACHEARGS", + "link": 58 + }, + { + "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 + } + ], + "outputs": [ + { + "name": "samples", + "type": "LATENT", + "slot_index": 0, + "links": [ + 33 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoSampler" + }, + "widgets_values": [ + 30, + 6, + 5, + 1057359483639288, + "fixed", + true, + "unipc", + 0, + 1, + "", + "comfy" + ] + }, + { + "id": 43, + "type": "WanVideoContextOptions", + "pos": [ + 1307.9542236328125, + -855.8865356445312 + ], + "size": [ + 315, + 226 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "WANVAE", + "link": null + } + ], + "outputs": [ + { + "name": "context_options", + "type": "WANVIDCONTEXT", + "slot_index": 0, + "links": [ + 57 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoContextOptions" + }, + "widgets_values": [ + "uniform_standard", + 81, + 4, + 16, + true, + false, + 6, + 2 + ] + }, + { + "id": 22, + "type": "WanVideoModelLoader", + "pos": [ + 620.3950805664062, + -357.8426818847656 + ], + "size": [ + 477.4410095214844, + 226.43276977539062 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "compile_args", + "shape": 7, + "type": "WANCOMPILEARGS", + "link": null + }, + { + "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 + } + ], + "outputs": [ + { + "name": "model", + "type": "WANVIDEOMODEL", + "slot_index": 0, + "links": [ + 29 + ] + } + ], + "properties": { + "Node name for S&R": "WanVideoModelLoader" + }, + "widgets_values": [ + "WanVideo\\wan2.1_t2v_1.3B_fp16.safetensors", + "fp16", + "disabled", + "offload_device", + "sdpa" + ] } ], "links": [ @@ -703,14 +731,6 @@ 0, "IMAGE" ], - [ - 54, - 35, - 0, - 22, - 0, - "WANCOMPILEARGS" - ], [ 56, 42, @@ -742,14 +762,14 @@ "ds": { "scale": 0.8140274938684471, "offset": [ - -154.19829473418952, - 830.5983033847808 + -122.25834160503663, + 993.5739491626379 ] }, "node_versions": { - "ComfyUI-WanVideoWrapper": "bc11af31e4e720e6926a0612e88b65c3d1c49fc7", - "ComfyUI-KJNodes": "d126b62cebee81ea14ec06ea7cd7526999cb0554", - "ComfyUI-VideoHelperSuite": "2c25b8b53835aaeb63f831b3137c705cf9f85dce" + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "ComfyUI-KJNodes": "a5bd3c86c8ed6b83c55c2d0e7a59515b15a0137f", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8" }, "VHS_latentpreview": true, "VHS_latentpreviewrate": 0, diff --git a/example_workflows/wanvideo_vid2vid_example_01.json b/example_workflows/wanvideo_vid2vid_example_01.json index 9a9de67..fe6692d 100644 --- a/example_workflows/wanvideo_vid2vid_example_01.json +++ b/example_workflows/wanvideo_vid2vid_example_01.json @@ -1,4 +1,6 @@ { + "id": "44436dc8-b9e0-461b-aea2-13203712292d", + "revision": 0, "last_node_id": 49, "last_link_id": 62, "nodes": [ @@ -44,8 +46,8 @@ { "name": "torch_compile_args", "type": "WANCOMPILEARGS", - "links": [], - "slot_index": 0 + "slot_index": 0, + "links": [] } ], "properties": { @@ -79,10 +81,10 @@ { "name": "wan_t5_model", "type": "WANTEXTENCODER", + "slot_index": 0, "links": [ 15 - ], - "slot_index": 0 + ] } ], "properties": { @@ -95,38 +97,6 @@ "disabled" ] }, - { - "id": 39, - "type": "WanVideoBlockSwap", - "pos": [ - 190.92202758789062, - -334.3497314453125 - ], - "size": [ - 315, - 106 - ], - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "block_swap_args", - "type": "BLOCKSWAPARGS", - "links": [], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "WanVideoBlockSwap" - }, - "widgets_values": [ - 20, - false, - false - ] - }, { "id": 28, "type": "WanVideoDecode", @@ -157,10 +127,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 54 - ], - "slot_index": 0 + ] } ], "properties": { @@ -204,10 +174,10 @@ { "name": "images", "type": "IMAGE", + "slot_index": 0, "links": [ 55 - ], - "slot_index": 0 + ] } ], "properties": {}, @@ -230,19 +200,19 @@ 551.455078125 ], "flags": {}, - "order": 4, + "order": 3, "mode": 0, "inputs": [ { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -250,18 +220,18 @@ { "name": "IMAGE", "type": "IMAGE", + "slot_index": 0, "links": [ 51 - ], - "slot_index": 0 + ] }, { "name": "frame_count", "type": "INT", + "slot_index": 1, "links": [ 56 - ], - "slot_index": 1 + ] }, { "name": "audio", @@ -374,7 +344,7 @@ 88 ], "flags": {}, - "order": 5, + "order": 4, "mode": 0, "inputs": [], "outputs": [], @@ -397,18 +367,18 @@ 82 ], "flags": {}, - "order": 6, + "order": 5, "mode": 0, "inputs": [], "outputs": [ { "name": "vae", "type": "WANVAE", + "slot_index": 0, "links": [ 43, 48 - ], - "slot_index": 0 + ] } ], "properties": { @@ -441,20 +411,20 @@ }, { "name": "audio", - "type": "AUDIO", "shape": 7, + "type": "AUDIO", "link": null }, { "name": "meta_batch", - "type": "VHS_BatchManager", "shape": 7, + "type": "VHS_BatchManager", "link": null }, { "name": "vae", - "type": "VAE", "shape": 7, + "type": "VAE", "link": null } ], @@ -503,7 +473,7 @@ ], "size": [ 315, - 222 + 242 ], "flags": {}, "order": 11, @@ -518,16 +488,22 @@ "name": "image", "type": "IMAGE", "link": 52 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": null } ], "outputs": [ { "name": "samples", "type": "LATENT", + "slot_index": 0, "links": [ 50 - ], - "slot_index": 0 + ] } ], "properties": { @@ -565,14 +541,14 @@ }, { "name": "get_image_size", - "type": "IMAGE", "shape": 7, + "type": "IMAGE", "link": null }, { "name": "width_input", - "type": "INT", "shape": 7, + "type": "INT", "widget": { "name": "width_input" }, @@ -580,8 +556,8 @@ }, { "name": "height_input", - "type": "INT", "shape": 7, + "type": "INT", "widget": { "name": "height_input" }, @@ -592,27 +568,27 @@ { "name": "IMAGE", "type": "IMAGE", + "slot_index": 0, "links": [ 52, 53 - ], - "slot_index": 0 + ] }, { "name": "width", "type": "INT", + "slot_index": 1, "links": [ 57 - ], - "slot_index": 1 + ] }, { "name": "height", "type": "INT", + "slot_index": 2, "links": [ 58 - ], - "slot_index": 2 + ] } ], "properties": { @@ -648,16 +624,22 @@ "name": "t5", "type": "WANTEXTENCODER", "link": 15 + }, + { + "name": "model_to_offload", + "shape": 7, + "type": "WANVIDEOMODEL", + "link": null } ], "outputs": [ { "name": "text_embeds", "type": "WANVIDEOTEXTEMBEDS", + "slot_index": 0, "links": [ 30 - ], - "slot_index": 0 + ] } ], "properties": { @@ -678,20 +660,20 @@ ], "size": [ 315, - 130 + 154 ], "flags": {}, - "order": 7, + "order": 6, "mode": 0, "inputs": [], "outputs": [ { "name": "teacache_args", "type": "TEACACHEARGS", + "slot_index": 0, "links": [ 62 - ], - "slot_index": 0 + ] } ], "properties": { @@ -737,32 +719,44 @@ }, { "name": "samples", - "type": "LATENT", "shape": 7, + "type": "LATENT", "link": 50 }, { "name": "feta_args", - "type": "FETAARGS", "shape": 7, + "type": "FETAARGS", "link": null }, { "name": "context_options", - "type": "WANVIDCONTEXT", "shape": 7, + "type": "WANVIDCONTEXT", "link": null }, { "name": "teacache_args", - "type": "TEACACHEARGS", "shape": 7, + "type": "TEACACHEARGS", "link": 62 }, { "name": "flowedit_args", - "type": "FLOWEDITARGS", "shape": 7, + "type": "FLOWEDITARGS", + "link": null + }, + { + "name": "slg_args", + "shape": 7, + "type": "SLGARGS", + "link": null + }, + { + "name": "loop_args", + "shape": 7, + "type": "LOOPARGS", "link": null } ], @@ -770,10 +764,10 @@ { "name": "samples", "type": "LATENT", + "slot_index": 0, "links": [ 33 - ], - "slot_index": 0 + ] } ], "properties": { @@ -789,7 +783,41 @@ "dpm++", 0, 0.5000000000000001, - "" + "", + "comfy" + ] + }, + { + "id": 39, + "type": "WanVideoBlockSwap", + "pos": [ + 194.8857879638672, + -363.0874938964844 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "block_swap_args", + "type": "BLOCKSWAPARGS", + "slot_index": 0, + "links": [] + } + ], + "properties": { + "Node name for S&R": "WanVideoBlockSwap" + }, + "widgets_values": [ + 20, + false, + false, + true ] }, { @@ -809,26 +837,26 @@ "inputs": [ { "name": "compile_args", - "type": "WANCOMPILEARGS", "shape": 7, + "type": "WANCOMPILEARGS", "link": null }, { "name": "block_swap_args", - "type": "BLOCKSWAPARGS", "shape": 7, + "type": "BLOCKSWAPARGS", "link": null }, { "name": "lora", - "type": "WANVIDLORA", "shape": 7, + "type": "WANVIDLORA", "link": null }, { "name": "vram_management_args", - "type": "VRAM_MANAGEMENTARGS", "shape": 7, + "type": "VRAM_MANAGEMENTARGS", "link": null } ], @@ -836,17 +864,17 @@ { "name": "model", "type": "WANVIDEOMODEL", + "slot_index": 0, "links": [ 29 - ], - "slot_index": 0 + ] } ], "properties": { "Node name for S&R": "WanVideoModelLoader" }, "widgets_values": [ - "WanVideo\\Wan2_1-T2V-1_3B_fp32.safetensors", + "WanVideo\\wan2.1_t2v_1.3B_fp16.safetensors", "fp16", "disabled", "offload_device", @@ -998,14 +1026,14 @@ "ds": { "scale": 0.6727499949326009, "offset": [ - 199.74475515722875, - 847.7568858434785 + 391.99039310194877, + 810.1005303189878 ] }, "node_versions": { - "ComfyUI-WanVideoWrapper": "721cd65e7b5224c70a3d20446d9d561f1732216b", - "ComfyUI-KJNodes": "4d8cd3daa4aa8c411c4a4a6a2a97199bd46d1b4e", - "ComfyUI-VideoHelperSuite": "2c25b8b53835aaeb63f831b3137c705cf9f85dce" + "ComfyUI-WanVideoWrapper": "5a2383621a05825d0d0437781afcb8552d9590fd", + "ComfyUI-KJNodes": "a5bd3c86c8ed6b83c55c2d0e7a59515b15a0137f", + "ComfyUI-VideoHelperSuite": "0a75c7958fe320efcb052f1d9f8451fd20c730a8" }, "VHS_latentpreview": true, "VHS_latentpreviewrate": 0, diff --git a/wanvideo/modules/model.py b/wanvideo/modules/model.py index 0d5bdd9..9162588 100644 --- a/wanvideo/modules/model.py +++ b/wanvideo/modules/model.py @@ -439,7 +439,7 @@ class WanAttentionBlock(nn.Module): # cross-attention & ffn function def cross_attn_ffn(x, context, context_lens, e, clip_fea_tokens=clip_fea_tokens): - x = x + self.cross_attn(self.norm3(x), context, context_lens) + x = x + self.cross_attn(self.norm3(x), context, context_lens, clip_fea_tokens=clip_fea_tokens) y = self.ffn(self.norm2(x).float() * (1 + e[4]) + e[3]) x = x.to(torch.float32) + (y.to(torch.float32) * e[5].to(torch.float32)) return x