mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-25 22:00:19 +08:00
Change tokens to tensor of type long
This commit is contained in:
parent
63636c3355
commit
d7f7d81b8a
@ -3,7 +3,7 @@ from .ldm.modules.diffusionmodules.util import make_beta_schedule
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
class EPS:
|
class EPS:
|
||||||
sigma_data: float = None
|
sigma_data: float
|
||||||
|
|
||||||
def calculate_input(self, sigma, noise):
|
def calculate_input(self, sigma, noise):
|
||||||
sigma = sigma.view(sigma.shape[:1] + (1,) * (noise.ndim - 1))
|
sigma = sigma.view(sigma.shape[:1] + (1,) * (noise.ndim - 1))
|
||||||
|
|||||||
@ -171,7 +171,7 @@ class SDClipModel(torch.nn.Module, ClipTokenWeightEncoder):
|
|||||||
backup_embeds = self.transformer.get_input_embeddings()
|
backup_embeds = self.transformer.get_input_embeddings()
|
||||||
device = backup_embeds.weight.device
|
device = backup_embeds.weight.device
|
||||||
tokens = self.set_up_textual_embeddings(tokens, backup_embeds)
|
tokens = self.set_up_textual_embeddings(tokens, backup_embeds)
|
||||||
tokens = torch.LongTensor(tokens).to(device)
|
tokens = torch.Tensor(tokens, dtype=torch.long).to(device)
|
||||||
|
|
||||||
attention_mask = None
|
attention_mask = None
|
||||||
if self.enable_attention_masks:
|
if self.enable_attention_masks:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user