File size: 563 Bytes
c7cebb0
 
 
 
 
770f0de
c7cebb0
 
 
770f0de
c7cebb0
 
770f0de
c7cebb0
770f0de
c7cebb0
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import torch
from diffusers import MochiPipeline
from diffusers.utils import export_to_video
import gradio as gr
pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", variant="bf16", torch_dtype=torch.bfloat16)

# Enable memory savings
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k."
frames = pipe(prompt, num_frames=84).frames[0]

export_to_video(frames, "mochi.mp4", fps=30)

with gr.Blocks() as b:
    vid=gr.Video("mochi.mp4")
b.launch()