multimodalart HF Staff commited on
Commit
bb6cd86
·
verified ·
1 Parent(s): 6febba8

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -57,12 +57,19 @@ REGION_FILE = "region_head_v3/region_head_tt.safetensors"
57
  CONDITIONER_SPACE = os.environ.get("H3_CONDITIONER", "multimodalart/qwen3vl-conditioner")
58
 
59
  # The quality preset from the port's README, pinned as defaults. 1344x768 is the canvas the
60
- # maps and the head were fitted/validated on. Clip length must sit on the FRAME_PER_TOKEN
61
- # grid (17n+5 pixel frames -> latent_t 5n+2) AND clear the conditioner's 2 s floor: 22 frames
62
- # is 0.92 s and would be rejected by /encode, so the shortest clip that works is 56 frames
63
- # (2.33 s at 24 fps -> latent_t 17).
 
64
  CANVAS_W, CANVAS_H = 1344, 768
65
- NUM_FRAMES = 56
 
 
 
 
 
 
66
  FPS = 24
67
  DEFAULT_STEPS, DEFAULT_SWITCH, DEFAULT_HR_STEPS = 20, 16, 6
68
  DEFAULT_FEATHER, DEFAULT_ALPHA = 4.0, 0.5
@@ -155,7 +162,7 @@ def encode_remote(prompt, ip_token=None):
155
  image_path=None,
156
  last_image_path=None,
157
  canvas=f"{CANVAS_W}x{CANVAS_H} · 16:9 full",
158
- num_frames=NUM_FRAMES,
159
  rewrite_prompt=False,
160
  api_name="/encode",
161
  )
 
57
  CONDITIONER_SPACE = os.environ.get("H3_CONDITIONER", "multimodalart/qwen3vl-conditioner")
58
 
59
  # The quality preset from the port's README, pinned as defaults. 1344x768 is the canvas the
60
+ # maps and the head were fitted/validated on. 22 pixel frames (latent_t 7, 0.92 s at 24 fps)
61
+ # is the render length the port itself measures and ships: peak 26.8 GB with every block
62
+ # resident. Longer clips blow up the HR dual-resolution attention — the author's own note
63
+ # says 73 pixel frames OOM'd a 32 GB 5090 without streaming, and 56 frames OOM'd this
64
+ # Space's 48 GB worker on the first live run.
65
  CANVAS_W, CANVAS_H = 1344, 768
66
+ NUM_FRAMES = 22
67
+ # The conditioner enforces a 2 s floor on num_frames, but its prompt_embeds are text-only
68
+ # states that do NOT depend on clip length (its _encode never sees num_frames — the value
69
+ # only gates validation and the optional prompt rewrite). So the /encode request passes 56
70
+ # (2.33 s, the shortest grid value over the floor) purely to clear that check, and the
71
+ # sampler renders the 22-frame reference clip from those same states.
72
+ CONDITIONER_FRAMES = 56
73
  FPS = 24
74
  DEFAULT_STEPS, DEFAULT_SWITCH, DEFAULT_HR_STEPS = 20, 16, 6
75
  DEFAULT_FEATHER, DEFAULT_ALPHA = 4.0, 0.5
 
162
  image_path=None,
163
  last_image_path=None,
164
  canvas=f"{CANVAS_W}x{CANVAS_H} · 16:9 full",
165
+ num_frames=CONDITIONER_FRAMES,
166
  rewrite_prompt=False,
167
  api_name="/encode",
168
  )