Views
No views yet
CYB77 or "In the style ocf CYB77" to trigger the video generation.1import replicate
2
3input = {
4 "prompt": "CYB77",
5 "image": "https://replicate.delivery/xezq/4BGR8w4ELvJfcqIG4KIF0Kr82JxtfQCM2xVAIUieSeifmTZjC/output_frame.jpg",
6 "lora_url": "https://huggingface.co/fofr/wan-14b-cyberpunk-realistic/resolve/main/wan-14b-i2v-cyberpunk-realistic-lora.safetensors"
7}
8
9output = replicate.run(
10 "fofr/wan2.1-with-lora:f83b84064136a38415a3aff66c326f94c66859b8ad7a2cb432e2822774f07b08",
11 model="14b",
12 input=input
13)
14for index, item in enumerate(output):
15 with open(f"output_{index}.mp4", "wb") as file:
16 file.write(item.read())pip install git+https://github.com/huggingface/diffusers.git1import torch
2from diffusers.utils import export_to_video
3from diffusers import AutoencoderKLWan, WanPipeline
4from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
5
6model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
7vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
8pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
9flow_shift = 3.0 # 5.0 for 720P, 3.0 for 480P
10pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
11pipe.to("cuda")
12
13pipe.load_lora_weights("fofr/wan-14b-cyberpunk-realistic")
14
15pipe.enable_model_cpu_offload() #for low-vram environments
16
17prompt = "CYB77"
18negative_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"
19
20output = pipe(
21 prompt=prompt,
22 negative_prompt=negative_prompt,
23 height=480,
24 width=832,
25 num_frames=81,
26 guidance_scale=5.0,
27).frames[0]
28export_to_video(output, "output.mp4", fps=16)