From 9920367d3c65db363a8fcf1d2acf59f3a7d9f18d Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 29 Jun 2023 20:42:19 -0400 Subject: [PATCH] Fix embeddings not working with --gpu-only --- comfy/sd1_clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/sd1_clip.py b/comfy/sd1_clip.py index 0ee314ad..02a998e5 100644 --- a/comfy/sd1_clip.py +++ b/comfy/sd1_clip.py @@ -95,7 +95,7 @@ class SD1ClipModel(torch.nn.Module, ClipTokenWeightEncoder): out_tokens += [tokens_temp] if len(embedding_weights) > 0: - new_embedding = torch.nn.Embedding(next_new_token, current_embeds.weight.shape[1]) + new_embedding = torch.nn.Embedding(next_new_token, current_embeds.weight.shape[1], device=self.device) new_embedding.weight[:token_dict_size] = current_embeds.weight[:] n = token_dict_size for x in embedding_weights: