1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Add a --gpu-only argument to keep and run everything on the GPU.

Make the CLIP model work on the GPU.
This commit is contained in:
comfyanonymous
2023-06-15 15:21:37 -04:00
parent 7bf89ba923
commit f7edcfd927
4 changed files with 14 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ class ClipTokenWeightEncoder:
output += [z]
if (len(output) == 0):
return self.encode(self.empty_tokens)
return torch.cat(output, dim=-2)
return torch.cat(output, dim=-2).cpu()
class SD1ClipModel(torch.nn.Module, ClipTokenWeightEncoder):
"""Uses the CLIP transformer encoder for text (from huggingface)"""