From edfc4ca6631615a380b6d95d5db8e479ebfd789e Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 19 Mar 2023 10:50:38 -0400 Subject: [PATCH] Try to fix a vram issue with controlnets. --- comfy/sd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy/sd.py b/comfy/sd.py index 0eba58fc..6d1e8bb9 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -595,6 +595,9 @@ def load_controlnet(ckpt_path, model=None): else: control_model.load_state_dict(controlnet_data, strict=False) + if use_fp16: + control_model = control_model.half() + control = ControlNet(control_model) return control