Spaces:
Runtime error
Runtime error
Fix: Force huggingface_hub==0.24.2 for HfFolder compatibility
Browse files
app.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
import sys
|
| 2 |
import os
|
| 3 |
|
| 4 |
-
# --- PARCHE
|
| 5 |
-
# 1. Parche de audioop para Python 3.13
|
| 6 |
try:
|
| 7 |
import audioop
|
| 8 |
except ImportError:
|
|
@@ -11,16 +10,7 @@ except ImportError:
|
|
| 11 |
sys.modules["audioop"] = audioop
|
| 12 |
except ImportError:
|
| 13 |
pass
|
| 14 |
-
|
| 15 |
-
# 2. Parche para el bug de Gradio (TypeError: argument of type 'bool' is not iterable)
|
| 16 |
-
import gradio_client.utils as client_utils
|
| 17 |
-
original_get_type = client_utils.get_type
|
| 18 |
-
def patched_get_type(schema):
|
| 19 |
-
if isinstance(schema, bool):
|
| 20 |
-
return "str" # Evita el colapso si schema es un booleano
|
| 21 |
-
return original_get_type(schema)
|
| 22 |
-
client_utils.get_type = patched_get_type
|
| 23 |
-
# ------------------------------------------
|
| 24 |
|
| 25 |
import spaces
|
| 26 |
import gradio as gr
|
|
@@ -35,9 +25,6 @@ LTX_MODEL = "Lightricks/LTX-Video"
|
|
| 35 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
| 36 |
NEG_DEFAULT = "blurry, low quality, bad anatomy, deformed, ugly, watermark, text"
|
| 37 |
|
| 38 |
-
pipe_t2i = None
|
| 39 |
-
pipe_video = None
|
| 40 |
-
|
| 41 |
def load_t2i(lora_id=None, lora_scale=1.0):
|
| 42 |
from diffusers import StableDiffusionXLPipeline
|
| 43 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
@@ -81,7 +68,6 @@ def generate_video(prompt, init_image, lora_scale):
|
|
| 81 |
export_to_video(output.frames[0], tmp.name, fps=24)
|
| 82 |
return tmp.name
|
| 83 |
|
| 84 |
-
# UI
|
| 85 |
with gr.Blocks(title="Image Utility v2.1") as demo:
|
| 86 |
gr.HTML("<h1 style='text-align:center;'>🛠 Image Processing Utility v2.1.4</h1>")
|
| 87 |
with gr.Tabs():
|
|
|
|
| 1 |
import sys
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
# --- PARCHE DE AUDIO (INDISPENSABLE PARA PYTHON 3.13) ---
|
|
|
|
| 5 |
try:
|
| 6 |
import audioop
|
| 7 |
except ImportError:
|
|
|
|
| 10 |
sys.modules["audioop"] = audioop
|
| 11 |
except ImportError:
|
| 12 |
pass
|
| 13 |
+
# --------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
import spaces
|
| 16 |
import gradio as gr
|
|
|
|
| 25 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
| 26 |
NEG_DEFAULT = "blurry, low quality, bad anatomy, deformed, ugly, watermark, text"
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
def load_t2i(lora_id=None, lora_scale=1.0):
|
| 29 |
from diffusers import StableDiffusionXLPipeline
|
| 30 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
|
|
| 68 |
export_to_video(output.frames[0], tmp.name, fps=24)
|
| 69 |
return tmp.name
|
| 70 |
|
|
|
|
| 71 |
with gr.Blocks(title="Image Utility v2.1") as demo:
|
| 72 |
gr.HTML("<h1 style='text-align:center;'>🛠 Image Processing Utility v2.1.4</h1>")
|
| 73 |
with gr.Tabs():
|