Views
No views yet
pip install git+https://github.com/Disty0/sdnq1import torch
2import numpy as np
3import diffusers
4from diffusers.utils import export_to_video, load_image
5from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
6
7vae = diffusers.AutoencoderKLWan.from_pretrained("Disty0/Wan2.2-T2V-A14B-SDNQ-uint4-svd-r32", subfolder="vae", torch_dtype=torch.float32)
8pipe = diffusers.WanPipeline.from_pretrained("Disty0/Wan2.2-T2V-A14B-SDNQ-uint4-svd-r32", vae=vae, torch_dtype=torch.bfloat16)
9pipe.enable_model_cpu_offload()
10
11height = 720
12width = 1280
13
14prompt = "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
15negative_prompt = "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
16output = pipe(
17 prompt=prompt,
18 negative_prompt=negative_prompt,
19 height=height,
20 width=width,
21 num_frames=81,
22 guidance_scale=4.0,
23 guidance_scale_2=3.0,
24 num_inference_steps=40,
25).frames[0]
26export_to_video(output, "t2v_out.mp4", fps=16)