implement

This commit is contained in:
hnmr293
2023-03-30 02:09:15 +09:00
parent 9ff9e89c46
commit b6be594939
11 changed files with 1024 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import torch
class RandomLatentImage:
def __init__(self, device="cpu"):
self.device = device
@classmethod
def INPUT_TYPES(s):
return {"required": { "width": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 64}),
"height": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 64}),
"batch_size": ("INT", {"default": 1, "min": 1, "max": 64})}}
RETURN_TYPES = ("LATENT",)
FUNCTION = "generate"
CATEGORY = "latent"
def generate(self, width, height, batch_size=1):
latent = torch.randn(batch_size, 4, height // 8, width // 8)
return ({"samples":latent}, )