From 11e3221f1fd05d49b261ccec7dd99b704a86a89f Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sat, 17 Feb 2024 15:27:31 -0500 Subject: [PATCH] fp8 weight support for Stable Cascade. --- comfy/ldm/cascade/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/ldm/cascade/common.py b/comfy/ldm/cascade/common.py index c2ef3ec4..124902c0 100644 --- a/comfy/ldm/cascade/common.py +++ b/comfy/ldm/cascade/common.py @@ -84,7 +84,7 @@ class GlobalResponseNorm(nn.Module): def forward(self, x): Gx = torch.norm(x, p=2, dim=(1, 2), keepdim=True) Nx = Gx / (Gx.mean(dim=-1, keepdim=True) + 1e-6) - return self.gamma.to(x.device) * (x * Nx) + self.beta.to(x.device) + x + return self.gamma.to(device=x.device, dtype=x.dtype) * (x * Nx) + self.beta.to(device=x.device, dtype=x.dtype) + x class ResBlock(nn.Module):