Skip to content
Node packVerifiedExternal
Open source

ComfyUI-WanVideoWrapper

Maintainer@kijaiCgrade

Package profile

Status
Verified
Publisher
@kijai
Source
GitHub
Stars
6.7K

README

ComfyUI wrapper nodes for WanVideo and related models.

Memory use update (again)

I've made everythign less reliant on torch.compile for VRAM efficiency, so things should work better even without it. Also figured workaround for some issues when using compile that made first run use drastically more VRAM, issue I battled with myself a lot.

Update notification that can affect memory use in old workflows

In a recent update I changed how unmerged LoRA weights are handled:

Previously mostly due to my laziness they were always loaded from RAM when used, this was of course inefficient and also made using torch.compile for LoRA applying difficult, thus forcing a graph break when using unmerged LoRAs.

Now the LoRA weights are assigned as buffers to the corresponding modules, so they are part of the blocks and obey the block swapping unifying the offloading and allowing LoRA weights to benefit from the prefetch feature for async offoading. Downside is that this means if you did not use block swap, you will see increased memory use as the LoRAs are part of the model and all on VRAM.

If you use block swap, the LoRAs are swapped along the rest of the block, but the block size is now larger, this means you may have to compensate with couple of more blocks swapped.

Example situation: you use 1GB LoRA unmerged and swap 20 blocks on 14B model, we can divide the LoRA size by block count, single block grows by 25MB, 20 blocks grow by 500MB, so your VRAM usage would be 500MB more than before, to compensate you swap 2 more blocks.

Unrelated other VRAM issue with torch.compile

After any update that modifies the model code and when using torch.compile it's common to run into issues with VRAM, this can be caused by using older pytorch/triton version without latest compile fixes, and/or from old triton caches, mostly in Windows. This manifests in the issue that first run of new input size may have drastically increased memory use, which can clear from simply running it again, and once cached, not manifest again. Again I've only seen this happen in Windows.

To clear your Triton cache you can delete the contents of following (default) folders:

C:\Users\<username>\.triton C:\Users\<username>\AppData\Local\Temp\torchinductor_<username>

Note: Due to the stupid amount of bots or people thinking this is some of video generation service, I've blocked new accounts from posting issues for now.

WORK IN PROGRESS (perpetually)

Why should I use custom nodes when WanVideo works natively?

Short answer: Unless it's a model/feature not available yet on native, you shouldn't.

Long answer: Due to the complexity of ComfyUI core code, and my lack of coding experience, in many cases it's far easier and faster to implement new models and features to a standalone wrapper, so this is a way to test things relatively quickly. I consider this my personal sandbox (which is obviously open for everyone) to play with without having to worry about compability issues etc, but as such this code is always work in progress and prone to have issues. Also not all new models end up being worth the trouble to implement in core Comfy, though I've also made some patcher nodes to allow using them in native workflows, such as the ATI node available in this wrapper. This is also the end goal, idea isn't to compete or even offer alternatives to everything available in native workflows. All that said (this is clearly not a sales pitch) I do appreciate everyone using these nodes to explore new releases and possibilities with WanVideo.

Installation

  1. Clone this repo into custom_nodes folder.
  2. Install dependencies: pip install -r requirements.txt or if you use the portable install, run this in ComfyUI_windows_portable -folder:

python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\requirements.txt

Models

https://huggin

Nodes in this pack

100 nodes
  • CreateCFGScheduleFloatList
  • CreateScheduleFloatList
  • DownloadAndLoadNLFModel
  • DownloadAndLoadWav2VecModel
  • DrawArcFaceLandmarks
  • DrawGaussianNoiseOnImage
  • DrawNLFPoses
  • DummyComfyWanModelObject
  • ExtractStartFramesForContinuations
  • FaceMaskFromPoseKeypoints
  • FantasyPortraitFaceDetector
  • FantasyPortraitModelLoader
  • FantasyTalkingModelLoader
  • FantasyTalkingWav2VecEmbeds
  • HuMoEmbeds
  • LandmarksToImage
  • LoadLynxResampler
  • LoadNLFModel
  • LoadVQVAE
  • LoadWanVideoClipTextEncoder
  • LoadWanVideoT5TextEncoder
  • LongCatAvatarWhisperEmbeds
  • LynxEncodeFaceIP
  • LynxInsightFaceCrop
  • MochaEmbeds
  • MTVCrafterEncodePoses
  • MultiTalkModelLoader
  • MultiTalkSilentEmbeds
  • MultiTalkWav2VecEmbeds
  • NLFPredict
  • NormalizeAudioLoudness
  • OviMMAudioVAELoader
  • QwenLoader
  • ReCamMasterPoseVisualizer
  • TextImageEncodeQwenVL
  • WanMove_native
  • WanVideoAddBindweaveEmbeds
  • WanVideoAddControlEmbeds
  • WanVideoAddDualControlEmbeds
  • WanVideoAddExtraLatent
  • WanVideoAddFantasyPortrait
  • WanVideoAddFlashVSRInput
  • WanVideoAddLucyEditLatents
  • WanVideoAddLynxEmbeds
  • WanVideoAddMTVMotion
  • WanVideoAddOneToAllExtendEmbeds
  • WanVideoAddOneToAllPoseEmbeds
  • WanVideoAddOneToAllReferenceEmbeds
  • WanVideoAddOviAudioToLatents
  • WanVideoAddPusaNoise
  • WanVideoAddS2VEmbeds
  • WanVideoAddSCAILPoseEmbeds
  • WanVideoAddSCAILReferenceEmbeds
  • WanVideoAddStandInLatent
  • WanVideoAddSteadyDancerEmbeds
  • WanVideoAddStoryMemLatents
  • WanVideoAddTTMLatents
  • WanVideoAddWanMoveTracks
  • WanVideoAnimateEmbeds
  • WanVideoApplyNAG
  • WanVideoATI_comfy
  • WanVideoATITracks
  • WanVideoATITracksVisualize
  • WanVideoBlockList
  • WanVideoBlockSwap
  • WanVideoClipVisionEncode
  • WanVideoCombineEmbeds
  • WanVideoContextOptions
  • WanVideoControlEmbeds
  • WanVideoControlnet
  • WanVideoControlnetLoader
  • WanVideoDecode
  • WanVideoDecodeOviAudio
  • WanVideoDiffusionForcingSampler
  • WanVideoEasyCache
  • WanVideoEmptyEmbeds
  • WanVideoEmptyMMAudioLatents
  • WanVideoEncode
  • WanVideoEncodeLatentBatch
  • WanVideoEncodeOviAudio
  • WanVideoEnhanceAVideo
  • WanVideoExperimentalArgs
  • WanVideoExtraModelSelect
  • WanVideoFlashVSRDecoderLoader
  • WanVideoFreeInitArgs
  • WanVideoFunCameraEmbeds
  • WanVideoImageClipEncode
  • WanVideoImageResizeToClosest
  • WanVideoImageToVideoEncode
  • WanVideoImageToVideoMultiTalk
  • WanVideoImageToVideoSkyreelsv3_audio
  • WanVideoLatentReScale
  • WanVideoLongCatAvatarExtendEmbeds
  • WanVideoLoopArgs
  • WanVideoLoraBlockEdit
  • WanVideoLoraSelect
  • WanVideoLoraSelectByName
  • WanVideoLoraSelectMulti
  • WanVideoMagCache
  • WanVideoMiniMaxRemoverEmbeds

Related resources

40 connections
Used byVideo Extension (Wan2.1-VACE-14B) — v1.0Used bySelf Forcing Optimization Consistent Image Generation Video V1 (Official Node Version) — v1.0Used byWan2.1 Vace One-Click Generate 3+ Minute Videos!!MV? Movie? — For loop Vace v2.0Used byWan2.2 Dyno Video Acceleration Edition V2 (KJ Edition) — v1.0Used by(KJ Edition) Wan+Flash VSR Video Blur to HD V1 — v1.0Used byCamera Control - Wan2.1-Fun-V1.1-Control-Camera — v1.0Used byInfiniteTalk - with Single speaker - Simple workflow (subgraphs) — v4.0Used byDitto_ Anime Video to Human Workflow — v1.0Used bySteadyDancer Motion Transfer V1 (Cartoon Edition) — v1.0Used byUni3C+ op-mirror control Toussaint Video V1 (4x acceleration) — v1.0Used byFun+control+camera stable optimization accelerated version mirror movement and main body displacement video guidance V1 — v1.0Used byOne-To-All+TI2V Action Migration Workflow V1 — v1.0Used byWAN2.1-VACE-14B 1.3B GGUF 6 steps AIO (t2v-i2v-v2v-FLF-controlnet-masking-long duration) simple ComfyUI workflow — VACE-Ultimate.v1.250724Used by(KJ version) Wan2.2+Fun+Control Deep Control Accelerated Edition — v1.0Used byQwen2509 & Next Scene consistency-enhanced next-shot prediction — v1.0Used byWAN-VACE (Image Reference) — v1.0Used byWan 2.2 Lightning T2V I2V ComfyUI | Ultra Fast Video Gen — v1.0Used byComfy Challenge 7 (Impossible Dishes) - Image-to-Video Generation — v1.0Used byVACE & InfiniteTalk & StandIn Control + Reference + Voiceover + Lip Sync — v1.0Used byWan-Animate-SecNodes character replacement — v1.0Used byWan2.2+Fun+Vace Modified Edition High-Quality Video Subject Reference Replacement V1 — v1.0Used byComfyUI Fantasy Portrait Workflow | Identity-Rich Motion from Portraits — v1.0Used byWan2.2+ Prompt Word Tool + API-free Video Expansion 3-shot Video Acceleration Edition — v1.0Used byVACE First + Last Frame | Animate Keyframes with VACE! — Vace FL Native + WrapperUsed byhumo dual-image reference — v1.0Used byFlash VSR video super-resolution — v1.0Used byWanmove+Fill+Nodes Dynamic and Static Trajectory Control V1 (Distorted Art) — v1.0Used byWanvideo 14b MasterModel Workflow — Text2VideoUsed by"One-to-All Extend Video" Workflow — v1.0Used byKJ Flow + KJ New Version Lightx2v Image Generation Video — v1.0Used byComprehensive Video Watermark Removal - minimax Version, Video Erasure, Online Supported超全视频去水印-minimax版本 视频抹除 支持在线 — v1Used byWan2_2 Fun VACE Video Face Swap With High Fidelity — v1.0Used byAniWan Professional Anime Ultra-High Dynamic Image Video Acceleration Edition — v1.0Used byWan2_2 Fun VACE Multi_Reference Image to Video — v1.0Used byMultiTalk Dual-Player Accelerated Edition High-Motion Camera Edition V1 — v1.0Used byComfy Challenge 4+Qwen+image+Wan2.2+Fun Full-Body Pose Control V1 — v1.0Used byLightX2v+Rank64 Extreme Quality + AniWan Ultra-High Dynamic Image Video Acceleration Edition — v1.0Used byUnilumos+FlashVSR Super-Resolution Video Relighting V1 — v1.0Used byMultiTalk Single Player + Wan2.2 (Low) + Sigma Scheduling KJ Acceleration V4 (Full Body Dynamic Version UNI3C Camera Movement) — v1.0Used byWan-Move latent trajectory-guided video generation — v1.0

Sources

3 sources
GitHubSource
github.com/kijai/ComfyUI-WanVideoWrapper

Verified Oct 14

GitHubSourceVersion 088128b224242e110d3906c6750e9a3a348a659b
github.com/kijai/ComfyUI-WanVideoWrapper

Verified Oct 13

Source excerpts

1 excerpt

Source context: Repo kijai/ComfyUI-WanVideoWrapper