From 256ce4753de01c4936e32b60d1a090c4197da504 Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Tue, 24 Oct 2023 18:54:32 +0000 Subject: [PATCH] [Community] Make lcm backward comp --- examples/community/latent_consistency_txt2img.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/community/latent_consistency_txt2img.py b/examples/community/latent_consistency_txt2img.py index 5d3e933662d1..e54c34e9d3df 100755 --- a/examples/community/latent_consistency_txt2img.py +++ b/examples/community/latent_consistency_txt2img.py @@ -35,27 +35,20 @@ class LatentConsistencyModelPipeline(DiffusionPipeline): - _optional_components = ["scheduler"] - def __init__( self, vae: AutoencoderKL, text_encoder: CLIPTextModel, tokenizer: CLIPTokenizer, unet: UNet2DConditionModel, - scheduler: "LCMScheduler", safety_checker: StableDiffusionSafetyChecker, feature_extractor: CLIPImageProcessor, requires_safety_checker: bool = True, ): super().__init__() - scheduler = ( - scheduler - if scheduler is not None - else LCMScheduler( - beta_start=0.00085, beta_end=0.0120, beta_schedule="scaled_linear", prediction_type="epsilon" - ) + scheduler = LCMScheduler( + beta_start=0.00085, beta_end=0.0120, beta_schedule="scaled_linear", prediction_type="epsilon" ) self.register_modules(