dagloop5 commited on
Commit
08370f7
·
verified ·
1 Parent(s): f17ca0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -669,13 +669,19 @@ def _generate(
669
  requested_steps = steps if custom_schedule else steps + 1
670
 
671
  started = time.time()
 
 
 
 
 
 
672
  with pk.use_schedule(
673
- PIPE, steps, schedule, video_shift, audio_shift, sampler_name=sampler, seed=int(seed),
674
  total_steps=total_steps, stage_from=stage_from,
675
  ):
676
- with use_dpmpp_2s_ancestral(PIPE, int(seed), enabled=(sampler == "dpmpp_2s_ancestral")):
677
- with use_dpmpp_sde_gpu(PIPE, int(seed), enabled=(sampler == "dpmpp_sde_gpu")):
678
- with use_seeds_2(PIPE, int(seed), enabled=(sampler == "seeds_2")):
679
  # Staged Denoising: resuming hands the pipeline the previous stage's own latents instead of
680
  # letting `PrepareLatentsStep` draw fresh noise — both are declared-optional inputs on that
681
  # step precisely for this ("used instead of the draw"), so nothing else about the call
 
669
  requested_steps = steps if custom_schedule else steps + 1
670
 
671
  started = time.time()
672
+ # A fresh generator per stage (see `use_schedule`'s docstring) is fine on its own — each stage's noise is
673
+ # still a mathematically valid draw, just not a continuation of the last stage's stream. What isn't fine:
674
+ # reseeding to the *identical* literal seed every single stage means every stage's first draws are the
675
+ # exact same bits, every time — offsetting by `stage_from` (0 on a fresh/single-stage call, so this changes
676
+ # nothing there) means each stage actually draws a different stream.
677
+ effective_seed = int(seed) + stage_from
678
  with pk.use_schedule(
679
+ PIPE, steps, schedule, video_shift, audio_shift, sampler_name=sampler, seed=effective_seed,
680
  total_steps=total_steps, stage_from=stage_from,
681
  ):
682
+ with use_dpmpp_2s_ancestral(PIPE, effective_seed, enabled=(sampler == "dpmpp_2s_ancestral")):
683
+ with use_dpmpp_sde_gpu(PIPE, effective_seed, enabled=(sampler == "dpmpp_sde_gpu")):
684
+ with use_seeds_2(PIPE, effective_seed, enabled=(sampler == "seeds_2")):
685
  # Staged Denoising: resuming hands the pipeline the previous stage's own latents instead of
686
  # letting `PrepareLatentsStep` draw fresh noise — both are declared-optional inputs on that
687
  # step precisely for this ("used instead of the draw"), so nothing else about the call