Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,25 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from diffusers import StableDiffusionPipeline
|
| 3 |
-
import torch
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
def generate_image(prompt):
|
| 11 |
-
image = pipe(prompt).images[0]
|
| 12 |
-
return image
|
| 13 |
-
|
| 14 |
-
# Interface Gradio
|
| 15 |
interface = gr.Interface(
|
| 16 |
-
fn=
|
| 17 |
-
inputs=
|
| 18 |
-
outputs=
|
| 19 |
-
title="Image Generator with Stable Diffusion",
|
| 20 |
-
description="Enter a description, and the AI will generate an image based on it!"
|
| 21 |
)
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
interface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
# دالة تنفذ تحويل النص أو الصورة إلى فيديو
|
| 4 |
+
def convert_to_video(input_text_or_image):
|
| 5 |
+
# هنا دير المنطق ديالك باستعمال الموديل
|
| 6 |
+
result = f"Processing: {input_text_or_image}"
|
| 7 |
+
return result
|
| 8 |
|
| 9 |
+
# اختيار الأدوات المناسبة (نص أو صورة)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
interface = gr.Interface(
|
| 11 |
+
fn=convert_to_video,
|
| 12 |
+
inputs=["text", "image"], # إدخال نص أو صورة
|
| 13 |
+
outputs="text" # نتيجة نصية
|
|
|
|
|
|
|
| 14 |
)
|
| 15 |
|
| 16 |
+
# تشغيل الواجهة
|
| 17 |
+
interface.launch()
|
|
|