sharul62628 commited on
Commit
b24b16f
·
verified ·
1 Parent(s): 4a64ad2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from diffusers import CogVideoXPipeline
3
+ from diffusers.utils import export_to_video
4
+
5
+ # Load pipeline
6
+ pipe = CogVideoXPipeline.from_pretrained(
7
+ "THUDM/CogVideoX-5b",
8
+ torch_dtype=torch.float16
9
+ )
10
+ pipe.enable_model_cpu_offload() # Hemat VRAM
11
+
12
+ # Prompt deskripsi manusia bergerak
13
+ prompt = "A woman in a red dress dancing gracefully in a studio, cinematic lighting, slow motion"
14
+
15
+ # Generate video
16
+ video = pipe(
17
+ prompt=prompt,
18
+ num_inference_steps=50,
19
+ guidance_scale=6.0,
20
+ height=480,
21
+ width=720,
22
+ ).frames[0]
23
+
24
+ # Simpan sebagai video
25
+ export_to_video(video, "human_dance.mp4", fps=8)
26
+
27
+ print("✅ Video generated: human_dance.mp4")