From c3e96e637dde2ab897c2799ee48f69b21fa7b1a4 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 3 Jul 2023 16:09:02 -0400 Subject: [PATCH] Pass device to CLIP model. --- comfy/sd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/sd.py b/comfy/sd.py index fc3551fe..5001d497 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -526,12 +526,13 @@ class CLIP: def __init__(self, target=None, embedding_directory=None, no_init=False): if no_init: return - params = target.params + params = target.params.copy() clip = target.clip tokenizer = target.tokenizer load_device = model_management.text_encoder_device() offload_device = model_management.text_encoder_offload_device() + params['device'] = load_device self.cond_stage_model = clip(**(params)) #TODO: make sure this doesn't have a quality loss before enabling. # if model_management.should_use_fp16(load_device):