repair --medvram for SD2.x too after SDXL update

This commit is contained in:
AUTOMATIC1111
2023-07-24 11:57:59 +03:00
parent 1f26815dd3
commit 2c11e9009e
2 changed files with 5 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ class FrozenOpenCLIPEmbedderWithCustomWords(sd_hijack_clip.FrozenCLIPEmbedderWit
def encode_embedding_init_text(self, init_text, nvpt):
ids = tokenizer.encode(init_text)
ids = torch.asarray([ids], device=devices.device, dtype=torch.int)
embedded = self.wrapped.model.token_embedding.wrapped(ids.to(self.wrapped.model.token_embedding.wrapped.weight.device)).squeeze(0)
embedded = self.wrapped.model.token_embedding.wrapped(ids).squeeze(0)
return embedded