Spaces:
Running on Zero
Running on Zero
Hide UI controls the native distilled backend can't honor
Browse files
app.py
CHANGED
|
@@ -221,7 +221,7 @@ def _duration(*args, **kwargs):
|
|
| 221 |
|
| 222 |
@spaces.GPU(duration=_duration)
|
| 223 |
@torch.inference_mode()
|
| 224 |
-
def deblur(video, prompt, preset, num_frames,
|
| 225 |
if video is None:
|
| 226 |
raise gr.Error("Please upload a video.")
|
| 227 |
if not prompt.strip():
|
|
@@ -269,30 +269,22 @@ with gr.Blocks(title="LTX-2.3 Deblur") as demo:
|
|
| 269 |
with gr.Accordion("Settings", open=False):
|
| 270 |
preset = gr.Dropdown(list(RES_PRESETS), value="960×544 (recommended)", label="Resolution")
|
| 271 |
num_frames = gr.Dropdown(FRAME_CHOICES, value=121, label="Frames (24fps)")
|
| 272 |
-
lora_scale = gr.Slider(0.5, 1.0, value=1.0, step=0.05,
|
| 273 |
-
label="LoRA strength (lower if over-sharpened / haloing)")
|
| 274 |
randomize = gr.Checkbox(True, label="Randomize seed")
|
| 275 |
seed = gr.Slider(0, MAX_SEED, value=42, step=1, label="Seed")
|
| 276 |
run = gr.Button("Deblur", variant="primary")
|
| 277 |
with gr.Column():
|
| 278 |
video_out = gr.Video(label="Sharpened result")
|
| 279 |
|
| 280 |
-
run.click(deblur, inputs=[video_in, prompt, preset, num_frames,
|
| 281 |
outputs=[video_out, seed])
|
| 282 |
|
| 283 |
gr.Examples(
|
| 284 |
examples=[
|
| 285 |
-
[
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
["examples/slicing_veggie_blur.mp4",
|
| 289 |
-
"a razor-sharp close-up of hands slicing a fresh green zucchini into thin even rounds on a pale wooden cutting board — the glossy green skin, the pale seeded interior, beads of water on the blade and the fine grain of the wood all crisply resolved, a stainless-steel knife edge glinting under warm kitchen light; crisp rhythmic chopping against the board and a gentle kitchen ambience",
|
| 290 |
-
"960×544 (recommended)", 121, 1.0, 42, False],
|
| 291 |
-
["examples/landscape_blur.mp4",
|
| 292 |
-
"a pin-sharp misty green mountain landscape mirrored in calm still water — individual pines on the slopes, drifting layers of fog and crisp rippling reflections all resolving into clean detail under soft cool morning light; a gentle wind moving over the water, distant birdsong and the faint lap of ripples",
|
| 293 |
-
"960×544 (recommended)", 121, 1.0, 42, False],
|
| 294 |
],
|
| 295 |
-
inputs=[video_in, prompt, preset, num_frames,
|
| 296 |
outputs=[video_out, seed], fn=deblur, cache_examples=True, cache_mode="lazy",
|
| 297 |
)
|
| 298 |
|
|
|
|
| 221 |
|
| 222 |
@spaces.GPU(duration=_duration)
|
| 223 |
@torch.inference_mode()
|
| 224 |
+
def deblur(video, prompt, preset, num_frames, seed, randomize, progress=gr.Progress(track_tqdm=True)):
|
| 225 |
if video is None:
|
| 226 |
raise gr.Error("Please upload a video.")
|
| 227 |
if not prompt.strip():
|
|
|
|
| 269 |
with gr.Accordion("Settings", open=False):
|
| 270 |
preset = gr.Dropdown(list(RES_PRESETS), value="960×544 (recommended)", label="Resolution")
|
| 271 |
num_frames = gr.Dropdown(FRAME_CHOICES, value=121, label="Frames (24fps)")
|
|
|
|
|
|
|
| 272 |
randomize = gr.Checkbox(True, label="Randomize seed")
|
| 273 |
seed = gr.Slider(0, MAX_SEED, value=42, step=1, label="Seed")
|
| 274 |
run = gr.Button("Deblur", variant="primary")
|
| 275 |
with gr.Column():
|
| 276 |
video_out = gr.Video(label="Sharpened result")
|
| 277 |
|
| 278 |
+
run.click(deblur, inputs=[video_in, prompt, preset, num_frames, seed, randomize],
|
| 279 |
outputs=[video_out, seed])
|
| 280 |
|
| 281 |
gr.Examples(
|
| 282 |
examples=[
|
| 283 |
+
['examples/man_laughing_blur.mp4', 'a pin-sharp close-up portrait of a middle-aged man laughing warmly, deep smile lines crinkling around his eyes, individual strands of hair and fine stubble crisply resolved, soft natural window light modeling the texture of his skin with bright catchlights in his eyes; hearty, genuine laughter rising and falling, with a quiet intimate room ambience', '960×544 (recommended)', 121, 42, False],
|
| 284 |
+
['examples/slicing_veggie_blur.mp4', 'a razor-sharp close-up of hands slicing a fresh green zucchini into thin even rounds on a pale wooden cutting board — the glossy green skin, the pale seeded interior, beads of water on the blade and the fine grain of the wood all crisply resolved, a stainless-steel knife edge glinting under warm kitchen light; crisp rhythmic chopping against the board and a gentle kitchen ambience', '960×544 (recommended)', 121, 42, False],
|
| 285 |
+
['examples/landscape_blur.mp4', 'a pin-sharp misty green mountain landscape mirrored in calm still water — individual pines on the slopes, drifting layers of fog and crisp rippling reflections all resolving into clean detail under soft cool morning light; a gentle wind moving over the water, distant birdsong and the faint lap of ripples', '960×544 (recommended)', 121, 42, False],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
],
|
| 287 |
+
inputs=[video_in, prompt, preset, num_frames, seed, randomize],
|
| 288 |
outputs=[video_out, seed], fn=deblur, cache_examples=True, cache_mode="lazy",
|
| 289 |
)
|
| 290 |
|