Views
No views yet
./ComfyUI/models/diffusion_models./ComfyUI/models/text_encoders./ComfyUI/models/vae
./ComfyUI/models/clip_vision
pig is a lazy architecture for gguf node; it applies to all model, encoder and vae gguf file(s); if you try to run it in comfyui-gguf node, you might need to manually add pig in it's IMG_ARCH_LIST (under loader.py); easier than you edit the gguf file itself; btw, model architecture which compatible with comfyui-gguf, including wan, should work in gguf node1import torch
2from transformers import UMT5EncoderModel
3from diffusers import AutoencoderKLWan, WanVACEPipeline, WanVACETransformer3DModel, GGUFQuantizationConfig
4from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
5from diffusers.utils import export_to_video
6
7model_path = "https://huggingface.co/calcuis/wan-gguf/blob/main/wan2.1-v5-vace-1.3b-q4_0.gguf"
8transformer = WanVACETransformer3DModel.from_single_file(
9 model_path,
10 quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
11 torch_dtype=torch.bfloat16,
12 )
13
14text_encoder = UMT5EncoderModel.from_pretrained(
15 "chatpig/umt5xxl-encoder-gguf",
16 gguf_file="umt5xxl-encoder-q4_0.gguf",
17 torch_dtype=torch.bfloat16,
18 )
19
20vae = AutoencoderKLWan.from_pretrained(
21 "callgg/wan-decoder",
22 subfolder="vae",
23 torch_dtype=torch.float32
24 )
25
26pipe = WanVACEPipeline.from_pretrained(
27 "callgg/wan-decoder",
28 transformer=transformer,
29 text_encoder=text_encoder,
30 vae=vae,
31 torch_dtype=torch.bfloat16
32)
33
34flow_shift = 3.0
35pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
36pipe.enable_model_cpu_offload()
37pipe.vae.enable_tiling()
38
39prompt = "a pig moving quickly in a beautiful winter scenery nature trees sunset tracking camera"
40negative_prompt = "blurry ugly bad"
41
42output = pipe(
43 prompt=prompt,
44 negative_prompt=negative_prompt,
45 width=720,
46 height=480,
47 num_frames=57,
48 num_inference_steps=24,
49 guidance_scale=2.5,
50 conditioning_scale=0.0,
51 generator=torch.Generator().manual_seed(0),
52).frames[0]
53export_to_video(output, "output.mp4", fps=16)ggc v2
f32 status (avoid triggering time/text embedding key error for inference usage)