Spaces:
Runtime error
Runtime error
Switch to Docker (Python 3.10) for ultimate stability
Browse files
app.py
CHANGED
|
@@ -1,32 +1,12 @@
|
|
| 1 |
-
import sys
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
# --- ANULACIÓN DE NIVEL SISTEMA (API SILENCER) ---
|
| 5 |
-
# 1. Parche para audioop (Python 3.13)
|
| 6 |
-
try:
|
| 7 |
-
import audioop
|
| 8 |
-
except ImportError:
|
| 9 |
-
try:
|
| 10 |
-
import audioop_lts as audioop
|
| 11 |
-
sys.modules["audioop"] = audioop
|
| 12 |
-
except ImportError:
|
| 13 |
-
pass
|
| 14 |
-
|
| 15 |
-
# 2. ELIMINACIÓN DE LA GENERACIÓN DE API (Corta el error de raíz)
|
| 16 |
-
import gradio as gr
|
| 17 |
-
def fake_get_api_info(self):
|
| 18 |
-
return {"components": {}, "endpoints": {}}
|
| 19 |
-
gr.Blocks.get_api_info = fake_get_api_info
|
| 20 |
-
print("API Documentation generator disabled to prevent schema crashes.")
|
| 21 |
-
# -------------------------------------------------
|
| 22 |
-
|
| 23 |
import spaces
|
|
|
|
| 24 |
import torch
|
| 25 |
import numpy as np
|
| 26 |
from PIL import Image
|
| 27 |
import tempfile
|
|
|
|
| 28 |
|
| 29 |
-
#
|
| 30 |
BASE_MODEL = "cyberdelia/CyberRealisticPony"
|
| 31 |
LTX_MODEL = "Lightricks/LTX-Video"
|
| 32 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
|
@@ -75,6 +55,7 @@ def generate_video(prompt, init_image, lora_scale):
|
|
| 75 |
export_to_video(output.frames[0], tmp.name, fps=24)
|
| 76 |
return tmp.name
|
| 77 |
|
|
|
|
| 78 |
with gr.Blocks(title="Image Utility v2.1") as demo:
|
| 79 |
gr.HTML("<h1 style='text-align:center;'>🛠 Image Processing Utility v2.1.4</h1>")
|
| 80 |
with gr.Tabs():
|
|
@@ -102,5 +83,4 @@ with gr.Blocks(title="Image Utility v2.1") as demo:
|
|
| 102 |
v_out = gr.Video(label="Sequence Output")
|
| 103 |
v_btn.click(generate_video, [v_p, v_img, v_ls], v_out)
|
| 104 |
|
| 105 |
-
|
| 106 |
-
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import spaces
|
| 2 |
+
import gradio as gr
|
| 3 |
import torch
|
| 4 |
import numpy as np
|
| 5 |
from PIL import Image
|
| 6 |
import tempfile
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
+
# --- CONFIGURACIÓN DE MODELOS ---
|
| 10 |
BASE_MODEL = "cyberdelia/CyberRealisticPony"
|
| 11 |
LTX_MODEL = "Lightricks/LTX-Video"
|
| 12 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
|
|
|
| 55 |
export_to_video(output.frames[0], tmp.name, fps=24)
|
| 56 |
return tmp.name
|
| 57 |
|
| 58 |
+
# INTERFAZ
|
| 59 |
with gr.Blocks(title="Image Utility v2.1") as demo:
|
| 60 |
gr.HTML("<h1 style='text-align:center;'>🛠 Image Processing Utility v2.1.4</h1>")
|
| 61 |
with gr.Tabs():
|
|
|
|
| 83 |
v_out = gr.Video(label="Sequence Output")
|
| 84 |
v_btn.click(generate_video, [v_p, v_img, v_ls], v_out)
|
| 85 |
|
| 86 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|