Quantized text encoder models for WAN (World Animated Network) 2.2 QX video generation system. These GGUF-format encoders provide efficient text-to-embedding conversion for text-to-video and image-to-video generation workflows with significantly reduced VRAM requirements.
This repository contains 8 quantized variants of the UMT5-XXL text encoder, optimized for WAN 2.2 QX video generation pipelines. The GGUF format enables efficient inference with reduced memory footprint while maintaining high-quality text understanding for video generation prompts.
1from diffusers import DiffusionPipeline
2import torch
3
4# Load WAN 2.2 QX pipeline with quantized text encoder
5pipe = DiffusionPipeline.from_pretrained(
6 "path/to/wan-2.2-qx",
7 text_encoder_path="E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q4-k-m.gguf",
8 torch_dtype=torch.float16,
9 variant="fp16"
10)
11
12# Move pipeline to GPU
13pipe = pipe.to("cuda")
14
15# Generate video from text
16prompt = "A serene mountain landscape at sunset with flowing clouds"
17video_frames = pipe(
18 prompt=prompt,
19 num_frames=24,
20 num_inference_steps=30
21).frames
22
23# Save video
24save_video(video_frames, "output.mp4", fps=8)
1from diffusers import DiffusionPipeline
2import torch
3
4# Use Q3_K_S encoder for minimum VRAM usage
5pipe = DiffusionPipeline.from_pretrained(
6 "path/to/wan-2.2-qx",
7 text_encoder_path="E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q3-k-s.gguf",
8 torch_dtype=torch.float16
9)
10
11# Enable memory optimizations
12pipe.enable_attention_slicing()
13pipe.enable_vae_slicing()
14pipe = pipe.to("cuda")
15
16# Generate with lower resolution
17video_frames = pipe(
18 prompt="A cat playing with a ball of yarn",
19 height=512,
20 width=512,
21 num_frames=16,
22 num_inference_steps=25
23).frames
1from diffusers import DiffusionPipeline
2import torch
3
4# Use Q8_0 encoder for maximum quality
5pipe = DiffusionPipeline.from_pretrained(
6 "path/to/wan-2.2-qx",
7 text_encoder_path="E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q8-0.gguf",
8 torch_dtype=torch.float16
9)
10
11pipe = pipe.to("cuda")
12
13# Generate high-quality video
14video_frames = pipe(
15 prompt="Cinematic shot of a futuristic cityscape with flying vehicles",
16 height=1024,
17 width=1024,
18 num_frames=48,
19 num_inference_steps=50,
20 guidance_scale=7.5
21).frames
1import torch
2from diffusers import DiffusionPipeline
3
4# Test different quantization levels
5encoders = {
6 "q3_k_m": "E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q3-k-m.gguf",
7 "q4_k_m": "E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q4-k-m.gguf",
8 "q5_k_m": "E:/huggingface/wan22-qx-encoders-gguf/text_encoders/umt5-xxl-encoder-q5-k-m.gguf",
9}
10
11prompt = "A beautiful garden with blooming flowers in spring"
12
13for name, encoder_path in encoders.items():
14 pipe = DiffusionPipeline.from_pretrained(
15 "path/to/wan-2.2-qx",
16 text_encoder_path=encoder_path,
17 torch_dtype=torch.float16
18 ).to("cuda")
19
20 video = pipe(prompt=prompt, num_frames=24).frames
21 save_video(video, f"output_{name}.mp4", fps=8)
22
23 # Clear VRAM
24 del pipe
25 torch.cuda.empty_cache()
This model repository uses a custom license. Please review the WAN model license terms before use.
1@misc{wan22-qx-encoders-gguf,
2 title={WAN 2.2 QX Text Encoders (GGUF)},
3 author={WAN Team},
4 year={2024},
5 howpublished={\url{https://huggingface.co/wan22-qx-encoders-gguf}},
6 note={Quantized UMT5-XXL text encoders for video generation}
7}