This commit is contained in:
layerdiffusion
2024-08-14 17:25:32 -07:00
parent b09c24ef51
commit 1a26e73deb

View File

@@ -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