Downloads · 30 days
0
wangkanai/wan22-fp16-encoders
wan22-fp16-encoders is a text-to-video model from wangkanai. Use it when you need video from a text prompt. It is set up for diffusers. The card lists the license as other.
High-precision FP16 text encoders for the WAN (Worldly Advanced Network) 2.2 text-to-video generation system. This repository contains the essential text encoding components required for WAN2.2 video generation workfl…
Downloads · 30 days
0
Access
Public
Updated Oct 28, 2025
Repo size
20.9 GB
Likes
2
Public
Click a slice to open those files.
.safetensors20.9 GB · 100%
From the Hugging Face model README
High-precision FP16 text encoders for the WAN (Worldly Advanced Network) 2.2 text-to-video generation system. This repository contains the essential text encoding components required for WAN2.2 video generation workflows.
This repository provides two specialized text encoder models optimized for video generation tasks:
These encoders are critical components of the WAN2.2 pipeline, responsible for transforming text prompts into high-dimensional semantic representations that guide the video generation process. The FP16 precision maintains excellent quality while reducing memory requirements compared to FP32 variants.
wan22-fp16-encoders/
└── text_encoders/
├── t5-xxl-fp16.safetensors # 8.9 GB
└── umt5-xxl-fp16.safetensors # 11 GB
| File | Size | Description |
|---|---|---|
t5-xxl-fp16.safetensors | 8.9 GB | T5-XXL text encoder (FP16) |
umt5-xxl-fp16.safetensors | 11 GB | Universal Multilingual T5-XXL encoder (FP16) |
Total Repository Size: ~20 GB
from diffusers import DiffusionPipeline
import torch
# Load WAN2.2 pipeline with custom text encoders
pipe = DiffusionPipeline.from_pretrained(
"your-wan22-model",
text_encoder_path="E:/huggingface/wan22-fp16-encoders/text_encoders/t5-xxl-fp16.safetensors",
torch_dtype=torch.float16,
variant="fp16"
).to("cuda")
# Generate video from text
prompt = "A serene mountain landscape at sunset with flowing clouds"
video = pipe(prompt, num_frames=24, height=512, width=512).frames
# Save output
video[0].save("output_video.mp4")
from diffusers import DiffusionPipeline
import torch
# Load with multilingual encoder
pipe = DiffusionPipeline.from_pretrained(
"your-wan22-model",
text_encoder_path="E:/huggingface/wan22-fp16-encoders/text_encoders/umt5-xxl-fp16.safetensors",
torch_dtype=torch.float16,
).to("cuda")
# Generate with multilingual prompt
prompt = "東京の夜景、ネオンライトと雨" # Japanese: Tokyo nightscape with neon lights and rain
video = pipe(prompt, num_frames=48, height=768, width=768).frames
from diffusers import DiffusionPipeline
import torch
# Enable CPU offloading for lower VRAM systems
pipe = DiffusionPipeline.from_pretrained(
"your-wan22-model",
text_encoder_path="E:/huggingface/wan22-fp16-encoders/text_encoders/t5-xxl-fp16.safetensors",
torch_dtype=torch.float16,
).to("cuda")
# Enable model CPU offload
pipe.enable_model_cpu_offload()
# Enable attention slicing for further memory reduction
pipe.enable_attention_slicing(1)
# Generate with reduced memory footprint
video = pipe(prompt, num_frames=16).frames
from safetensors.torch import load_file
import torch
# Load encoder weights directly
encoder_weights = load_file(
"E:/huggingface/wan22-fp16-encoders/text_encoders/t5-xxl-fp16.safetensors"
)
# Initialize your custom text encoder model
from transformers import T5EncoderModel
text_encoder = T5EncoderModel.from_pretrained("google/t5-v1_1-xxl", torch_dtype=torch.float16)
text_encoder.load_state_dict(encoder_weights)
text_encoder = text_encoder.to("cuda")
# Use encoder for custom workflows
# ... your custom inference code ...
enable_model_cpu_offload() for systems with <16 GB VRAMenable_attention_slicing() to reduce peak memory# Optimal configuration for quality and speed
pipe = DiffusionPipeline.from_pretrained(
"wan22-model",
text_encoder_path="E:/huggingface/wan22-fp16-encoders/text_encoders/t5-xxl-fp16.safetensors",
torch_dtype=torch.float16,
variant="fp16",
)
# Enable optimizations
pipe.enable_xformers_memory_efficient_attention() # Flash attention
pipe.enable_attention_slicing(1) # Memory efficiency
pipe.to("cuda")
# Use compiled model for production (PyTorch 2.0+)
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
These text encoder models are provided under specific licensing terms. Please refer to the original model sources for detailed license information:
Usage Restrictions: These models are intended for research and development purposes. Commercial usage should comply with respective license terms and any additional WAN project requirements.
If you use these text encoders in your research or projects, please cite the relevant papers:
@article{raffel2020exploring,
title={Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
author={Raffel, Colin and Shazeer, Noam and Roberts, Adam and Lee, Katherine and Narang, Sharan and Matena, Michael and Zhou, Yanqi and Li, Wei and Liu, Peter J},
journal={Journal of Machine Learning Research},
volume={21},
number={140},
pages={1--67},
year={2020}
}
@inproceedings{xue2021mt5,
title={mT5: A Massively Multilingual Pre-trained Text-to-Text Transformer},
author={Xue, Linting and Constant, Noah and Roberts, Adam and Kale, Mihir and Al-Rfou, Rami and Siddhant, Aditya and Barua, Aditya and Raffel, Colin},
booktitle={Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
pages={483--498},
year={2021}
}
Please check the official WAN project repository for citation guidelines and additional references.
E:/huggingface/wan22/E:/huggingface/wan22-vae/E:/huggingface/wan22-loras/For issues specific to these text encoders:
For WAN2.2 pipeline issues, please consult the main WAN project documentation and community resources.
Model Version: v1.2 Last Updated: 2025-10-28 Format: SafeTensors FP16 Compatibility: WAN2.2, Diffusers 0.21+, PyTorch 2.0+