Shriramnag commited on
Commit
e61fc38
·
verified ·
1 Parent(s): b23071f

Added Master app.py with Shri Ram Nag branding

Browse files
Files changed (1) hide show
  1. app.py +41 -0
app.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import torch
3
+ from diffusers import LTXVideoPipeline
4
+ from diffusers.utils import export_to_video
5
+
6
+ # --------------------------------------------------
7
+ # Project: Shiv AI Video Generator
8
+ # Owner: Shri Ram Nag
9
+ # Model: Based on LTX-Video Engine (Turbo Speed)
10
+ # --------------------------------------------------
11
+
12
+ def run_shiv_ai(prompt, negative_prompt="", num_frames=24):
13
+ device = "cuda" if torch.cuda.is_available() else "cpu"
14
+
15
+ print(f"--- Shiv AI: Generating Video for Shri Ram Nag ---")
16
+
17
+ # मॉडल लोड करना (हगिंग फेस से)
18
+ pipe = LTXVideoPipeline.from_pretrained(
19
+ "Shriramnag/Shiv-AI-Video-Generator",
20
+ torch_dtype=torch.float16
21
+ ).to(device)
22
+
23
+ # टर्बो स्पीड के लिए मेमोरी ऑप्टिमाइजेशन
24
+ pipe.enable_model_cpu_offload()
25
+
26
+ # वीडियो जनरेट करना
27
+ video_frames = pipe(
28
+ prompt=prompt,
29
+ negative_prompt=negative_prompt,
30
+ num_frames=num_frames,
31
+ decode_chunk_size=8,
32
+ ).frames[0]
33
+
34
+ output_video = "shiv_ai_output.mp4"
35
+ export_to_video(video_frames, output_video, fps=8)
36
+ print(f"Video saved as {output_video}")
37
+ return output_video
38
+
39
+ if __name__ == "__main__":
40
+ user_prompt = "A majestic cinematic shot of an Indian temple at sunrise, high quality"
41
+ run_shiv_ai(user_prompt)