From 384d1a81987dec9402690801f4696d0c84244a17 Mon Sep 17 00:00:00 2001 From: Artiprocher Date: Thu, 6 Mar 2025 16:28:23 +0800 Subject: [PATCH] wan image encoder to fp16 --- examples/wanvideo/wan_14b_image_to_video.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/wanvideo/wan_14b_image_to_video.py b/examples/wanvideo/wan_14b_image_to_video.py index b429788..db4d6da 100644 --- a/examples/wanvideo/wan_14b_image_to_video.py +++ b/examples/wanvideo/wan_14b_image_to_video.py @@ -9,6 +9,10 @@ snapshot_download("Wan-AI/Wan2.1-I2V-14B-480P", local_dir="models/Wan-AI/Wan2.1- # Load models model_manager = ModelManager(device="cpu") +model_manager.load_models( + ["models/Wan-AI/Wan2.1-I2V-14B-480P/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth"], + torch_dtype=torch.float16, # Image Encoder is loaded with float16 +) model_manager.load_models( [ [ @@ -20,7 +24,6 @@ model_manager.load_models( "models/Wan-AI/Wan2.1-I2V-14B-480P/diffusion_pytorch_model-00006-of-00007.safetensors", "models/Wan-AI/Wan2.1-I2V-14B-480P/diffusion_pytorch_model-00007-of-00007.safetensors", ], - "models/Wan-AI/Wan2.1-I2V-14B-480P/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth", "models/Wan-AI/Wan2.1-I2V-14B-480P/models_t5_umt5-xxl-enc-bf16.pth", "models/Wan-AI/Wan2.1-I2V-14B-480P/Wan2.1_VAE.pth", ],