Sudhanshu Mittal Claude Opus 4.8 commited on
Commit
e018e6e
·
1 Parent(s): 459951f

Bring back the Seed control, leave Eta fixed

Browse files

Seed is exposed again as a top-level input (not behind an Advanced panel): -1
draws a fresh seed each run, an explicit value reproduces a run exactly. Eta
stays internal at 0.0, so sampling is always on the deterministic ODE and the
demo does not surface an ODE/SDE knob.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files changed (1) hide show
  1. app2.py +13 -11
app2.py CHANGED
@@ -253,9 +253,9 @@ the abstract predictor, which is **consistency-distilled** and so is designed to
253
  very few steps — raising it buys little.
254
 
255
  **Randomness.** The {NUM_VIDEOS} rollouts share one context and one seed, but the
256
- solver draws independent initial noise per batch element, so the futures diverge. Each
257
- run draws a fresh seed, so generating again on the same clip gives you a new set of
258
- futures.
259
 
260
  **Note.** The clip must be long enough for the L2 look-back window; very short clips
261
  are rejected with an explicit error. Frame and step counts are kept modest to fit the
@@ -348,7 +348,7 @@ def _stream_rollout(cmd: list[str], say) -> str:
348
 
349
  @spaces.GPU(duration=300)
350
  def run_rollout(video_path: str, num_gen_steps: int, l1_steps: int, l2_steps: int,
351
- progress=gr.Progress()):
352
  if video_path is None:
353
  raise gr.Error("Please upload a short mp4 clip first.")
354
 
@@ -356,12 +356,12 @@ def run_rollout(video_path: str, num_gen_steps: int, l1_steps: int, l2_steps: in
356
  progress(frac, desc=msg)
357
 
358
  try:
359
- # Seed and eta are no longer exposed in the UI. Every run draws a fresh seed,
360
- # so repeated runs on the same clip show different futures; the rollout script
361
- # only seeds when seed > 0. eta stays at the deterministic-ODE default — within
362
- # a batch each sample still draws its own noise, so the NUM_VIDEOS rollouts
363
- # diverge regardless.
364
- seed = random.randrange(1, 2**31 - 1)
365
  eta = DEFAULT_ETA
366
 
367
  job = Path(tempfile.gettempdir()) / f"orbis2_{uuid.uuid4().hex[:8]}"
@@ -447,6 +447,8 @@ def build_demo():
447
  l2_steps = gr.Slider(4, 8, value=DEFAULT_L2_STEPS, step=1,
448
  label="L2 sampler steps",
449
  info="Abstract predictor — distilled, needs very few")
 
 
450
 
451
  btn = gr.Button("Generate rollouts", variant="primary")
452
 
@@ -456,7 +458,7 @@ def build_demo():
456
 
457
  btn.click(
458
  run_rollout,
459
- inputs=[inp, n_steps_gen, l1_steps, l2_steps],
460
  outputs=outs,
461
  concurrency_limit=1,
462
  )
 
253
  very few steps — raising it buys little.
254
 
255
  **Randomness.** The {NUM_VIDEOS} rollouts share one context and one seed, but the
256
+ solver draws independent initial noise per batch element, so the futures diverge.
257
+ Leave *Seed* at -1 for a fresh draw each run, or set it explicitly to reproduce a run
258
+ exactly.
259
 
260
  **Note.** The clip must be long enough for the L2 look-back window; very short clips
261
  are rejected with an explicit error. Frame and step counts are kept modest to fit the
 
348
 
349
  @spaces.GPU(duration=300)
350
  def run_rollout(video_path: str, num_gen_steps: int, l1_steps: int, l2_steps: int,
351
+ seed: int, progress=gr.Progress()):
352
  if video_path is None:
353
  raise gr.Error("Please upload a short mp4 clip first.")
354
 
 
356
  progress(frac, desc=msg)
357
 
358
  try:
359
+ # seed < 0 means "surprise me" draw a fresh positive seed. The rollout script
360
+ # only seeds when seed > 0, hence the clamp. Within a batch each sample still
361
+ # draws its own noise, so one seed yields NUM_VIDEOS distinct rollouts; setting
362
+ # it explicitly lets a run be reproduced exactly.
363
+ seed = random.randrange(1, 2**31 - 1) if int(seed) < 0 else max(1, int(seed))
364
+ # eta is not exposed: 0.0 keeps sampling on the deterministic ODE.
365
  eta = DEFAULT_ETA
366
 
367
  job = Path(tempfile.gettempdir()) / f"orbis2_{uuid.uuid4().hex[:8]}"
 
447
  l2_steps = gr.Slider(4, 8, value=DEFAULT_L2_STEPS, step=1,
448
  label="L2 sampler steps",
449
  info="Abstract predictor — distilled, needs very few")
450
+ seed_in = gr.Number(value=-1, precision=0, label="Seed",
451
+ info="-1 draws a fresh seed each run; set a value to reproduce one")
452
 
453
  btn = gr.Button("Generate rollouts", variant="primary")
454
 
 
458
 
459
  btn.click(
460
  run_rollout,
461
+ inputs=[inp, n_steps_gen, l1_steps, l2_steps, seed_in],
462
  outputs=outs,
463
  concurrency_limit=1,
464
  )