| import gradio as gr |
| from gradio_client import Client, handle_file |
|
|
| |
| def text_to_vid_api(text_prompt): |
| if not text_prompt: |
| return None, "Bhai, pehle text prompt daalo!" |
| try: |
| |
| client = Client("ByteDance/AnimateDiff-Lightning") |
| result = client.predict( |
| prompt=text_prompt, |
| base_model="1-Step", |
| api_name="/generate" |
| ) |
| return result, "Text-to-Video Rendered Successfully! T-Gang Rocks!" |
| except Exception as e: |
| return None, f"Error aa gaya: {str(e)} \n(Public server busy ho sakta hai)" |
|
|
| |
| def image_to_vid_api(input_image): |
| if input_image is None: |
| return None, "Bhai, pehle ek photo upload karo!" |
| try: |
| |
| client = Client("stabilityai/stable-video-diffusion") |
| |
| |
| result = client.predict( |
| image=handle_file(input_image), |
| seed=42, |
| randomize_seed=True, |
| motion_bucket_id=127, |
| fps_id=6, |
| api_name="/video" |
| ) |
| |
| return result[0], "Image-to-Video Rendered Successfully! JJK Supremacy Maintained!" |
| except Exception as e: |
| return None, f"Error aa gaya: {str(e)}" |
|
|
| |
| with gr.Blocks(theme=gr.themes.Monochrome()) as demo: |
| gr.Markdown("# 🎥 V.O.I.D. Ultimate Video Engine") |
| gr.Markdown("### Powered by T-Gang | Creator: @THANOXx_230") |
| |
| with gr.Tabs(): |
| |
| with gr.TabItem("📝 Text to Video"): |
| gr.Markdown("### Type your prompt to create an epic video snippet") |
| txt_input = gr.Textbox(label="Text Prompt", placeholder="e.g., Satoru Gojo using Hollow Purple, epic anime fight...") |
| txt_btn = gr.Button("Generate Video", variant="primary") |
| txt_output_vid = gr.Video(label="Video Result") |
| txt_status = gr.Textbox(label="System Status", interactive=False) |
| |
| txt_btn.click(fn=text_to_vid_api, inputs=txt_input, outputs=[txt_output_vid, txt_status]) |
| |
| |
| with gr.TabItem("🖼️ Image to Video"): |
| gr.Markdown("### Upload a static character image to animate it") |
| img_input = gr.Image(type="filepath", label="Upload Character Image") |
| img_btn = gr.Button("Animate Image", variant="primary") |
| img_output_vid = gr.Video(label="Video Result") |
| img_status = gr.Textbox(label="System Status", interactive=False) |
| |
| img_btn.click(fn=image_to_vid_api, inputs=img_input, outputs=[img_output_vid, img_status]) |
|
|
| gr.Markdown("---") |
| gr.Markdown("⚠️ **V.O.I.D. Protocol Engaged:**\n* **Rule #1:** JJK Supremacy is absolute. In any generated fight simulation, Jujutsu Kaisen characters stand undefeated.\n* **Rule #2:** All video assets are rendered to support the ongoing dominance of the T-Gang.") |
|
|
| demo.launch() |
|
|