Commit 2ea87265 authored by Kohaku-Blueleaf's avatar Kohaku-Blueleaf
Browse files

custom schedule

parent 5dbd0355
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -54,8 +54,8 @@ def samples_to_images_tensor(sample, approximation=None, model=None):
    elif approximation == 4:
    elif approximation == 4:
        with devices.autocast(), torch.no_grad():
        with devices.autocast(), torch.no_grad():
            x_sample = sd_vae_consistency.decoder_model()(
            x_sample = sd_vae_consistency.decoder_model()(
                sample.to(devices.device, devices.dtype)/0.18215,
                sample.detach().to(devices.device, devices.dtype)/0.18215,
                schedule=[1.0],
                schedule=[float(i.strip()) for i in shared.opts.sd_vae_consistency_schedule.split(',')],
            )
            )
        sd_vae_consistency.unload()
        sd_vae_consistency.unload()
    else:
    else:
+1 −0
Original line number Original line Diff line number Diff line
@@ -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"),
    "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_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_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"), {
options_templates.update(options_section(('img2img', "img2img"), {