-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcrypto_node_old.py
More file actions
71 lines (61 loc) · 2.13 KB
/
crypto_node_old.py
File metadata and controls
71 lines (61 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import torch
from nodes import SaveImage
import folder_paths
class ExcuteCryptoNode:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"crypto_file_path": (
"STRING",
{"default": folder_paths.output_directory},
)
},
"optional": {"input_anything": ("*",)},
"hidden": {
"unique_id": "UNIQUE_ID",
"prompt": "PROMPT",
"extra_pnginfo": "EXTRA_PNGINFO",
},
}
RETURN_TYPES = ("IMAGE",)
FUNCTION = "excute"
CATEGORY = "__hidden__"
def excute(self, **kwargs):
batch_size = 1
height = 1024
width = 1024
color = 16711680
r = torch.full([batch_size, height, width, 1], (color >> 16 & 255) / 255)
g = torch.full([batch_size, height, width, 1], (color >> 8 & 255) / 255)
b = torch.full([batch_size, height, width, 1], (color & 255) / 255)
return (torch.cat((r, g, b), dim=-1),)
class CryptoCatImage(SaveImage):
def __init__(self):
super().__init__()
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"images": ("IMAGE", {"tooltip": "The images to save."}),
"filename_prefix": (
"STRING",
{
"default": "ComfyUI",
"tooltip": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.",
},
),
},
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
}
RETURN_TYPES = ()
FUNCTION = "save_images"
OUTPUT_NODE = True
CATEGORY = "__hidden__"
DESCRIPTION = "Saves the input images to your ComfyUI output directory."
def save_images(
self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None
):
return super().save_images(images, filename_prefix, None, None)