Views
No views yet
An old illustration of to trigger the image generation.pip install diffusers1import torch
2from diffusers.utils import export_to_video
3from diffusers import AutoencoderKLWan, WanPipeline
4from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
5model_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers"
6vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
7pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
8pipe.scheduler = UniPCMultistepScheduler.from_config(
9 pipe.scheduler.config,
10 flow_shift=5.0
11)
12pipe.to("cuda")
13pipe.load_lora_weights("amanuelcm/Wan2.1-T2V-1.3B-OldIllustration")
14pipe.enable_model_cpu_offload() # for low-vram environments
15prompt = "An old illustration of a mysterious clockmaker's workshop, filled with tiny gears, antique tools, and intricate machinery, drawn in the style of 19th-century engravings, extremely detailed linework, cross-hatching, high contrast ink, vintage texture, aged paper background, meticulous craftsmanship, historical accuracy, black and white etching style
16"
17negative_prompt = "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
18output = pipe(
19 prompt=prompt,
20 negative_prompt=negative_prompt,
21 height=480,
22 width=640,
23 num_frames=49,
24 guidance_scale=5.0,
25 num_inference_steps=32
26).frames[0]
27export_to_video(output, "output.mp4", fps=16)wget https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors
wget https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors
wget https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/diffusion_models/wan2.1_t2v_1.3B_fp16.safetensors