Skip to content

Commit

Permalink
[Community] Make lcm backward comp
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten committed Oct 24, 2023
1 parent 7c3a75a commit 256ce47
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions examples/community/latent_consistency_txt2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 256ce47

Please sign in to comment.