multimodalart HF Staff commited on
Commit
38c1a39
·
verified ·
1 Parent(s): 7a2774f

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -50,6 +50,13 @@ snapshot_download(
50
  snapshot_download(repo_id=SDV2_REPO, local_dir=CKPT_DIR,
51
  allow_patterns=["wan_causal_dmd_v2v/*"])
52
 
 
 
 
 
 
 
 
53
  device = torch.device("cuda")
54
 
55
  # StreamDiffusionV2 single-GPU streaming pipeline (rolling KV + sink tokens are
@@ -60,10 +67,10 @@ stream = StreamDiffusionV2Pipeline(
60
  device=device,
61
  height=HEIGHT,
62
  width=WIDTH,
63
- step=2,
64
  noise_scale=NOISE_SCALE,
65
  model_type="T2V-1.3B",
66
- use_taehv=False,
67
  )
68
  PM = stream.pipeline_manager
69
  CHUNK = PM.base_chunk_size * PM.pipeline.num_frame_per_block # 4 px frames / chunk
 
50
  snapshot_download(repo_id=SDV2_REPO, local_dir=CKPT_DIR,
51
  allow_patterns=["wan_causal_dmd_v2v/*"])
52
 
53
+ # Pre-fetch the TAEHV tiny-VAE decoder weights (fast streaming decode).
54
+ _TAEHV_PATH = os.path.join(CKPT_DIR, "taew2_1.pth")
55
+ if not os.path.exists(_TAEHV_PATH):
56
+ import urllib.request
57
+ urllib.request.urlretrieve(
58
+ "https://github.com/madebyollin/taehv/raw/main/taew2_1.pth", _TAEHV_PATH)
59
+
60
  device = torch.device("cuda")
61
 
62
  # StreamDiffusionV2 single-GPU streaming pipeline (rolling KV + sink tokens are
 
67
  device=device,
68
  height=HEIGHT,
69
  width=WIDTH,
70
+ step=1, # fewer denoising stages -> shallower pipeline -> lower lag
71
  noise_scale=NOISE_SCALE,
72
  model_type="T2V-1.3B",
73
+ use_taehv=True, # tiny-VAE decode -> much faster per-chunk -> lower lag
74
  )
75
  PM = stream.pipeline_manager
76
  CHUNK = PM.base_chunk_size * PM.pipeline.num_frame_per_block # 4 px frames / chunk