Spaces:
Runtime error
Runtime error
Fix: Move dynamic components to static variables
Browse files
app.py
CHANGED
|
@@ -22,7 +22,6 @@ DEFAULT_LORA = "John6666/nsfw-master-flux-lora-merged"
|
|
| 22 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
| 23 |
|
| 24 |
pipe_t2i = None
|
| 25 |
-
pipe_i2i = None
|
| 26 |
pipe_video = None
|
| 27 |
|
| 28 |
NEG_DEFAULT = "blurry, low quality, bad anatomy, deformed, ugly, watermark, text"
|
|
@@ -96,10 +95,10 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="slate", neutral_hue="slate")
|
|
| 96 |
with gr.Row():
|
| 97 |
t2i_w = gr.Slider(512, 1280, 1024, step=64, label="X-Axis")
|
| 98 |
t2i_h = gr.Slider(512, 1280, 1024, step=64, label="Y-Axis")
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
t2i_btn = gr.Button("Execute Process")
|
| 104 |
t2i_out = gr.Image(label="Output Preview")
|
| 105 |
t2i_btn.click(generate_t2i, [t2i_p, t2i_n, t2i_lora, t2i_ls, t2i_steps, t2i_cfg, t2i_w, t2i_h, t2i_seed], t2i_out)
|
|
@@ -110,13 +109,14 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="slate", neutral_hue="slate")
|
|
| 110 |
v_p = gr.Textbox(label="Motion Vector String", lines=3)
|
| 111 |
v_img = gr.Image(label="Source Buffer", type="numpy")
|
| 112 |
v_ls = gr.Slider(0, 1.5, 0.8, label="Motion Weight")
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
|
|
|
| 118 |
v_btn = gr.Button("Process Sequence")
|
| 119 |
v_out = gr.Video(label="Sequence Output")
|
| 120 |
-
v_btn.click(generate_video, [v_p,
|
| 121 |
|
| 122 |
-
demo.launch(
|
|
|
|
| 22 |
LTX_NSFW_LORA = "Lora-Daddy/Ltx2.3-real-nudity-early-alpha-30k-steps"
|
| 23 |
|
| 24 |
pipe_t2i = None
|
|
|
|
| 25 |
pipe_video = None
|
| 26 |
|
| 27 |
NEG_DEFAULT = "blurry, low quality, bad anatomy, deformed, ugly, watermark, text"
|
|
|
|
| 95 |
with gr.Row():
|
| 96 |
t2i_w = gr.Slider(512, 1280, 1024, step=64, label="X-Axis")
|
| 97 |
t2i_h = gr.Slider(512, 1280, 1024, step=64, label="Y-Axis")
|
| 98 |
+
# Componentes ocultos definidos como variables
|
| 99 |
+
t2i_steps = gr.Number(value=30, visible=False)
|
| 100 |
+
t2i_cfg = gr.Number(value=7.0, visible=False)
|
| 101 |
+
t2i_seed = gr.Number(value=42, visible=False)
|
| 102 |
t2i_btn = gr.Button("Execute Process")
|
| 103 |
t2i_out = gr.Image(label="Output Preview")
|
| 104 |
t2i_btn.click(generate_t2i, [t2i_p, t2i_n, t2i_lora, t2i_ls, t2i_steps, t2i_cfg, t2i_w, t2i_h, t2i_seed], t2i_out)
|
|
|
|
| 109 |
v_p = gr.Textbox(label="Motion Vector String", lines=3)
|
| 110 |
v_img = gr.Image(label="Source Buffer", type="numpy")
|
| 111 |
v_ls = gr.Slider(0, 1.5, 0.8, label="Motion Weight")
|
| 112 |
+
# Componentes ocultos definidos como variables para el tab de video
|
| 113 |
+
v_neg = gr.Textbox(value=NEG_DEFAULT, visible=False)
|
| 114 |
+
v_frames = gr.Number(value=49, visible=False)
|
| 115 |
+
v_fps = gr.Number(value=24, visible=False)
|
| 116 |
+
v_steps = gr.Number(value=30, visible=False)
|
| 117 |
+
v_seed = gr.Number(value=42, visible=False)
|
| 118 |
v_btn = gr.Button("Process Sequence")
|
| 119 |
v_out = gr.Video(label="Sequence Output")
|
| 120 |
+
v_btn.click(generate_video, [v_p, v_neg, v_img, v_frames, v_fps, v_steps, v_ls, v_seed], v_out)
|
| 121 |
|
| 122 |
+
demo.launch()
|