Views
No views yet
SQUISH-IT to trigger the video generation.1import replicate
2
3input = {
4 "prompt": "SQUISH-IT",
5 "lora_url": "https://huggingface.co/zsxkib/squish-pika-lora/resolve/main/wan-14b-t2v-squish-it-lora.safetensors"
6}
7
8output = replicate.run(
9 "fofr/wan-with-lora:latest",
10 model="14B",
11 input=input
12)
13for index, item in enumerate(output):
14 with open(f"output_{index}.mp4", "wb") as file:
15 file.write(item.read())1import torch
2from diffusers.utils import export_to_video
3from diffusers import WanVidAdapter, WanVid
4
5# Load base model
6base_model = WanVid.from_pretrained("Wan-AI/Wan2.1-T2V-14B-Diffusers", torch_dtype=torch.float16)
7
8# Load and apply LoRA adapter
9adapter = WanVidAdapter.from_pretrained("zsxkib/squish-pika-lora")
10base_model.load_adapter(adapter)
11
12# Generate video
13prompt = "SQUISH-IT"
14negative_prompt = "blurry, low quality, low resolution"
15
16# Generate video frames
17frames = base_model(
18 prompt=prompt,
19 negative_prompt=negative_prompt,
20 num_inference_steps=30,
21 guidance_scale=5.0,
22 width=832,
23 height=480,
24 fps=16,
25 num_frames=32,
26).frames[0]
27
28# Save as video
29video_path = "output.mp4"
30export_to_video(frames, video_path, fps=16)
31print(f"Video saved to: {video_path}")