diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index 2b14595f8..8e793baae 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -54,8 +54,8 @@ def samples_to_images_tensor(sample, approximation=None, model=None): elif approximation == 4: with devices.autocast(), torch.no_grad(): x_sample = sd_vae_consistency.decoder_model()( - sample.to(devices.device, devices.dtype)/0.18215, - schedule=[1.0], + sample.detach().to(devices.device, devices.dtype)/0.18215, + schedule=[float(i.strip()) for i in shared.opts.sd_vae_consistency_schedule.split(',')], ) sd_vae_consistency.unload() else: diff --git a/modules/shared_options.py b/modules/shared_options.py index 002a75454..591d2f9d4 100644 --- a/modules/shared_options.py +++ b/modules/shared_options.py @@ -173,6 +173,7 @@ For img2img, VAE is used to process user's input image before the sampling, and "auto_vae_precision": OptionInfo(True, "Automatically revert VAE to 32-bit floats").info("triggers when a tensor with NaNs is produced in VAE; disabling the option in this case will result in a black square image"), "sd_vae_encode_method": OptionInfo("Full", "VAE type for encode", gr.Radio, {"choices": ["Full", "TAESD"]}, infotext='VAE Encoder').info("method to encode image to latent (use in img2img, hires-fix or inpaint mask)"), "sd_vae_decode_method": OptionInfo("Full", "VAE type for decode", gr.Radio, {"choices": ["Full", "TAESD", "Consistency Decoder"]}, infotext='VAE Decoder').info("method to decode latent to image"), + "sd_vae_consistency_schedule": OptionInfo("1.0, 0.5", "consistency schedule").info("sampling schedule for consistency decoder."), })) options_templates.update(options_section(('img2img', "img2img"), {