Skip to content

Commit 40d40ef

Browse files
committed
Finished implementation of wanvideowrapper nodes, updated example workflows, added some benchmarking files for reference.
1 parent db931d6 commit 40d40ef

9 files changed

Lines changed: 1714 additions & 1567 deletions
738 KB
Loading
768 KB
Loading
547 KB
Loading
731 KB
Loading

assets/wan2_2_benchmark_v2.png

623 KB
Loading
1.61 MB
Loading

examples/wannvideowrapper/wanvideo2_2_I2V_A14B_example_WIP_Multigpu.json

Lines changed: 1104 additions & 984 deletions
Large diffs are not rendered by default.

examples/wannvideowrapper/wanvideo_T2V_example_MultiGPU.json

Lines changed: 591 additions & 572 deletions
Large diffs are not rendered by default.

wanvideo.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -830,29 +830,37 @@ def loadmodel(self, model, base_precision, load_device, device):
830830
original_loader = NODE_CLASS_MAPPINGS["DownloadAndLoadWav2VecModel"]()
831831
return original_loader.loadmodel(model, base_precision, load_device)
832832

833-
class WanVideoControlnetLoader:
833+
class WanVideoUni3C_ControlnetLoader:
834834
@classmethod
835835
def INPUT_TYPES(s):
836+
devices = get_device_list()
837+
default_device = devices[1] if len(devices) > 1 else devices[0]
836838
return {
837839
"required": {
838840
"model": (folder_paths.get_filename_list("controlnet"), {"tooltip": "These models are loaded from the 'ComfyUI/models/controlnet' -folder",}),
839-
840-
"base_precision": (["fp32", "bf16", "fp16"], {"default": "bf16"}),
841-
"quantization": (['disabled', 'fp8_e4m3fn', 'fp8_e4m3fn_fast', 'fp8_e5m2', 'fp8_e4m3fn_fast_no_ffn'], {"default": 'disabled', "tooltip": "optional quantization method"}),
842-
"load_device": (["main_device", "offload_device"], {"default": "main_device", "tooltip": "Initial device to load the model to, NOT recommended with the larger models unless you have 48GB+ VRAM"}),
841+
"base_precision": (["fp32", "bf16", "fp16"], {"default": "fp16"}),
842+
"quantization": (['disabled', 'fp8_e4m3fn', 'fp8_e5m2'], {"default": 'disabled', "tooltip": "optional quantization method"}),
843+
"load_device": (["main_device", "offload_device"], {"default": "main_device", "tooltip": "Initial device to load the model to, NOT recommended with the larger models unless you have 48GB+ VRAM"}),
844+
"device": (devices, {"default": default_device}),
845+
"attention_mode": ([
846+
"sdpa",
847+
"sageattn",
848+
], {"default": "sdpa"}),
843849
},
850+
"optional": {
851+
"compile_args": ("WANCOMPILEARGS", ),
852+
}
844853
}
845854

846855
RETURN_TYPES = ("WANVIDEOCONTROLNET",)
847856
RETURN_NAMES = ("controlnet", )
848857
FUNCTION = "loadmodel"
849-
CATEGORY = "WanVideoWrapper"
850-
DESCRIPTION = "Loads ControlNet model from 'https://huggingface.co/collections/TheDenk/wan21-controlnets-68302b430411dafc0d74d2fc'"
858+
CATEGORY = "multigpu/WanVideoWrapper"
851859

852-
def loadmodel(self, model, base_precision, load_device, quantization):
860+
def loadmodel(self, model, base_precision, load_device, quantization, attention_mode, compile_args=None):
853861
from . import set_current_device
854862

855863
set_current_device(device)
856-
857-
original_loader = NODE_CLASS_MAPPINGS["WanVideoControlnetLoader"]()
858-
return original_loader.loadmodel(model, base_precision, load_device, quantization)
864+
865+
original_loader = NODE_CLASS_MAPPINGS["WanVideoUni3C_ControlnetLoader"]()
866+
return original_loader.loadmodel(model, base_precision, load_device, quantization, attention_mode, compile_args)

0 commit comments

Comments
 (0)