From 1a26e73deb0054eb83f1f143f9a9f6a9f48b2a37 Mon Sep 17 00:00:00 2001 From: layerdiffusion <19834515+lllyasviel@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:25:32 -0700 Subject: [PATCH] revise --- backend/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/utils.py b/backend/utils.py index 335ffa73..44f9eab0 100644 --- a/backend/utils.py +++ b/backend/utils.py @@ -82,6 +82,6 @@ def fp16_fix(x): # Source: https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1114 # Related: https://github.com/comfyanonymous/ComfyUI/blob/f1d6cef71c70719cc3ed45a2455a4e5ac910cd5e/comfy/ldm/flux/layers.py#L180 - if x.dtype == torch.float16: - return x.clip(-16384.0, 16384.0) + if x.dtype in [torch.float16]: + return x.clip(-32768.0, 32768.0) return x