(minor) Use SilenceWarnings as a decorator rather than a context manager to save an indentation level.

This commit is contained in:
Ryan Dick 2024-06-06 10:40:19 -04:00
parent 8e47e005a7
commit 79ceac2f82

View File

@ -657,8 +657,8 @@ class DenoiseLatentsInvocation(BaseInvocation):
return 1 - mask, masked_latents, self.denoise_mask.gradient return 1 - mask, masked_latents, self.denoise_mask.gradient
@torch.no_grad() @torch.no_grad()
@SilenceWarnings() # This quenches the NSFW nag from diffusers.
def invoke(self, context: InvocationContext) -> LatentsOutput: def invoke(self, context: InvocationContext) -> LatentsOutput:
with SilenceWarnings(): # this quenches NSFW nag from diffusers
seed = None seed = None
noise = None noise = None
if self.noise is not None: if self.noise is not None: