Skip to content

Commit

Permalink
Fix uni_pc returning noisy image when steps <= 3
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Oct 25, 2023
1 parent 3783cb8 commit 7fbb217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/extra_samplers/uni_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def sample_unipc(model, noise, image, sigmas, sampling_function, max_denoise, ex
model_kwargs=extra_args,
)

order = min(3, len(timesteps) - 1)
order = min(3, len(timesteps) - 2)
uni_pc = UniPC(model_fn, ns, predict_x0=True, thresholding=False, noise_mask=noise_mask, masked_image=image, noise=noise, variant=variant)
x = uni_pc.sample(img, timesteps=timesteps, skip_type="time_uniform", method="multistep", order=order, lower_order_final=True, callback=callback, disable_pbar=disable)
x /= ns.marginal_alpha(timesteps[-1])
Expand Down

0 comments on commit 7fbb217

Please sign in to comment.