Commit 716a6923 authored by space-nuko's avatar space-nuko
Browse files

support SD2.X models

parent fb274229
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -80,10 +80,13 @@ class UniPCSampler(object):

        ns = NoiseScheduleVP('discrete', alphas_cumprod=self.alphas_cumprod)

        # SD 1.X is "noise", SD 2.X is "v"
        model_type = "v" if self.model.parameterization == "v" else "noise"

        model_fn = model_wrapper(
            lambda x, t, c: self.model.apply_model(x, t, c),
            ns,
            model_type="noise",
            model_type=model_type,
            guidance_type="classifier-free",
            #condition=conditioning,
            #unconditional_condition=unconditional_conditioning,