Instructions to use Shriramnag/Shiv-AI-Video-Generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Shriramnag/Shiv-AI-Video-Generator with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Shriramnag/Shiv-AI-Video-Generator", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Added Master app.py with Shri Ram Nag branding
Browse files
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)
|