Skip to content

Commit d062bec

Browse files
Make EmptyLatentImage follow intermediate dtype. (#12974)
1 parent e84a200 commit d062bec

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

nodes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,9 +1211,6 @@ def append(self, conditioning_to, clip, gligen_textbox_model, text, width, heigh
12111211
return (c, )
12121212

12131213
class EmptyLatentImage:
1214-
def __init__(self):
1215-
self.device = comfy.model_management.intermediate_device()
1216-
12171214
@classmethod
12181215
def INPUT_TYPES(s):
12191216
return {
@@ -1232,7 +1229,7 @@ def INPUT_TYPES(s):
12321229
SEARCH_ALIASES = ["empty", "empty latent", "new latent", "create latent", "blank latent", "blank"]
12331230

12341231
def generate(self, width, height, batch_size=1):
1235-
latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
1232+
latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=comfy.model_management.intermediate_device(), dtype=comfy.model_management.intermediate_dtype())
12361233
return ({"samples": latent, "downscale_ratio_spacial": 8}, )
12371234

12381235

0 commit comments

Comments
 (0)