Views
No views yet
1import torch
2from diffusers import AutoencoderKLWan, WanPipeline
3from diffusers.utils import export_to_video
4model_id = "xilanhua12138/Wan2.1-T2V-1.3B-Reward"
5vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
6pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
7pipe.to("cuda")
8prompt = "A cat walks on the grass, realistic"
9negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
10output = pipe(
11 prompt=prompt,
12 negative_prompt=negative_prompt,
13 height=480,
14 width=832,
15 num_frames=81,
16 guidance_scale=5.0
17).frames[0]
18export_to_video(output, "output.mp4", fps=15)| Original | After Reward |
|---|---|
| Original | After Reward |
|---|---|