JonathanColetti commited on
Commit
f310128
·
verified ·
1 Parent(s): c6ab681

strip the page down to the demo and two lines

Browse files
Files changed (1) hide show
  1. app.py +5 -55
app.py CHANGED
@@ -344,69 +344,22 @@ def run(world: str, steer_to: str, steer_text: str, steer_at: float,
344
  # ----------------------------------------------------------------------- ui
345
 
346
  CSS = """
347
- #col-container { max-width: 1180px; margin: 0 auto; }
348
  .dark .gradio-container { color: var(--body-text-color); }
349
- #hw-note {
350
- border: 1px solid var(--border-color-primary);
351
- border-left: 4px solid var(--color-accent);
352
- border-radius: 6px;
353
- padding: 10px 14px;
354
- margin-bottom: 4px;
355
- font-size: 0.92em;
356
- line-height: 1.5;
357
- }
358
- #hw-note p { margin: 0; }
359
  """
360
 
361
  INTRO = f"""# LiveWan
362
 
363
- **Streaming text-to-video you can steer while it runs.** A 1.3B student distilled
364
- from Wan2.1-T2V-14B that generates video continuously instead of as a fixed clip:
365
- 750 ms of 640x368 at a time, extended block by block. Checkpoint step
366
- {INFO['step']}.
367
 
368
- Open on a world, then optionally swap the prompt partway through. The swap keeps the
369
- K/V cache, so the scene *continues* rather than cutting.
370
-
371
- [Code]({GITHUB}) · [Weights](https://huggingface.co/{LIVEWAN_REPO})
372
- """
373
-
374
- HW_NOTE = """
375
- **This Space is on shared ZeroGPU hardware, which is not what the project's numbers
376
- were measured on.** It streams at roughly **0.7x real time** here; on a dedicated GPU
377
- the same checkpoint sustains about **2.7x**. The clip you get back is correct, it
378
- just takes longer to produce. Generation is not the bottleneck (about 470 ms per
379
- block) — decoding is, at about 640 ms against 343 ms, because `torch.compile` cannot
380
- run inside a ZeroGPU worker and the VAE decoder is what normally gets compiled.
381
- """
382
-
383
- NOTES = """
384
- **How far you steer matters.** Swapping to a nearby scene (waterfall to mountain
385
- stream) continues cleanly, because the K/V cache the stream is conditioned on still
386
- describes something close to the new prompt. Swapping somewhere very different
387
- (waterfall to an aurora at night) visibly falls apart over the following seconds.
388
- Both are worth trying.
389
-
390
- **Bank prompts against free text.** The 96-prompt bank is the conditioning every
391
- published number in the repo refers to. Free text is encoded here by umt5-xxl and is
392
- not numerically comparable to it, because umt5 embeddings differ slightly by
393
- hardware, so the same string on the training box is a slightly different tensor. It
394
- looks fine, it just is not the same conditioning.
395
-
396
- **Steering is scheduled, not clicked.** A GPU worker is forked per request and cannot
397
- be reached from outside while it runs, so the swap is given up front. The swap itself
398
- is the live one: it replaces the cross-attention conditioning and leaves the cache
399
- alone.
400
-
401
- **Limits.** One stream at a time, since the engine holds a single K/V cache, so
402
- requests queue. A stream cannot pass 1024 latent frames (about 4.3 minutes), which is
403
- where `WanModel`'s RoPE tables end; it stops itself and says so.
404
  """
405
 
406
  with gr.Blocks(title="LiveWan") as demo:
407
  with gr.Column(elem_id="col-container"):
408
  gr.Markdown(INTRO)
409
- gr.Markdown(HW_NOTE, elem_id="hw-note")
410
 
411
  with gr.Row(equal_height=False):
412
  with gr.Column(scale=2):
@@ -432,9 +385,6 @@ with gr.Blocks(title="LiveWan") as demo:
432
  height=200)
433
  stats = gr.Markdown()
434
 
435
- with gr.Accordion("How to read this", open=False):
436
- gr.Markdown(NOTES)
437
-
438
  run_btn.click(run, inputs=[world, steer_to, steer_text, steer_at, seconds, seed],
439
  outputs=[preview, stats, video], concurrency_limit=1)
440
 
 
344
  # ----------------------------------------------------------------------- ui
345
 
346
  CSS = """
347
+ #col-container { max-width: 1150px; margin: 0 auto; }
348
  .dark .gradio-container { color: var(--body-text-color); }
 
 
 
 
 
 
 
 
 
 
349
  """
350
 
351
  INTRO = f"""# LiveWan
352
 
353
+ Streaming text-to-video you can steer while it runs. Swap the prompt partway through
354
+ and the scene continues instead of cutting.
 
 
355
 
356
+ Running on shared ZeroGPU hardware, so about 0.7x real time here; a dedicated GPU
357
+ does about 2.7x. [Code]({GITHUB}) · [Weights](https://huggingface.co/{LIVEWAN_REPO})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  """
359
 
360
  with gr.Blocks(title="LiveWan") as demo:
361
  with gr.Column(elem_id="col-container"):
362
  gr.Markdown(INTRO)
 
363
 
364
  with gr.Row(equal_height=False):
365
  with gr.Column(scale=2):
 
385
  height=200)
386
  stats = gr.Markdown()
387
 
 
 
 
388
  run_btn.click(run, inputs=[world, steer_to, steer_text, steer_at, seconds, seed],
389
  outputs=[preview, stats, video], concurrency_limit=1)
390