From 4e89b2c25a2ee7346b4892120176fadb0e7f931a Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 28 Aug 2023 16:26:11 -0400 Subject: [PATCH] Put clip vision outputs on the CPU. --- comfy/clip_vision.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/comfy/clip_vision.py b/comfy/clip_vision.py index 8635e577..daaa2f2b 100644 --- a/comfy/clip_vision.py +++ b/comfy/clip_vision.py @@ -50,6 +50,11 @@ class ClipVisionModel(): with precision_scope(comfy.model_management.get_autocast_device(self.load_device), torch.float32): outputs = self.model(pixel_values=pixel_values) + + for k in outputs: + t = outputs[k] + if t is not None: + outputs[k] = t.cpu() return outputs def convert_to_transformers(sd, prefix):