mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-12 18:22:53 +08:00
Handle case where start_step is greater than last_step
This commit is contained in:
parent
b715186140
commit
8dd41ef82e
@ -83,7 +83,14 @@ def time_to_move_sample(model, noise, steps, cfg, sampler_name, scheduler, posit
|
|||||||
if start_step == None:
|
if start_step == None:
|
||||||
start_step = 0
|
start_step = 0
|
||||||
|
|
||||||
for i in range (min(last_step, steps) - start_step):
|
total_iterations = min(last_step, steps) - start_step
|
||||||
|
if total_iterations <= 0:
|
||||||
|
return latent_image.to(
|
||||||
|
device=comfy.model_management.intermediate_device(),
|
||||||
|
dtype=comfy.model_management.intermediate_dtype(),
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in range(total_iterations):
|
||||||
if i > 0:
|
if i > 0:
|
||||||
#don't add new noise to samples after first step taken
|
#don't add new noise to samples after first step taken
|
||||||
noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user