diff --git a/src/refiners/foundationals/latent_diffusion/stable_diffusion_1/model.py b/src/refiners/foundationals/latent_diffusion/stable_diffusion_1/model.py index 1604f64..402e0cd 100644 --- a/src/refiners/foundationals/latent_diffusion/stable_diffusion_1/model.py +++ b/src/refiners/foundationals/latent_diffusion/stable_diffusion_1/model.py @@ -60,8 +60,7 @@ class StableDiffusion_1(LatentDiffusionModel): if sag := self._find_sag_adapter(): sag.scale = scale else: - sag = SD1SAGAdapter(target=self.unet, scale=scale) - sag.inject() + SD1SAGAdapter(target=self.unet, scale=scale).inject() else: if sag := self._find_sag_adapter(): sag.eject() diff --git a/src/refiners/foundationals/latent_diffusion/stable_diffusion_xl/model.py b/src/refiners/foundationals/latent_diffusion/stable_diffusion_xl/model.py index 819ff8a..b8b52e6 100644 --- a/src/refiners/foundationals/latent_diffusion/stable_diffusion_xl/model.py +++ b/src/refiners/foundationals/latent_diffusion/stable_diffusion_xl/model.py @@ -101,8 +101,7 @@ class StableDiffusion_XL(LatentDiffusionModel): if sag := self._find_sag_adapter(): sag.scale = scale else: - sag = SDXLSAGAdapter(target=self.unet, scale=scale) - sag.inject() + SDXLSAGAdapter(target=self.unet, scale=scale).inject() else: if sag := self._find_sag_adapter(): sag.eject()