custom schedule

This commit is contained in:
Kohaku-Blueleaf 2023-11-07 12:35:56 +08:00
parent 5dbd0355b0
commit 2ea8726597
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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"), {