Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- ComfyUI-Crystools/__pycache__/__init__.cpython-310.pycAdded
- ComfyUI-Crystools/nodes/__pycache__/__init__.cpython-310.pycAdded
- ComfyUI-Crystools/nodes/__pycache__/_names.cpython-310.pycAdded
- ComfyUI-Crystools/nodes/__pycache__/switch.cpython-310.pycAdded
- ComfyUI-Crystools/nodes/switch.pyAdded+225
- ComfyUI-Crystools/samples/debugger-any.jsonAdded+102
- ComfyUI-Crystools/samples/debugger-json.jsonAdded+182
- ComfyUI-Crystools/samples/debugger-metadata.jsonAdded+382
- ComfyUI-Crystools/samples/image-load.jsonAdded+59
- ComfyUI-Crystools/samples/image-preview-image.jsonAdded+373
- ComfyUI-Crystools/samples/image-preview-metadata.jsonAdded+104
- ComfyUI-Crystools/samples/image-resolution.jsonAdded+512
- ComfyUI-Crystools/samples/image-save.jsonAdded+422
- ComfyUI-Crystools/samples/list-any.jsonAdded+375
- ComfyUI-Crystools/samples/list-strings.jsonAdded+177
- ComfyUI-Crystools/samples/metadata-comparator.jsonAdded+168
- ComfyUI-Crystools/samples/metadata-extractor.jsonAdded+350
- ComfyUI-Crystools/samples/pipe-1.jsonAdded+564
- ComfyUI-Crystools/samples/pipe-2.jsonAdded+849
- ComfyUI-Crystools/samples/switch.jsonAdded+496
- ComfyUI-Crystools/samples/utils-json-comparator.jsonAdded+212
- ComfyUI-Crystools/samples/utils-stats.jsonAdded+410
- ComfyUI-Crystools/server/__init__.pyAdded+1
- ComfyUI-Crystools/server/__pycache__/__init__.cpython-310.pycAdded
- ComfyUI-Crystools/server/__pycache__/monitor.cpython-310.pycAdded
- ComfyUI-Crystools/server/monitor.pyAdded+125
- ComfyUI-Crystools/web/comfy/index.d.tsAdded+5
- ComfyUI-Crystools/web/comfy/index.jsAdded+2
- ComfyUI-Crystools/web/comfy/index.tsAdded+5
- ComfyUI-Crystools/web/comfy/liteGraph.d.tsAdded+19
- ComfyUI-Crystools/web/comfy/liteGraph.jsAdded+30
- ComfyUI-Crystools/web/comfy/liteGraph.tsAdded+32
- ComfyUI-Crystools/web/comfy/liteGraph.types.d.tsAdded+19
- ComfyUI-Crystools/web/comfy/scripts.d.tsAdded+5
- ComfyUI-Crystools/web/comfy/scripts.jsAdded+5
- ComfyUI-Crystools/web/comfy/scripts.tsAdded+10
- ComfyUI-Crystools/web/comfy/typings/README.mdAdded+5
- ComfyUI-Crystools/web/comfy/typings/comfy.d.tsAdded+227
- ComfyUI-Crystools/web/comfy/typings/index.d.tsAdded+55
- ComfyUI-Crystools/web/comfy/typings/litegraph.d.tsAdded+1750
- ComfyUI-Crystools/web/common.d.tsAdded+4
- ComfyUI-Crystools/web/common.jsAdded+50
- ComfyUI-Crystools/web/common.tsAdded+92
- ComfyUI-Crystools/web/debugger.d.tsAdded+1
- ComfyUI-Crystools/web/debugger.jsAdded+77
- ComfyUI-Crystools/web/debugger.tsAdded+86
- ComfyUI-Crystools/web/extensions.d.tsAdded+1
- ComfyUI-Crystools/web/extensions.jsAdded+32
- ComfyUI-Crystools/web/extensions.tsAdded+38
- ComfyUI-Crystools/web/monitor.cssAdded+188
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225from ..core import BOOLEAN, STRING, CATEGORY, any, logger
class CSwitchFromAny:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"any": (any, ),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = (any, any,)
RETURN_NAMES = ("on_true", "on_false",)
FUNCTION = "execute"
def execute(self, any,boolean=True):
logger.debug("Any switch: " + str(boolean))
if boolean:
return any, None
else:
return None, any
class CSwitchBooleanAny:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": (any, {"lazy": True}),
"on_false": (any, {"lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = (any,)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("Any switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)
class CSwitchBooleanString:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": ("STRING", {"default": "", "lazy": True}),
"on_false": ("STRING", {"default": "", "lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("string",)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("String switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)
class CSwitchBooleanConditioning:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": ("CONDITIONING", {"lazy": True}),
"on_false": ("CONDITIONING", {"lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = ("CONDITIONING",)
RETURN_NAMES = ("conditioning",)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("Conditioning switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)
class CSwitchBooleanImage:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": ("IMAGE", {"lazy": True}),
"on_false": ("IMAGE", {"lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("image",)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("Image switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)
class CSwitchBooleanLatent:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": ("LATENT", {"lazy": True}),
"on_false": ("LATENT", {"lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = ("LATENT",)
RETURN_NAMES = ("latent",)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("Latent switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)
class CSwitchBooleanMask:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"on_true": ("MASK", {"lazy": True}),
"on_false": ("MASK", {"lazy": True}),
"boolean": BOOLEAN,
}
}
CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value
RETURN_TYPES = ("MASK",)
RETURN_NAMES = ("mask",)
FUNCTION = "execute"
def check_lazy_status(self, on_true=None, on_false=None, boolean=True):
needed = "on_true" if boolean else "on_false"
return [needed]
def execute(self, on_true, on_false, boolean=True):
logger.debug("Mask switch: " + str(boolean))
if boolean:
return (on_true,)
else:
return (on_false,)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102{
"last_node_id": 4,
"last_link_id": 4,
"nodes": [
{
"id": 3,
"type": "Show any [Crystools]",
"pos": [
475,
250
],
"size": {
"0": 400,
"1": 750
},
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 3
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
},
"widgets_values": [
false,
true,
""
]
},
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
100,
75
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": [
3
],
"shape": 3,
"slot_index": 2
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
}
],
"links": [
[
3,
1,
2,
3,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182{
"last_node_id": 4,
"last_link_id": 4,
"nodes": [
{
"id": 4,
"type": "Show any to JSON [Crystools]",
"pos": [
900,
175
],
"size": {
"0": 400,
"1": 825
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 4
}
],
"outputs": [
{
"name": "string",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Show any to JSON [Crystools]"
}
},
{
"id": 2,
"type": "Show any to JSON [Crystools]",
"pos": [
1350,
50
],
"size": [
400,
950
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 2
}
],
"outputs": [
{
"name": "string",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Show any to JSON [Crystools]"
}
},
{
"id": 3,
"type": "Show any [Crystools]",
"pos": [
475,
250
],
"size": [
400,
750
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 3
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
100,
75
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": [
2,
3
],
"shape": 3,
"slot_index": 2
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
4
],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
}
],
"links": [
[
2,
1,
2,
2,
0,
"*"
],
[
3,
1,
2,
3,
0,
"*"
],
[
4,
1,
3,
4,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382{
"last_node_id": 13,
"last_link_id": 11,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1209,
188
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1451,
189
],
"size": [
200,
275
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
863,
186
],
"size": [
325,
475
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 10,
"type": "Show Metadata [Crystools]",
"pos": [
1225,
525
],
"size": [
450,
525
],
"flags": {},
"order": 1,
"mode": 0,
"properties": {}
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
26,
474
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"sd-v1-5-pruned-emaonly.safetensors"
]
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
9,
8,
0,
9,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{
"last_node_id": 1,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
150,
200
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373{
"last_node_id": 14,
"last_link_id": 12,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1209,
188
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
12
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
26,
474
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"sd-v1-5-pruned-emaonly.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
863,
186
],
"size": {
"0": 325,
"1": 475
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 14,
"type": "Preview from image [Crystools]",
"pos": [
1525,
175
],
"size": [
400,
800
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 12
}
],
"outputs": [
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Preview from image [Crystools]"
}
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
12,
8,
0,
14,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{
"last_node_id": 2,
"last_link_id": 1,
"nodes": [
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
150,
200
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
1
],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 2,
"type": "Preview from metadata [Crystools]",
"pos": [
575,
200
],
"size": [
425,
675
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "metadata_raw",
"type": "METADATA_RAW",
"link": 1
}
],
"outputs": [
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Preview from metadata [Crystools]"
}
}
],
"links": [
[
1,
1,
3,
2,
0,
"METADATA_RAW"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512{
"last_node_id": 13,
"last_link_id": 11,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
26,
474
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\3d\\disneyPixarCartoon_v10.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
863,
186
],
"size": [
325,
475
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1209,
188
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9,
10
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1475,
250
],
"size": [
200,
275
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 10,
"type": "Get resolution [Crystools]",
"pos": [
1475,
100
],
"size": {
"0": 200,
"1": 100
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 10
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": null,
"shape": 3
},
{
"name": "height",
"type": "INT",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Get resolution [Crystools]"
}
},
{
"id": 12,
"type": "Load image with metadata [Crystools]",
"pos": [
1350,
625
],
"size": [
325,
350
],
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
11
],
"shape": 3,
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 13,
"type": "Get resolution [Crystools]",
"pos": [
1725,
625
],
"size": {
"0": 200,
"1": 100
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 11
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": null,
"shape": 3
},
{
"name": "height",
"type": "INT",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Get resolution [Crystools]"
}
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
10,
8,
0,
10,
0,
"IMAGE"
],
[
11,
12,
0,
13,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422{
"last_node_id": 11,
"last_link_id": 11,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
863,
186
],
"size": [
325,
475
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
26,
474
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\anime\\chilloutmix_NiPrunedFp32Fix.safetensors"
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1209,
188
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
10
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 10,
"type": "Save image with extra metadata [Crystools]",
"pos": [
1450,
200
],
"size": [
425,
550
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 10
}
],
"outputs": [
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
11
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Save image with extra metadata [Crystools]"
},
"widgets_values": [
"ComfyUI",
false,
"{\n \"Title\": \"Image generated by Crystian\",\n \"Description\": \"More info: https:\\/\\/www.instagram.com\\/crystian.ia\",\n \"Author\": \"crystian.ia\",\n \"Software\": \"ComfyUI\",\n \"Category\": \"StableDiffusion\",\n \"Rating\": 5,\n \"UserComment\": \"\",\n \"Keywords\": [\n \"\"\n ],\n \"Copyrights\": \"\"\n}"
]
},
{
"id": 11,
"type": "Show any to JSON [Crystools]",
"pos": [
1925,
200
],
"size": [
425,
300
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 11
}
],
"outputs": [
{
"name": "string",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Show any to JSON [Crystools]"
}
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
10,
8,
0,
10,
0,
"IMAGE"
],
[
11,
10,
0,
11,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375{
"last_node_id": 15,
"last_link_id": 13,
"nodes": [
{
"id": 10,
"type": "Primitive integer [Crystools]",
"pos": [
175,
525
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "int",
"type": "INT",
"links": [
9
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive integer [Crystools]"
},
"widgets_values": [
1
]
},
{
"id": 11,
"type": "Primitive float [Crystools]",
"pos": [
175,
625
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "float",
"type": "FLOAT",
"links": [
10
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive float [Crystools]"
},
"widgets_values": [
1
]
},
{
"id": 9,
"type": "Primitive string multiline [Crystools]",
"pos": [
90,
275
],
"size": {
"0": 400,
"1": 200
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "string",
"type": "STRING",
"links": [
8
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive string multiline [Crystools]"
},
"widgets_values": [
"sample\nmultiline"
]
},
{
"id": 12,
"type": "Primitive string [Crystools]",
"pos": [
240,
175
],
"size": {
"0": 250,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "string",
"type": "STRING",
"links": [
6
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive string [Crystools]"
},
"widgets_values": [
"sample"
]
},
{
"id": 14,
"type": "Load image with metadata [Crystools]",
"pos": [
165,
750
],
"size": [
325,
350
],
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
11
],
"shape": 3,
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 7,
"type": "List of any [Crystools]",
"pos": [
600,
325
],
"size": {
"0": 210,
"1": 166
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "any_1",
"type": "*",
"link": 5
},
{
"name": "any_2",
"type": "*",
"link": 6
},
{
"name": "any_3",
"type": "*",
"link": 8
},
{
"name": "any_4",
"type": "*",
"link": 9
},
{
"name": "any_5",
"type": "*",
"link": 10
},
{
"name": "any_6",
"type": "*",
"link": 11
},
{
"name": "any_7",
"type": "*",
"link": null
},
{
"name": "any_8",
"type": "*",
"link": null
}
],
"outputs": [
{
"name": "any_list",
"type": "COMBO",
"links": [
12
],
"shape": 6,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "List of any [Crystools]"
}
},
{
"id": 15,
"type": "Show any [Crystools]",
"pos": [
850,
325
],
"size": [
575,
625
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 12
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 8,
"type": "Primitive boolean [Crystools]",
"pos": [
175,
75
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "boolean",
"type": "BOOLEAN",
"links": [
5
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive boolean [Crystools]"
},
"widgets_values": [
true
]
}
],
"links": [
[
5,
8,
0,
7,
0,
"*"
],
[
6,
12,
0,
7,
1,
"*"
],
[
8,
9,
0,
7,
2,
"*"
],
[
9,
10,
0,
7,
3,
"*"
],
[
10,
11,
0,
7,
4,
"*"
],
[
11,
14,
0,
7,
5,
"*"
],
[
12,
7,
0,
15,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177{
"last_node_id": 6,
"last_link_id": 4,
"nodes": [
{
"id": 3,
"type": "Primitive string [Crystools]",
"pos": [
50,
100
],
"size": {
"0": 250,
"1": 58
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "string",
"type": "STRING",
"links": [
2
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Primitive string [Crystools]"
},
"widgets_values": [
"folder2"
]
},
{
"id": 2,
"type": "List of strings [Crystools]",
"pos": [
350,
100
],
"size": {
"0": 325,
"1": 275
},
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "string_2",
"type": "STRING",
"link": 2,
"widget": {
"name": "string_2"
}
}
],
"outputs": [
{
"name": "concatenated",
"type": "STRING",
"links": [
4
],
"shape": 3,
"slot_index": 0
},
{
"name": "list_string",
"type": "ListString",
"links": [
3
],
"shape": 6,
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "List of strings [Crystools]"
},
"widgets_values": [
"folder1",
"",
"folder3",
"",
"",
"",
"",
"",
"/"
]
},
{
"id": 6,
"type": "Show any [Crystools]",
"pos": [
775,
100
],
"size": {
"0": 375,
"1": 150
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 4
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 5,
"type": "Show any [Crystools]",
"pos": [
775,
325
],
"size": {
"0": 375,
"1": 150
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 3
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
}
],
"links": [
[
2,
3,
0,
2,
0,
"STRING"
],
[
3,
2,
1,
5,
0,
"*"
],
[
4,
2,
0,
6,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168{
"last_node_id": 10,
"last_link_id": 9,
"nodes": [
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
100,
75
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
8
],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 9,
"type": "Load image with metadata [Crystools]",
"pos": [
100,
500
],
"size": [
325,
350
],
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
9
],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00315_21-81-heun.png",
"image"
]
},
{
"id": 10,
"type": "Metadata comparator [Crystools]",
"pos": [
550,
100
],
"size": [
375,
750
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "metadata_raw_old",
"type": "METADATA_RAW",
"link": 8
},
{
"name": "metadata_raw_new",
"type": "METADATA_RAW",
"link": 9
}
],
"outputs": [
{
"name": "diff",
"type": "JSON",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Metadata comparator [Crystools]"
}
}
],
"links": [
[
8,
1,
3,
10,
0,
"METADATA_RAW"
],
[
9,
9,
3,
10,
1,
"METADATA_RAW"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350{
"last_node_id": 8,
"last_link_id": 7,
"nodes": [
{
"id": 5,
"type": "Show any [Crystools]",
"pos": [
1100,
575
],
"size": [
475,
225
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 4
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 4,
"type": "Show any [Crystools]",
"pos": [
1100,
50
],
"size": [
475,
450
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 3
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 8,
"type": "Show any [Crystools]",
"pos": [
100,
900
],
"size": [
450,
375
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 7
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
100,
75
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": null,
"shape": 3
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": [
1
],
"shape": 3,
"slot_index": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 2,
"type": "Metadata extractor [Crystools]",
"pos": [
125,
625
],
"size": {
"0": 355.20001220703125,
"1": 126
},
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "metadata_raw",
"type": "METADATA_RAW",
"link": 1
}
],
"outputs": [
{
"name": "prompt",
"type": "JSON",
"links": [
2
],
"shape": 3,
"slot_index": 0
},
{
"name": "workflow",
"type": "JSON",
"links": [
3
],
"shape": 3,
"slot_index": 1
},
{
"name": "file info",
"type": "JSON",
"links": [
4
],
"shape": 3,
"slot_index": 2
},
{
"name": "raw to JSON",
"type": "JSON",
"links": [
5
],
"shape": 3,
"slot_index": 3
},
{
"name": "raw to property",
"type": "STRING",
"links": [
6
],
"shape": 3,
"slot_index": 4
},
{
"name": "raw to csv",
"type": "STRING",
"links": [
7
],
"shape": 3,
"slot_index": 5
}
],
"properties": {
"Node name for S&R": "Metadata extractor [Crystools]"
}
},
{
"id": 6,
"type": "Show any [Crystools]",
"pos": [
1100,
900
],
"size": [
475,
375
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 5
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 7,
"type": "Show any [Crystools]",
"pos": [
600,
900
],
"size": [
450,
375
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 6
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
},
{
"id": 3,
"type": "Show any [Crystools]",
"pos": [
625,
50
],
"size": [
425,
450
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 2
}
],
"properties": {
"Node name for S&R": "Show any [Crystools]"
}
}
],
"links": [
[
1,
1,
3,
2,
0,
"METADATA_RAW"
],
[
2,
2,
0,
3,
0,
"*"
],
[
3,
2,
1,
4,
0,
"*"
],
[
4,
2,
2,
5,
0,
"*"
],
[
5,
2,
3,
6,
0,
"*"
],
[
6,
2,
4,
7,
0,
"*"
],
[
7,
2,
5,
8,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564{
"last_node_id": 15,
"last_link_id": 29,
"nodes": [
{
"id": 3,
"type": "KSampler",
"pos": [
1350,
125
],
"size": [
325,
475
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 17
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 26
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 25
},
{
"name": "latent_image",
"type": "LATENT",
"link": 24
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1400,
675
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 27
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1400,
800
],
"size": [
200,
275
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
75,
525
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
22
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 15,
"type": "Pipe from any [Crystools]",
"pos": [
975,
200
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": 12
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": null,
"shape": 3
},
{
"name": "any_1",
"type": "*",
"links": [
17
],
"shape": 3,
"slot_index": 1
},
{
"name": "any_2",
"type": "*",
"links": [
27
],
"shape": 3,
"slot_index": 2
},
{
"name": "any_3",
"type": "*",
"links": [
26
],
"shape": 3,
"slot_index": 3
},
{
"name": "any_4",
"type": "*",
"links": [
25
],
"shape": 3,
"slot_index": 4
},
{
"name": "any_5",
"type": "*",
"links": [
24
],
"shape": 3,
"slot_index": 5
},
{
"name": "any_6",
"type": "*",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Pipe from any [Crystools]"
}
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
75,
275
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
29
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
175,
100
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
13
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
28
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\3d\\disneyPixarCartoon_v10.safetensors"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
175,
775
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
21
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 14,
"type": "Pipe to/edit any [Crystools]",
"pos": [
625,
200
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": null
},
{
"name": "any_1",
"type": "*",
"link": 13
},
{
"name": "any_2",
"type": "*",
"link": 28
},
{
"name": "any_3",
"type": "*",
"link": 29
},
{
"name": "any_4",
"type": "*",
"link": 22
},
{
"name": "any_5",
"type": "*",
"link": 21
},
{
"name": "any_6",
"type": "*",
"link": null
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": [
12
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Pipe to/edit any [Crystools]"
}
}
],
"links": [
[
3,
4,
1,
6,
0,
"CLIP"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
12,
14,
0,
15,
0,
"CPipeAny"
],
[
13,
4,
0,
14,
1,
"*"
],
[
17,
15,
1,
3,
0,
"MODEL"
],
[
21,
5,
0,
14,
5,
"*"
],
[
22,
7,
0,
14,
4,
"*"
],
[
24,
15,
5,
3,
3,
"LATENT"
],
[
25,
15,
4,
3,
2,
"CONDITIONING"
],
[
26,
15,
3,
3,
1,
"CONDITIONING"
],
[
27,
15,
2,
8,
1,
"VAE"
],
[
28,
4,
2,
14,
2,
"*"
],
[
29,
6,
0,
14,
3,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849{
"last_node_id": 19,
"last_link_id": 37,
"nodes": [
{
"id": 3,
"type": "KSampler",
"pos": [
1350,
125
],
"size": [
325,
475
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 17
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 26
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 25
},
{
"name": "latent_image",
"type": "LATENT",
"link": 24
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1400,
675
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 27
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1400,
800
],
"size": [
200,
275
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
75,
525
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
22
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 15,
"type": "Pipe from any [Crystools]",
"pos": [
975,
200
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": 32
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": null,
"shape": 3
},
{
"name": "any_1",
"type": "*",
"links": [
17
],
"shape": 3,
"slot_index": 1
},
{
"name": "any_2",
"type": "*",
"links": [
27
],
"shape": 3,
"slot_index": 2
},
{
"name": "any_3",
"type": "*",
"links": [
26
],
"shape": 3,
"slot_index": 3
},
{
"name": "any_4",
"type": "*",
"links": [
25
],
"shape": 3,
"slot_index": 4
},
{
"name": "any_5",
"type": "*",
"links": [
24
],
"shape": 3,
"slot_index": 5
},
{
"name": "any_6",
"type": "*",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Pipe from any [Crystools]"
}
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
75,
275
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
29
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
175,
775
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
21
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 14,
"type": "Pipe to/edit any [Crystools]",
"pos": [
625,
200
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": null
},
{
"name": "any_1",
"type": "*",
"link": 13
},
{
"name": "any_2",
"type": "*",
"link": 28
},
{
"name": "any_3",
"type": "*",
"link": 29
},
{
"name": "any_4",
"type": "*",
"link": 22
},
{
"name": "any_5",
"type": "*",
"link": 21
},
{
"name": "any_6",
"type": "*",
"link": 33
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": [
30
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Pipe to/edit any [Crystools]"
}
},
{
"id": 16,
"type": "Pipe to/edit any [Crystools]",
"pos": [
950,
475
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": 31
},
{
"name": "any_1",
"type": "*",
"link": null
},
{
"name": "any_2",
"type": "*",
"link": null
},
{
"name": "any_3",
"type": "*",
"link": 37
},
{
"name": "any_4",
"type": "*",
"link": null
},
{
"name": "any_5",
"type": "*",
"link": null
},
{
"name": "any_6",
"type": "*",
"link": null
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": [
32
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Pipe to/edit any [Crystools]"
}
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
175,
100
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
13
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5,
33
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
28
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\3d\\disneyPixarCartoon_v10.safetensors"
]
},
{
"id": 17,
"type": "Pipe from any [Crystools]",
"pos": [
650,
475
],
"size": {
"0": 216.59999084472656,
"1": 146
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"link": 30
}
],
"outputs": [
{
"name": "CPipeAny",
"type": "CPipeAny",
"links": [
31
],
"shape": 3,
"slot_index": 0
},
{
"name": "any_1",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 1
},
{
"name": "any_2",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 2
},
{
"name": "any_3",
"type": "*",
"links": [
35
],
"shape": 3,
"slot_index": 3
},
{
"name": "any_4",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 4
},
{
"name": "any_5",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 5
},
{
"name": "any_6",
"type": "*",
"links": [
34
],
"shape": 3,
"slot_index": 6
}
],
"properties": {
"Node name for S&R": "Pipe from any [Crystools]"
}
},
{
"id": 19,
"type": "ConditioningCombine",
"pos": [
925,
750
],
"size": {
"0": 342.5999755859375,
"1": 46
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "conditioning_1",
"type": "CONDITIONING",
"link": 35
},
{
"name": "conditioning_2",
"type": "CONDITIONING",
"link": 36
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
37
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ConditioningCombine"
}
},
{
"id": 18,
"type": "CLIPTextEncode",
"pos": [
650,
775
],
"size": [
200,
75.99999237060547
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 34
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
36
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"at night"
]
}
],
"links": [
[
3,
4,
1,
6,
0,
"CLIP"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
13,
4,
0,
14,
1,
"*"
],
[
17,
15,
1,
3,
0,
"MODEL"
],
[
21,
5,
0,
14,
5,
"*"
],
[
22,
7,
0,
14,
4,
"*"
],
[
24,
15,
5,
3,
3,
"LATENT"
],
[
25,
15,
4,
3,
2,
"CONDITIONING"
],
[
26,
15,
3,
3,
1,
"CONDITIONING"
],
[
27,
15,
2,
8,
1,
"VAE"
],
[
28,
4,
2,
14,
2,
"*"
],
[
29,
6,
0,
14,
3,
"*"
],
[
30,
14,
0,
17,
0,
"CPipeAny"
],
[
31,
17,
0,
16,
0,
"CPipeAny"
],
[
32,
16,
0,
15,
0,
"CPipeAny"
],
[
33,
4,
1,
14,
6,
"*"
],
[
34,
17,
6,
18,
0,
"CLIP"
],
[
35,
17,
3,
19,
0,
"CONDITIONING"
],
[
36,
18,
0,
19,
1,
"CONDITIONING"
],
[
37,
19,
0,
16,
3,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496{
"last_node_id": 12,
"last_link_id": 16,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
425,
525
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
475,
750
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1675,
325
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1900,
325
],
"size": {
"0": 210,
"1": 275
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
50,
625
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5,
14
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\3d\\disneyPixarCartoon_v10.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
1325,
325
],
"size": {
"0": 325,
"1": 475
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 13
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
425,
325
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
16
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 10,
"type": "CLIPTextEncode",
"pos": [
425,
100
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 14
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
15
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, in the bottle should be a cat (seen the camera:1.2), purple galaxy bottle,"
]
},
{
"id": 11,
"type": "Switch conditioning [Crystools]",
"pos": [
950,
200
],
"size": {
"0": 315,
"1": 78
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "on_true",
"type": "CONDITIONING",
"link": 15
},
{
"name": "on_false",
"type": "CONDITIONING",
"link": 16
}
],
"outputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"links": [
13
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Switch conditioning [Crystools]"
},
"widgets_values": [
true
]
},
{
"id": 12,
"type": "Note",
"pos": [
950,
75
],
"size": [
300,
52
],
"flags": {},
"order": 2,
"mode": 0,
"properties": {
"text": ""
},
"widgets_values": [
"change the switch to select a prompt"
],
"color": "#432",
"bgcolor": "#653"
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
13,
11,
0,
3,
1,
"CONDITIONING"
],
[
14,
4,
1,
10,
0,
"CLIP"
],
[
15,
10,
0,
11,
0,
"CONDITIONING"
],
[
16,
6,
0,
11,
1,
"CONDITIONING"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212{
"last_node_id": 4,
"last_link_id": 3,
"nodes": [
{
"id": 1,
"type": "Load image with metadata [Crystools]",
"pos": [
200,
250
],
"size": [
325,
350
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": [
1
],
"shape": 3,
"slot_index": 2
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00314_20-8-euler.png",
"image"
]
},
{
"id": 2,
"type": "Load image with metadata [Crystools]",
"pos": [
200,
700
],
"size": [
325,
350
],
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
},
{
"name": "prompt",
"type": "JSON",
"links": [
2
],
"shape": 3,
"slot_index": 2
},
{
"name": "Metadata RAW",
"type": "METADATA_RAW",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Load image with metadata [Crystools]"
},
"widgets_values": [
"tests/ComfyUI_00315_21-81-heun.png",
"image"
]
},
{
"id": 3,
"type": "Json comparator [Crystools]",
"pos": [
650,
275
],
"size": {
"0": 279.5999755859375,
"1": 46
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "json_old",
"type": "JSON",
"link": 1
},
{
"name": "json_new",
"type": "JSON",
"link": 2
}
],
"outputs": [
{
"name": "json_compared",
"type": "JSON",
"links": [
3
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Json comparator [Crystools]"
}
},
{
"id": 4,
"type": "Show any to JSON [Crystools]",
"pos": [
650,
450
],
"size": [
325,
350
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "any_value",
"type": "*",
"link": 3
}
],
"outputs": [
{
"name": "string",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "Show any to JSON [Crystools]"
}
}
],
"links": [
[
1,
1,
2,
3,
0,
"JSON"
],
[
2,
2,
2,
3,
1,
"JSON"
],
[
3,
3,
0,
4,
0,
"*"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410{
"last_node_id": 10,
"last_link_id": 11,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1675,
300
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 11
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
26,
474
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
1
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"SD1.5\\3d\\disneyPixarCartoon_v10.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
863,
186
],
"size": [
325,
475
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
10
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
156680208700286,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 10,
"type": "Stats system [Crystools]",
"pos": [
1275,
175
],
"size": [
350,
125
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "latent",
"type": "LATENT",
"link": 10
}
],
"outputs": [
{
"name": "latent",
"type": "LATENT",
"links": [
11
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Stats system [Crystools]"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1925,
300
],
"size": [
200,
275
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
}
],
"links": [
[
1,
4,
0,
3,
0,
"MODEL"
],
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
10,
3,
0,
10,
0,
"LATENT"
],
[
11,
10,
0,
8,
0,
"LATENT"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}1from .monitor import *123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125from server import PromptServer
from aiohttp import web
from ..core import logger
from ..general import cmonitor
@PromptServer.instance.routes.patch("/crystools/monitor")
async def newSettings(request):
try:
settings = await request.json()
# print(settings)
if 'rate' in settings is not None:
rate = settings['rate']
if type(rate) is not int and type(rate) is not float:
raise Exception('Rate must be an number.')
if cmonitor.rate == 0 and rate > 0:
cmonitor.rate = rate
cmonitor.startMonitor()
else:
cmonitor.rate = rate
if 'switchCPU' in settings is not None:
switchCPU = settings['switchCPU']
if type(switchCPU) is not bool:
raise Exception('switchCPU must be an boolean.')
cmonitor.hardwareInfo.switchCPU = switchCPU
if 'switchHDD' in settings is not None:
switchHDD = settings['switchHDD']
if type(switchHDD) is not bool:
raise Exception('switchHDD must be an boolean.')
cmonitor.hardwareInfo.switchHDD = switchHDD
if 'switchRAM' in settings is not None:
switchRAM = settings['switchRAM']
if type(switchRAM) is not bool:
raise Exception('switchRAM must be an boolean.')
cmonitor.hardwareInfo.switchRAM = switchRAM
if 'whichHDD' in settings is not None:
whichHDD = settings['whichHDD']
if type(whichHDD) is not str:
raise Exception('whichHDD must be an string.')
cmonitor.hardwareInfo.whichHDD = whichHDD
return web.Response(status=200)
except Exception as e:
logger.error(e)
return web.Response(status=400, text=str(e))
@PromptServer.instance.routes.post("/crystools/monitor/switch")
async def monitorSwitch(request):
try:
switch = await request.json()
if 'monitor' in switch is not None:
monitor = switch['monitor']
if type(monitor) is not bool:
raise Exception('monitor must be an boolean.')
if monitor:
cmonitor.startMonitor()
else:
cmonitor.stopMonitor()
return web.Response(status=200)
except Exception as e:
logger.error(e)
return web.Response(status=400, text=str(e))
@PromptServer.instance.routes.get("/crystools/monitor/HDD")
def getHDDs(request):
try:
return web.json_response(cmonitor.hardwareInfo.getHDDsInfo())
except Exception as e:
logger.error(e)
return web.Response(status=400, text=str(e))
@PromptServer.instance.routes.get("/crystools/monitor/GPU")
def getGPUs(request):
try:
gpuInfo = cmonitor.hardwareInfo.getGPUInfo()
return web.json_response(gpuInfo)
except Exception as e:
logger.error(e)
return web.Response(status=400, text=str(e))
@PromptServer.instance.routes.patch("/crystools/monitor/GPU/{index}")
async def getGPUs(request):
try:
index = request.match_info["index"]
settings = await request.json()
if 'utilization' in settings is not None:
if type(settings['utilization']) is not bool:
raise Exception('utilization must be an boolean.')
cmonitor.hardwareInfo.GPUInfo.gpusUtilization[int(index)] = settings['utilization']
if 'vram' in settings is not None:
if type(settings['vram']) is not bool:
raise Exception('vram must be an boolean.')
cmonitor.hardwareInfo.GPUInfo.gpusVRAM[int(index)] = settings['vram']
if 'temperature' in settings is not None:
if type(settings['temperature']) is not bool:
raise Exception('temperature must be an boolean.')
cmonitor.hardwareInfo.GPUInfo.gpusTemperature[int(index)] = settings['temperature']
return web.Response(status=200)
except Exception as e:
logger.error(e)
return web.Response(status=400, text=str(e))12345export type * from './scripts.js';
export * from './scripts.js';
export type { ComfyApp } from './typings/comfy.js';
export * from './liteGraph.js';
export type * from './liteGraph.js';12export * from './scripts.js';
export * from './liteGraph.js';12345export type * from './scripts.js';
export * from './scripts.js';
export type { ComfyApp } from './typings/comfy.js';
export * from './liteGraph.js';
export type * from './liteGraph.js';12345678910111213141516171819export type * from './liteGraph.types.js';
import type { IWidget as IWidgetOld, LGraphNode as TypeGraphNode, TypeLiteGraph } from './liteGraph.types.js';
declare const LGraphNode: typeof TypeGraphNode;
export interface IWidget extends IWidgetOld {
onRemove?: () => void;
serializeValue?: () => Promise<void>;
}
export declare class TLGraphNode extends LGraphNode {
static category: string;
static shape: number;
static color: string;
static bgcolor: string;
static collapsable: boolean;
isVirtualNode?: boolean;
widgets_values?: any[];
name?: string;
prototype: TLGraphNode;
}
export declare const LiteGraph: TypeLiteGraph;123456789101112131415161718192021222324252627282930export class TLGraphNode extends LGraphNode {
constructor() {
super(...arguments);
Object.defineProperty(this, "isVirtualNode", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "widgets_values", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "prototype", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
}
export const LiteGraph = window.LiteGraph;1234567891011121314151617181920212223242526272829303132// / <reference path="/types/litegraph.d.ts" />
// A LOTS OF PATCHES FOR LITEGRAPH TYPES ¯\_(ツ)_/¯
export type * from './liteGraph.types.js';
import type { IWidget as IWidgetOld, LGraphNode as TypeGraphNode, TypeLiteGraph } from './liteGraph.types.js';
declare const LGraphNode: typeof TypeGraphNode; // just for get the type
export interface IWidget extends IWidgetOld {
onRemove?: () => void;
serializeValue?: () => Promise<void>;
}
export class TLGraphNode extends LGraphNode {
// on discovery...
static category: string;
static shape: number;
static color: string;
static bgcolor: string;
static collapsable: boolean;
// widgets?: IWidget[];
isVirtualNode?: boolean;
// override onResize?: (size: [number, number]) => void;
widgets_values?: any[];
name?: string;
prototype: TLGraphNode; // yes itself
}
// from globals
export const LiteGraph: TypeLiteGraph = (window as any).LiteGraph;12345678910111213141516171819// A LOTS OF PATCHES FOR LITEGRAPH TYPES ¯\_(ツ)_/¯
import { LGraph } from './typings/litegraph.js';
export type * from './typings/litegraph.js';
export declare type TypeLiteGraph = typeof LiteGraph & {
graph: LGraph;
};
// export declare type ComfyApi = typeof api;
export declare type ComfyNode = any;
// I prefer not use global, but if I change of opinion:
// / <reference path="./types.ts" />
// import { LGraphNode as TLGraphNode, LiteGraph as TLiteGraph } from '/types/litegraph';
// export declare const LGraphNode: typeof TLGraphNode;
// declare global {
// const LGraphNode: LGraphNode;
// }12345export { ComfyWidgets } from '../../../scripts/widgets.js';
export { app } from '../../../scripts/app.js';
export { api } from '../../../scripts/api.js';
export * as utils from '../../../scripts/utils.js';
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';12345export { ComfyWidgets } from '../../../scripts/widgets.js';
export { app } from '../../../scripts/app.js';
export { api } from '../../../scripts/api.js';
export * as utils from '../../../scripts/utils.js';
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';12345678910// @ts-expect-error I could not find a way to make this work
export { ComfyWidgets } from '../../../scripts/widgets.js';
// @ts-expect-error I could not find a way to make this work
export { app } from '../../../scripts/app.js';
// @ts-expect-error I could not find a way to make this work
export { api } from '../../../scripts/api.js';
// @ts-expect-error I could not find a way to make this work
export * as utils from '../../../scripts/utils.js';
// @ts-expect-error I could not find a way to make this work
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';12345COPIED FROM rgthree
The typings in node_modules or in ComfyUI's web/ directory were not that well covered. These typings are hacked together with some of the inconsistencies I found.
To be honest, I have no idea why I needed a bizarre workaround for litegraph's types. Usually the '/// <reference>' comment should have picked up the types, but it wasn't having it. ¯\_(ツ)_/¯123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227import type { LGraphGroup as TLGraphGroup, LGraphNode as TLGraphNode, IWidget, SerializedLGraphNode, LGraph as TLGraph, LGraphCanvas as TLGraphCanvas, LiteGraph as TLiteGraph } from "./litegraph.js";
import type {Constructor, SerializedGraph} from './index.js';
declare global {
const LiteGraph: typeof TLiteGraph;
const LGraph: typeof TLGraph;
const LGraphNode: typeof TLGraphNode;
const LGraphCanvas: typeof TLGraphCanvas;
const LGraphGroup: typeof TLGraphGroup;
}
// @rgthree: Types on ComfyApp as needed.
export interface ComfyApp {
extensions: ComfyExtension[];
async queuePrompt(number?: number, batchCount = 1): Promise<void>;
graph: TLGraph;
canvas: TLGraphCanvas;
clean() : void;
registerExtension(extension: ComfyExtension): void;
getPreviewFormatParam(): string;
getRandParam(): string;
loadApiJson(apiData: {}, fileName: string): void;
async graphToPrompt(graph?: TLGraph, clean?: boolean): Promise<void>;
// workflow: ComfyWorkflowInstance ???
async loadGraphData(graphData: {}, clean?: boolean, restore_view?: boolean, workflow?: any|null): Promise<void>
ui: {
settings: {
addSetting(config: {id: string, name: string, type: () => HTMLElement}) : void;
}
}
// Just marking as any for now.
menu?: any;
}
export interface ComfyWidget extends IWidget {
// https://github.com/comfyanonymous/ComfyUI/issues/2193 Changes from SerializedLGraphNode to
// LGraphNode...
serializeValue(nodeType: TLGraphNode, index: number): Promise<TValue>;
afterQueued(): void;
inputEl?: HTMLTextAreaElement;
width: number;
}
export interface ComfyGraphNode extends TLGraphNode {
getExtraMenuOptions: (node: TLGraphNode, options: ContextMenuItem[]) => void;
onExecuted(message: any): void;
}
export interface ComfyNode extends TLGraphNode {
comfyClass: string;
}
// @rgthree
export interface ComfyNodeConstructor extends Constructor<ComfyNode> {
static title: string;
static type?: string;
static comfyClass: string;
}
export type NodeMode = 0|1|2|3|4|undefined;
export interface ComfyExtension {
/**
* The name of the extension
*/
name: string;
/**
* Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added
* @param app The ComfyUI app instance
*/
init?(app: ComfyApp): Promise<void>;
/**
* Allows any additonal setup, called after the application is fully set up and running
* @param app The ComfyUI app instance
*/
setup?(app: ComfyApp): Promise<void>;
/**
* Called before nodes are registered with the graph
* @param defs The collection of node definitions, add custom ones or edit existing ones
* @param app The ComfyUI app instance
*/
addCustomNodeDefs?(defs: Record<string, ComfyObjectInfo>, app: ComfyApp): Promise<void>;
/**
* Allows the extension to add custom widgets
* @param app The ComfyUI app instance
* @returns An array of {[widget name]: widget data}
*/
getCustomWidgets?(
app: ComfyApp
): Promise<
Record<string, (node, inputName, inputData, app) => { widget?: IWidget; minWidth?: number; minHeight?: number }>
>;
/**
* Allows the extension to add additional handling to the node before it is registered with LGraph
* @rgthree changed nodeType from `typeof LGraphNode` to `ComfyNodeConstructor`
* @param nodeType The node class (not an instance)
* @param nodeData The original node object info config object
* @param app The ComfyUI app instance
*/
beforeRegisterNodeDef?(nodeType: ComfyNodeConstructor, nodeData: ComfyObjectInfo, app: ComfyApp): Promise<void>;
/**
* Allows the extension to register additional nodes with LGraph after standard nodes are added
* @param app The ComfyUI app instance
*/
// @rgthree - add void for non async
registerCustomNodes?(app: ComfyApp): void|Promise<void>;
/**
* Allows the extension to modify a node that has been reloaded onto the graph.
* If you break something in the backend and want to patch workflows in the frontend
* This is the place to do this
* @param node The node that has been loaded
* @param app The ComfyUI app instance
*/
loadedGraphNode?(node: TLGraphNode, app: ComfyApp);
/**
* Allows the extension to run code after the constructor of the node
* @param node The node that has been created
* @param app The ComfyUI app instance
*/
nodeCreated?(node: TLGraphNode, app: ComfyApp);
}
export type ComfyObjectInfo = {
name: string;
display_name?: string;
description?: string;
category: string;
input?: {
required?: Record<string, ComfyObjectInfoConfig>;
optional?: Record<string, ComfyObjectInfoConfig>;
hidden?: Record<string, ComfyObjectInfoConfig>;
};
output?: string[];
output_name: string[];
// @rgthree
output_node?: boolean;
};
export type ComfyObjectInfoConfig = [string | any[]] | [string | any[], any];
// @rgthree
type ComfyApiInputLink = [
/** The id string of the connected node. */
string,
/** The output index. */
number,
]
// @rgthree
export type ComfyApiFormatNode = {
"inputs": {
[input_name: string]: string|number|boolean|ComfyApiInputLink,
},
"class_type": string,
"_meta": {
"title": string,
}
}
// @rgthree
export type ComfyApiFormat = {
[node_id: string]: ComfyApiFormatNode
}
// @rgthree
export type ComfyApiPrompt = {
workflow: SerializedGraph,
output: ComfyApiFormat,
}
// @rgthree
export type ComfyApiEventDetailStatus = {
exec_info: {
queue_remaining: number;
};
};
// @rgthree
export type ComfyApiEventDetailExecutionStart = {
prompt_id: string;
};
// @rgthree
export type ComfyApiEventDetailExecuting = null | string;
// @rgthree
export type ComfyApiEventDetailProgress = {
node: string;
prompt_id: string;
max: number;
value: number;
};
// @rgthree
export type ComfyApiEventDetailExecuted = {
node: string;
prompt_id: string;
output: any;
};
// @rgthree
export type ComfyApiEventDetailCached = {
nodes: string[];
prompt_id: string;
};
// @rgthree
export type ComfyApiEventDetailExecuted = {
prompt_id: string;
node: string;
output: any;
};
// @rgthree
export type ComfyApiEventDetailError = {
prompt_id: string;
exception_type: string;
exception_message: string;
node_id: string;
node_type: string;
node_id: string;
traceback: string;
executed: any[];
current_inputs: {[key: string]: (number[]|string[])};
current_outputs: {[key: string]: (number[]|string[])};
}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import { LGraph } from "./litegraph.js";
export type Constructor<T> = new(...args: any[]) => T;
export type SerializedLink = [
number, // this.id,
number, // this.origin_id,
number, // this.origin_slot,
number, // this.target_id,
number, // this.target_slot,
string, // this.type
];
export interface SerializedNodeInput {
name: string;
type: string;
link: number;
}
export interface SerializedNodeOutput {
name: string;
type: string;
link: number;
slot_index: number;
links: number[];
}
export interface SerializedNode {
id: number;
inputs: SerializedNodeInput[];
outputs: SerializedNodeOutput[];
mode: number;
order: number;
pos: [number, number];
properties: any;
size: [number, number];
type: string;
widgets_values: Array<number | string>;
}
export interface SerializedGraph {
config: any;
extra: any;
groups: any;
last_link_id: number;
last_node_id: number;
links: SerializedLink[];
nodes: SerializedNode[];
}
export interface BadLinksData<T = SerializedGraph|LGraph> {
hasBadLinks: boolean;
fixed: boolean;
graph: T;
patched: number;
deleted: number;
}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750// Type definitions for litegraph.js 0.7.0
// Project: litegraph.js
// Definitions by: NateScarlet <https://github.com/NateScarlet>
export type Vector2 = [number, number];
export type Vector4 = [number, number, number, number];
export type widgetTypes =
| "number"
| "slider"
| "combo"
| "text"
| "toggle"
| "button";
export type SlotShape =
| typeof LiteGraph.BOX_SHAPE
| typeof LiteGraph.CIRCLE_SHAPE
| typeof LiteGraph.ARROW_SHAPE
| typeof LiteGraph.SQUARE_SHAPE
| number; // For custom shapes
/** https://github.com/jagenjo/litegraph.js/tree/master/guides#node-slots */
export interface INodeSlot {
name: string;
type: string | -1;
label?: string;
dir?:
| typeof LiteGraph.UP
| typeof LiteGraph.RIGHT
| typeof LiteGraph.DOWN
| typeof LiteGraph.LEFT;
color_on?: string;
color_off?: string;
shape?: SlotShape;
locked?: boolean;
nameLocked?: boolean;
pos?: Vector2;
// @rgthree
hidden?: boolean;
// @rgthree
disabled?: boolean;
// @rgthree - Found this checked in getSlotMenuOptions default.
removable?: boolean;
// @rgthree - A status we put on some nodes so we can draw things around it.
rgthree_status?: 'WARN' | 'ERROR';
}
export interface INodeInputSlot extends INodeSlot {
link: LLink["id"] | null;
// @rgthree - add comfy widget info
widget?: {
name: string;
}
}
export interface INodeOutputSlot extends INodeSlot {
links: LLink["id"][] | null;
}
export type WidgetCallback<T extends IWidget = IWidget> = (
this: T,
value: T["value"],
graphCanvas: LGraphCanvas,
node: LGraphNode,
pos: Vector2,
event?: MouseEvent
) => void;
// @rgthree
export type WidgetComboCallback<T extends IWidget = IWidget> = (
this: T,
value: T["value"][0],
graphCanvas: LGraphCanvas,
node: LGraphNode,
pos: Vector2,
event?: MouseEvent
) => void;
// @rgthree
export type IWidgetOptions = {
y?: number; // ?
property?: string;
serialize?: boolean; // ComfyUI in app.js
forceInput?: boolean; // ComfyUI in app.js
defaultInput?: boolean; // ComfyUI in app.js
}
// @rgthree
export type IWidgetToggleOptions = IWidgetOptions & {
on?: string;
off?: string;
}
// @rgthree
export type IWidgetNumberOptions = IWidgetOptions & {
precision?: number;
max?: number;
min?: number;
}
// @rgthree
export type IWidgetSliderOptions = IWidgetNumberOptions & {
slider_color?: string;
marker_color?: string;
}
// @rgthree
export type IWidgetComboOptions = IWidgetOptions & {
values?: string[] | ((widget: IComboWidget, node: LGraphNode) => string[]);
}
export interface IWidget<TValue = any, TOptions = any> {
name: string | null;
// @rgthree
label?: string | null;
value: TValue;
options?: TOptions;
// @rgthree - extend to string for custom
type?: widgetTypes | string;
y?: number;
property?: string;
last_y?: number;
clicked?: boolean;
marker?: boolean;
disabled?: boolean;
callback?: WidgetCallback<this>;
// crystools
onRemove?: () => void;
/** Called by `LGraphCanvas.drawNodeWidgets` */
draw?(
ctx: CanvasRenderingContext2D,
node: LGraphNode,
width: number,
posY: number,
height: number
): void;
/**
* Called by `LGraphCanvas.processNodeWidgets`
* https://github.com/jagenjo/litegraph.js/issues/76
*/
mouse?(
event: MouseEvent,
pos: Vector2,
node: LGraphNode
): boolean;
/** Called by `LGraphNode.computeSize` */
computeSize?(width: number): [number, number];
// @rgthree - make optional, since it is in the code.
serializeValue?(serializedNode: SerializedLGraphNode, widgetIndex: number): TValue;
// @rgthree - Checked in LGraphCanvas.prototype.processNodeWidgets, and figured I'd use it too.
width?: number;
}
export interface IButtonWidget extends IWidget<null, {}> {
type: "button";
}
// @rgthree: adding options
export interface IToggleWidget extends IWidget<boolean, IWidgetToggleOptions> {
type: "toggle";
}
// @rgthree: adding options
export interface ISliderWidget extends IWidget<number, IWidgetSliderOptions> {
type: "slider";
}
// @rgthree: adding options
export interface INumberWidget extends IWidget<number, IWidgetNumberOptions> {
type: "number";
}
// @rgthree: adding options
export interface IComboWidget extends IWidget<string[], IWidgetComboOptions> {
value: T[0];
type: "combo";
callback?: WidgetComboCallback;
}
export interface ITextWidget extends IWidget<string, {}> {
type: "text";
}
export interface IContextMenuItem {
// @rgthree - Make optional because, I guess it is?
content?: string;
value?: any;
callback?: ContextMenuEventListener;
/** Used as innerHTML for extra child element */
title?: string;
disabled?: boolean;
has_submenu?: boolean;
submenu?: {
options: ContextMenuItem[];
} & IContextMenuOptions;
className?: string;
// @rgthree - Added for menu_auto_nest
rgthree_originalValue?: IContextMenuItem;
// @rgthree - this was missing and passed through for getSlotMenuOptions default.
slot?: {input?: INodeInputSlot, output?: INodeOutputSlot};
}
export interface IContextMenuOptions {
callback?: ContextMenuEventListener;
ignore_item_callbacks?: Boolean;
event?: MouseEvent | CustomEvent | AdjustedMouseEvent;
parentMenu?: ContextMenu|null;
autoopen?: boolean;
title?: string;
extra?: any;
// @rgthree
scale?: number;
// @rgthree
left?: number;
// @rgthree
top?: number;
// @rgthree
className?: string;
// @rgthree - Added for menu_auto_nest
rgthree_originalCallback?: ContextMenuEventListener;
// @rgthree - No idea since it's not documented, but we'll use it to pass data, like rgthree_doNotNest
extra?: any
}
export type ContextMenuItem = IContextMenuItem | null;
export type ContextMenuEventListener = (
value: ContextMenuItem,
options: IContextMenuOptions,
event: MouseEvent,
parentMenu: ContextMenu | undefined,
node: LGraphNode
) => boolean | void;
export const LiteGraph: {
VERSION: number;
CANVAS_GRID_SIZE: number;
NODE_TITLE_HEIGHT: number;
NODE_TITLE_TEXT_Y: number;
NODE_SLOT_HEIGHT: number;
NODE_WIDGET_HEIGHT: number;
NODE_WIDTH: number;
NODE_MIN_WIDTH: number;
NODE_COLLAPSED_RADIUS: number;
NODE_COLLAPSED_WIDTH: number;
NODE_TITLE_COLOR: string;
NODE_TEXT_SIZE: number;
NODE_TEXT_COLOR: string;
NODE_SUBTEXT_SIZE: number;
NODE_DEFAULT_COLOR: string;
NODE_DEFAULT_BGCOLOR: string;
NODE_DEFAULT_BOXCOLOR: string;
NODE_DEFAULT_SHAPE: string;
// @rgthree - didn't exist.
NODE_BOX_OUTLINE_COLOR: string;
DEFAULT_SHADOW_COLOR: string;
DEFAULT_GROUP_FONT: number;
// @rgthree - Seems to have been missing.
NODE_BOX_OUTLINE_COLOR: string;
WIDGET_BGCOLOR: string;
WIDGET_OUTLINE_COLOR: string;
WIDGET_TEXT_COLOR: string;
WIDGET_SECONDARY_TEXT_COLOR: string;
LINK_COLOR: string;
EVENT_LINK_COLOR: string;
CONNECTING_LINK_COLOR: string;
MAX_NUMBER_OF_NODES: number; //avoid infinite loops
DEFAULT_POSITION: Vector2; //default node position
VALID_SHAPES: ["default", "box", "round", "card"]; //,"circle"
//shapes are used for nodes but also for slots
BOX_SHAPE: 1;
ROUND_SHAPE: 2;
CIRCLE_SHAPE: 3;
CARD_SHAPE: 4;
ARROW_SHAPE: 5;
GRID_SHAPE: 6;
//enums
INPUT: 1;
OUTPUT: 2;
EVENT: -1; //for outputs
ACTION: -1; //for inputs
ALWAYS: 0;
ON_EVENT: 1;
NEVER: 2;
ON_TRIGGER: 3;
UP: 1;
DOWN: 2;
LEFT: 3;
RIGHT: 4;
CENTER: 5;
STRAIGHT_LINK: 0;
LINEAR_LINK: 1;
SPLINE_LINK: 2;
NORMAL_TITLE: 0;
NO_TITLE: 1;
TRANSPARENT_TITLE: 2;
AUTOHIDE_TITLE: 3;
node_images_path: string;
// @rgthree. These just weren't there. Note, LiteGraph initializes these as an array, but
// ComfyUI overrides these to a string-keye'd object... ???
slot_types_default_out: {[key: string]: string[]};
slot_types_default_in: {[key: string]: string[]};
debug: boolean;
catch_exceptions: boolean;
throw_errors: boolean;
/** if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits */
allow_scripts: boolean;
/** node types by string */
registered_node_types: Record<string, LGraphNodeConstructor>;
/** used for dropping files in the canvas */
node_types_by_file_extension: Record<string, LGraphNodeConstructor>;
/** node types by class name */
Nodes: Record<string, LGraphNodeConstructor>;
/** used to add extra features to the search box */
searchbox_extras: Record<
string,
{
data: { outputs: string[][]; title: string };
desc: string;
type: string;
}
>;
//@rgthree
isValidConnection(type: string|string[], type: string|string[]):boolean;
overlapBounding(a: Vector4, b: Vector4) : boolean;
createNode<T extends LGraphNode = LGraphNode>(type: string): T;
/** Register a node class so it can be listed when the user wants to create a new one */
registerNodeType<T extends LGraphNode = LGraphNode>(type: string, base: { new (title?: string): T }): void;
/** removes a node type from the system */
unregisterNodeType(type: string): void;
/** Removes all previously registered node's types. */
clearRegisteredTypes(): void;
/**
* Create a new node type by passing a function, it wraps it with a proper class and generates inputs according to the parameters of the function.
* Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.
* @param name node name with namespace (p.e.: 'math/sum')
* @param func
* @param param_types an array containing the type of every parameter, otherwise parameters will accept any type
* @param return_type string with the return type, otherwise it will be generic
* @param properties properties to be configurable
*/
wrapFunctionAsNode(
name: string,
func: (...args: any[]) => any,
param_types?: string[],
return_type?: string,
properties?: object
): void;
/**
* Adds this method to all node types, existing and to be created
* (You can add it to LGraphNode.prototype but then existing node types wont have it)
*/
addNodeMethod(name: string, func: (...args: any[]) => any): void;
/**
* Create a node of a given type with a name. The node is not attached to any graph yet.
* @param type full name of the node class. p.e. "math/sin"
* @param name a name to distinguish from other nodes
* @param options to set options
*/
createNode<T extends LGraphNode>(
type: string,
title: string,
options: object
): T;
/**
* Returns a registered node type with a given name
* @param type full name of the node class. p.e. "math/sin"
*/
getNodeType<T extends LGraphNode>(type: string): LGraphNodeConstructor<T>;
/**
* Returns a list of node types matching one category
* @method getNodeTypesInCategory
* @param {String} category category name
* @param {String} filter only nodes with ctor.filter equal can be shown
* @return {Array} array with all the node classes
*/
getNodeTypesInCategory(
category: string,
filter: string
): LGraphNodeConstructor[];
/**
* Returns a list with all the node type categories
* @method getNodeTypesCategories
* @param {String} filter only nodes with ctor.filter equal can be shown
* @return {Array} array with all the names of the categories
*/
getNodeTypesCategories(filter: string): string[];
/** debug purposes: reloads all the js scripts that matches a wildcard */
reloadNodes(folder_wildcard: string): void;
getTime(): number;
LLink: typeof LLink;
LGraph: typeof LGraph;
DragAndScale: typeof DragAndScale;
compareObjects(a: object, b: object): boolean;
distance(a: Vector2, b: Vector2): number;
colorToString(c: string): string;
isInsideRectangle(
x: number,
y: number,
left: number,
top: number,
width: number,
height: number
): boolean;
growBounding(bounding: Vector4, x: number, y: number): Vector4;
isInsideBounding(p: Vector2, bb: Vector4): boolean;
hex2num(hex: string): [number, number, number];
num2hex(triplet: [number, number, number]): string;
ContextMenu: typeof ContextMenu;
extendClass<A, B>(target: A, origin: B): A & B;
getParameterNames(func: string): string[];
// @rgthree
closeAllContextMenus(ref_window?: Window): void;
};
export type serializedLGraph<
TNode = ReturnType<LGraphNode["serialize"]>,
// https://github.com/jagenjo/litegraph.js/issues/74
TLink = [number, number, number, number, number, string],
TGroup = ReturnType<LGraphGroup["serialize"]>
> = {
last_node_id: LGraph["last_node_id"];
last_link_id: LGraph["last_link_id"];
nodes: TNode[];
links: TLink[];
groups: TGroup[];
config: LGraph["config"];
version: typeof LiteGraph.VERSION;
};
export declare class LGraph {
static supported_types: string[];
static STATUS_STOPPED: 1;
static STATUS_RUNNING: 2;
constructor(o?: object);
filter: string;
catch_errors: boolean;
/** custom data */
config: object;
elapsed_time: number;
fixedtime: number;
fixedtime_lapse: number;
globaltime: number;
inputs: any;
iteration: number;
last_link_id: number;
last_node_id: number;
last_update_time: number;
links: Record<number, LLink>;
list_of_graphcanvas: LGraphCanvas[];
outputs: any;
runningtime: number;
starttime: number;
status: typeof LGraph.STATUS_RUNNING | typeof LGraph.STATUS_STOPPED;
// @rgthree, remove private; it's not really private b/c it's javascript.
_nodes: LGraphNode[];
// @rgthree, remove private; it's not really private b/c it's javascript.
_groups: LGraphGroup[];
private _nodes_by_id: Record<number, LGraphNode>;
/** nodes that are executable sorted in execution order */
private _nodes_executable:
| (LGraphNode & { onExecute: NonNullable<LGraphNode["onExecute"]> }[])
| null;
/** nodes that contain onExecute */
private _nodes_in_order: LGraphNode[];
private _version: number;
getSupportedTypes(): string[];
/** Removes all nodes from this graph */
clear(): void;
/** Attach Canvas to this graph */
attachCanvas(graphCanvas: LGraphCanvas): void;
/** Detach Canvas to this graph */
detachCanvas(graphCanvas: LGraphCanvas): void;
/**
* Starts running this graph every interval milliseconds.
* @param interval amount of milliseconds between executions, if 0 then it renders to the monitor refresh rate
*/
start(interval?: number): void;
/** Stops the execution loop of the graph */
stop(): void;
/**
* Run N steps (cycles) of the graph
* @param num number of steps to run, default is 1
*/
runStep(num?: number, do_not_catch_errors?: boolean): void;
/**
* Updates the graph execution order according to relevance of the nodes (nodes with only outputs have more relevance than
* nodes with only inputs.
*/
updateExecutionOrder(): void;
/** This is more internal, it computes the executable nodes in order and returns it */
computeExecutionOrder<T = any>(only_onExecute: boolean, set_level: any): T;
/**
* Returns all the nodes that could affect this one (ancestors) by crawling all the inputs recursively.
* It doesn't include the node itself
* @return an array with all the LGraphNodes that affect this node, in order of execution
*/
getAncestors(node: LGraphNode): LGraphNode[];
/**
* Positions every node in a more readable manner
*/
arrange(margin?: number,layout?: string): void;
/**
* Returns the amount of time the graph has been running in milliseconds
* @return number of milliseconds the graph has been running
*/
getTime(): number;
/**
* Returns the amount of time accumulated using the fixedtime_lapse var. This is used in context where the time increments should be constant
* @return number of milliseconds the graph has been running
*/
getFixedTime(): number;
/**
* Returns the amount of time it took to compute the latest iteration. Take into account that this number could be not correct
* if the nodes are using graphical actions
* @return number of milliseconds it took the last cycle
*/
getElapsedTime(): number;
/**
* Sends an event to all the nodes, useful to trigger stuff
* @param eventName the name of the event (function to be called)
* @param params parameters in array format
*/
sendEventToAllNodes(eventName: string, params: any[], mode?: any): void;
sendActionToCanvas(action: any, params: any[]): void;
/**
* Adds a new node instance to this graph
* @param node the instance of the node
*/
add(node: LGraphNode, skip_compute_order?: boolean): void;
/**
* Called when a new node is added
* @param node the instance of the node
*/
onNodeAdded(node: LGraphNode): void;
/** Removes a node from the graph */
remove(node: LGraphNode): void;
/**
* Returns a node by its id.
* @rgthree - make id options/nullable.
*/
getNodeById(id?: number|null): LGraphNode | undefined;
/**
* Returns a list of nodes that matches a class
* @param classObject the class itself (not an string)
* @return a list with all the nodes of this type
*/
findNodesByClass<T extends LGraphNode>(
classObject: LGraphNodeConstructor<T>
): T[];
/**
* Returns a list of nodes that matches a type
* @param type the name of the node type
* @return a list with all the nodes of this type
*/
findNodesByType<T extends LGraphNode = LGraphNode>(type: string): T[];
/**
* Returns the first node that matches a name in its title
* @param title the name of the node to search
* @return the node or null
*/
findNodeByTitle<T extends LGraphNode = LGraphNode>(title: string): T | null;
/**
* Returns a list of nodes that matches a name
* @param title the name of the node to search
* @return a list with all the nodes with this name
*/
findNodesByTitle<T extends LGraphNode = LGraphNode>(title: string): T[];
/**
* Returns the top-most node in this position of the canvas
* @param x the x coordinate in canvas space
* @param y the y coordinate in canvas space
* @param nodes_list a list with all the nodes to search from, by default is all the nodes in the graph
* @return the node at this position or null
*/
getNodeOnPos<T extends LGraphNode = LGraphNode>(
x: number,
y: number,
node_list?: LGraphNode[],
margin?: number
): T | null;
/**
* Returns the top-most group in that position
* @param x the x coordinate in canvas space
* @param y the y coordinate in canvas space
* @return the group or null
*/
getGroupOnPos(x: number, y: number): LGraphGroup | null;
onAction(action: any, param: any): void;
trigger(action: any, param: any): void;
/** Tell this graph it has a global graph input of this type */
addInput(name: string, type: string, value?: any): void;
/** Assign a data to the global graph input */
setInputData(name: string, data: any): void;
/** Returns the current value of a global graph input */
getInputData<T = any>(name: string): T;
/** Changes the name of a global graph input */
renameInput(old_name: string, name: string): false | undefined;
/** Changes the type of a global graph input */
changeInputType(name: string, type: string): false | undefined;
/** Removes a global graph input */
removeInput(name: string): boolean;
/** Creates a global graph output */
addOutput(name: string, type: string, value: any): void;
/** Assign a data to the global output */
setOutputData(name: string, value: string): void;
/** Returns the current value of a global graph output */
getOutputData<T = any>(name: string): T;
/** Renames a global graph output */
renameOutput(old_name: string, name: string): false | undefined;
/** Changes the type of a global graph output */
changeOutputType(name: string, type: string): false | undefined;
/** Removes a global graph output */
removeOutput(name: string): boolean;
triggerInput(name: string, value: any): void;
setCallback(name: string, func: (...args: any[]) => any): void;
beforeChange(info?: LGraphNode): void;
afterChange(info?: LGraphNode): void;
connectionChange(node: LGraphNode): void;
/** returns if the graph is in live mode */
isLive(): boolean;
/** clears the triggered slot animation in all links (stop visual animation) */
clearTriggeredSlots(): void;
/* Called when something visually changed (not the graph!) */
change(): void;
setDirtyCanvas(fg: boolean, bg: boolean): void;
/** Destroys a link */
removeLink(link_id: number): void;
/** Creates a Object containing all the info about this graph, it can be serialized */
serialize<T extends serializedLGraph>(): T;
/**
* Configure a graph from a JSON string
* @param data configure a graph from a JSON string
* @returns if there was any error parsing
*/
configure(data: object, keep_old?: boolean): boolean | undefined;
load(url: string): void;
}
export type SerializedLLink = [number, string, number, number, number, number];
export declare class LLink {
id: number;
type: string;
origin_id: number;
origin_slot: number;
target_id: number;
target_slot: number;
constructor(
id: number,
type: string,
origin_id: number,
origin_slot: number,
target_id: number,
target_slot: number
);
configure(o: LLink | SerializedLLink): void;
serialize(): SerializedLLink;
// @rgthree
color?: string;
}
export type SerializedLGraphNode<T extends LGraphNode = LGraphNode> = {
id: T["id"];
type: T["type"];
pos: T["pos"];
size: T["size"];
flags: T["flags"];
mode: T["mode"];
inputs: T["inputs"];
outputs: T["outputs"];
title: T["title"];
properties: T["properties"];
widgets_values?: IWidget["value"][];
};
/** https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode */
export declare class LGraphNode {
// @rgthree added
findInputSlotByType(type: string, returnObj?: boolean, preferFreeSlot?: boolean, doNotUseOccupied?: boolean): number
findOutputSlotByType(type: string, returnObj?: boolean, preferFreeSlot?: boolean, doNotUseOccupied?: boolean): number
onShowCustomPanelInfo(panel: HTMLElement): void;
onDblClick?(event: AdjustedMouseEvent, pos: Vector2, canvas: LGraphCanvas): void;
inResizeCorner(x: number, y:number) : boolean;
onWidgetChanged?(widgetName: string, widgetValue: any, oldWidgetValue: any, widget: IWidget): void;
// end @rgthree added
static title_color?: string;
static title: string;
static type: null | string;
static widgets_up: boolean;
constructor(title?: string);
title: string;
// @rgthree - made undefined since ComfyNode does it (even through LiteGraph does not..)
type?: null | string;
size: Vector2;
graph: null | LGraph;
graph_version: number;
pos: Vector2;
is_selected: boolean;
mouseOver: boolean;
// @rgthree - missing.
block_delete: boolean;
id: number;
widgets: IWidget[];
//inputs available: array of inputs
inputs: INodeInputSlot[];
outputs: INodeOutputSlot[];
connections: any[];
// @rgthree
_collapsed_width?: number;
//local data
properties: Record<string, any>;
properties_info: any[];
flags: Partial<{
collapsed: boolean
// @rgthree
allow_interaction: boolean;
// @rgthree
pinned: boolean;
}>;
color: string;
bgcolor: string;
boxcolor: string;
shape:
| typeof LiteGraph.BOX_SHAPE
| typeof LiteGraph.ROUND_SHAPE
| typeof LiteGraph.CIRCLE_SHAPE
| typeof LiteGraph.CARD_SHAPE
| typeof LiteGraph.ARROW_SHAPE;
serialize_widgets: boolean;
skip_list: boolean;
/** Used in `LGraphCanvas.onMenuNodeMode` */
mode?:
| typeof LiteGraph.ON_EVENT
| typeof LiteGraph.ON_TRIGGER
| typeof LiteGraph.NEVER
| typeof LiteGraph.ALWAYS
| 4; // Comfy App "Bypass"
/** If set to true widgets do not start after the slots */
widgets_up: boolean;
/** widgets start at y distance from the top of the node */
widgets_start_y: number;
/** if you render outside the node, it will be clipped */
clip_area: boolean;
/** if set to false it wont be resizable with the mouse */
resizable: boolean;
/** slots are distributed horizontally */
horizontal: boolean;
/** if true, the node will show the bgcolor as 'red' */
has_errors?: boolean;
// @rgthree
setSize(size: Vector2): void;
onResize?(size: Vector2): void;
onInputClick(slot: number, event: MouseEvent): void;
onOutputClick(slot: number, event: MouseEvent): void;
getConnectionPos(isInput: boolean, slotNumber: number, out: Vector2): Vector2;
/** configure a node from an object containing the serialized info */
configure(info: SerializedLGraphNode): void;
/** serialize the content */
serialize(): SerializedLGraphNode;
/** Creates a clone of this node */
clone(): this;
/** serialize and stringify */
toString(): string;
/** get the title string */
getTitle(): string;
/** sets the value of a property */
setProperty(name: string, value: any): void;
/** sets the output data */
setOutputData(slot: number, data: any): void;
/** sets the output data */
setOutputDataType(slot: number, type: string): void;
/**
* Retrieves the input data (data traveling through the connection) from one slot
* @param slot
* @param force_update if set to true it will force the connected node of this slot to output data into this link
* @return data or if it is not connected returns undefined
*/
getInputData<T = any>(slot: number, force_update?: boolean): T;
/**
* Retrieves the input data type (in case this supports multiple input types)
* @param slot
* @return datatype in string format
*/
getInputDataType(slot: number): string;
/**
* Retrieves the input data from one slot using its name instead of slot number
* @param slot_name
* @param force_update if set to true it will force the connected node of this slot to output data into this link
* @return data or if it is not connected returns null
*/
getInputDataByName<T = any>(slot_name: string, force_update?: boolean): T;
/** tells you if there is a connection in one input slot */
isInputConnected(slot: number): boolean;
/** tells you info about an input connection (which node, type, etc) */
getInputInfo(
slot: number
): { link: number; name: string; type: string | 0 } | null;
/** returns the node connected in the input slot */
getInputNode(slot: number): LGraphNode | null;
/** returns the value of an input with this name, otherwise checks if there is a property with that name */
getInputOrProperty<T = any>(name: string): T;
/** tells you the last output data that went in that slot */
getOutputData<T = any>(slot: number): T | null;
/** tells you info about an output connection (which node, type, etc) */
getOutputInfo(
slot: number
): { name: string; type: string; links: number[] } | null;
/** tells you if there is a connection in one output slot */
isOutputConnected(slot: number): boolean;
/** tells you if there is any connection in the output slots */
isAnyOutputConnected(): boolean;
/** retrieves all the nodes connected to this output slot */
getOutputNodes(slot: number): LGraphNode[];
/** Triggers an event in this node, this will trigger any output with the same name */
trigger(action: string, param: any): void;
/**
* Triggers an slot event in this node
* @param slot the index of the output slot
* @param param
* @param link_id in case you want to trigger and specific output link in a slot
*/
triggerSlot(slot: number, param: any, link_id?: number): void;
/**
* clears the trigger slot animation
* @param slot the index of the output slot
* @param link_id in case you want to trigger and specific output link in a slot
*/
clearTriggeredSlot(slot: number, link_id?: number): void;
/**
* add a new property to this node
* @param name
* @param default_value
* @param type string defining the output type ("vec3","number",...)
* @param extra_info this can be used to have special properties of the property (like values, etc)
*/
addProperty<T = any>(
name: string,
default_value: any,
type: string,
extra_info?: object
): T;
/**
* add a new output slot to use in this node
* @param name
* @param type string defining the output type ("vec3","number",...)
* @param extra_info this can be used to have special properties of an output (label, special color, position, etc)
*/
addOutput(
name: string,
type: string | -1,
extra_info?: Partial<INodeOutputSlot>
): INodeOutputSlot;
/**
* add a new output slot to use in this node
* @param array of triplets like [[name,type,extra_info],[...]]
*/
addOutputs(
array: [string, string | -1, Partial<INodeOutputSlot> | undefined][]
): void;
/** remove an existing output slot */
removeOutput(slot: number): void;
/**
* add a new input slot to use in this node
* @param name
* @param type string defining the input type ("vec3","number",...), it its a generic one use 0
* @param extra_info this can be used to have special properties of an input (label, color, position, etc)
*/
addInput(
name: string,
type: string | -1,
extra_info?: Partial<INodeInputSlot>
): INodeInputSlot;
/**
* add several new input slots in this node
* @param array of triplets like [[name,type,extra_info],[...]]
*/
addInputs(
array: [string, string | -1, Partial<INodeInputSlot> | undefined][]
): void;
/** remove an existing input slot */
removeInput(slot: number): void;
/**
* add an special connection to this node (used for special kinds of graphs)
* @param name
* @param type string defining the input type ("vec3","number",...)
* @param pos position of the connection inside the node
* @param direction if is input or output
*/
addConnection(
name: string,
type: string,
pos: Vector2,
direction: string
): {
name: string;
type: string;
pos: Vector2;
direction: string;
links: null;
};
setValue(v: any): void;
/** computes the size of a node according to its inputs and output slots */
computeSize(out?: Vector2): [number, number];
/**
* https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#node-widgets
* @return created widget
*/
addWidget<T extends IWidget>(
type: T["type"],
name: string,
value: T["value"],
// @rgthree
callback?: T["callback"] | string,//WidgetCallback<T> | string,
options?: T["options"]
): T;
addCustomWidget<T extends IWidget>(customWidget: T): T;
/**
* returns the bounding of the object, used for rendering purposes
* @return [x, y, width, height]
*/
getBounding(): Vector4;
/** checks if a point is inside the shape of a node */
isPointInside(
x: number,
y: number,
margin?: number,
skipTitle?: boolean
): boolean;
/** checks if a point is inside a node slot, and returns info about which slot */
getSlotInPosition(
x: number,
y: number
): {
input?: INodeInputSlot;
output?: INodeOutputSlot;
slot: number;
link_pos: Vector2;
};
/**
* returns the input slot with a given name (used for dynamic slots), -1 if not found
* @param name the name of the slot
* @return the slot (-1 if not found)
*/
findInputSlot(name: string): number;
/**
* returns the output slot with a given name (used for dynamic slots), -1 if not found
* @param name the name of the slot
* @return the slot (-1 if not found)
*/
findOutputSlot(name: string): number;
/**
* connect this node output to the input of another node
* @param slot (could be the number of the slot or the string with the name of the slot)
* @param targetNode the target node
* @param targetSlot the input slot of the target node (could be the number of the slot or the string with the name of the slot, or -1 to connect a trigger)
* @return {Object} the link_info is created, otherwise null
*/
connect<T = any>(
slot: number | string,
targetNode: LGraphNode,
targetSlot: number | string
): T | null;
connectByTypeOutput<T = any>(
slot: number | string,
sourceNode: LGraphNode,
sourceSlotType: string,
optsIn: string
): T | null;
connectByType<T = any>(
slot: number | string,
sourceNode: LGraphNode,
sourceSlotType: string,
optsIn: string
): T | null;
/**
* disconnect one output to an specific node
* @param slot (could be the number of the slot or the string with the name of the slot)
* @param target_node the target node to which this slot is connected [Optional, if not target_node is specified all nodes will be disconnected]
* @return if it was disconnected successfully
*/
disconnectOutput(slot: number | string, targetNode?: LGraphNode): boolean;
/**
* disconnect one input
* @param slot (could be the number of the slot or the string with the name of the slot)
* @return if it was disconnected successfully
*/
disconnectInput(slot: number | string): boolean;
/**
* returns the center of a connection point in canvas coords
* @param is_input true if if a input slot, false if it is an output
* @param slot (could be the number of the slot or the string with the name of the slot)
* @param out a place to store the output, to free garbage
* @return the position
**/
getConnectionPos(
is_input: boolean,
slot: number | string,
out?: Vector2
): Vector2;
/** Force align to grid */
alignToGrid(): void;
/** Console output */
trace(msg: string): void;
/** Forces to redraw or the main canvas (LGraphNode) or the bg canvas (links) */
setDirtyCanvas(fg: boolean, bg: boolean): void;
loadImage(url: string): void;
/** Allows to get onMouseMove and onMouseUp events even if the mouse is out of focus */
captureInput(v: any): void;
/** Collapse the node to make it smaller on the canvas */
collapse(force: boolean): void;
/** Forces the node to do not move or realign on Z */
pin(v?: boolean): void;
localToScreen(x: number, y: number, graphCanvas: LGraphCanvas): Vector2;
// https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#custom-node-appearance
onDrawBackground?(
ctx: CanvasRenderingContext2D,
// @rgthree fixed
canvas: LGraphCanvas
): void;
onDrawForeground?(
ctx: CanvasRenderingContext2D,
// @rgthree fixed
canvas: LGraphCanvas
): void;
// https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#custom-node-behaviour
onMouseDown?(
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onMouseMove?(
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onMouseUp?(
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onMouseEnter?(
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onMouseLeave?(
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onKey?(event: KeyboardEvent, pos: Vector2, graphCanvas: LGraphCanvas): void;
// @rgthree
onKeyDown?(event: KeyboardEvent): void;
// @rgthree
onKeyUp?(event: KeyboardEvent): void;
onExecuted(message: any): void;
/** Called by `LGraphNode.createNode` */
onNodeCreated?(): void;
/** Called by `LGraphCanvas.selectNodes` */
onSelected?(): void;
/** Called by `LGraphCanvas.deselectNode` */
onDeselected?(): void;
/** Called by `LGraph.runStep` `LGraphNode.getInputData` */
onExecute?(): void;
/** Called by `LGraph.serialize` */
onSerialize?(o: SerializedLGraphNode): void;
/** Called by `LGraph.configure` */
onConfigure?(o: SerializedLGraphNode): void;
/**
* when added to graph (warning: this is called BEFORE the node is configured when loading)
* Called by `LGraph.add`
*/
onAdded?(graph: LGraph): void;
/**
* when removed from graph
* Called by `LGraph.remove` `LGraph.clear`
*/
onRemoved?(): void;
/**
* if returns false the incoming connection will be canceled
* Called by `LGraph.connect`
* @param inputIndex target input slot number
* @param outputType type of output slot
* @param outputSlot output slot object
* @param outputNode node containing the output
* @param outputIndex index of output slot
*/
onConnectInput?(
inputIndex: number,
outputType: INodeOutputSlot["type"],
outputSlot: INodeOutputSlot,
outputNode: LGraphNode,
outputIndex: number
): boolean;
/**
* if returns false the incoming connection will be canceled
* Called by `LGraph.connect`
* @param outputIndex target output slot number
* @param inputType type of input slot
* @param inputSlot input slot object
* @param inputNode node containing the input
* @param inputIndex index of input slot
*/
onConnectOutput?(
outputIndex: number,
inputType: INodeInputSlot["type"],
inputSlot: INodeInputSlot,
inputNode: LGraphNode,
inputIndex: number
): boolean;
/**
* Called just before connection (or disconnect - if input is linked).
* A convenient place to switch to another input, or create new one.
* This allow for ability to automatically add slots if needed
* @param inputIndex
* @return selected input slot index, can differ from parameter value
*/
onBeforeConnectInput?(
inputIndex: number
): number;
/** a connection changed (new one or removed) (LiteGraph.INPUT or LiteGraph.OUTPUT, slot, true if connected, link_info, input_info or output_info ) */
onConnectionsChange(
type: number,
slotIndex: number,
isConnected: boolean,
link: LLink,
// @rgthree - Make it INodeSlot instead of union
ioSlot: INodeSlot
): void;
/**
* if returns false, will abort the `LGraphNode.setProperty`
* Called when a property is changed
* @param property
* @param value
* @param prevValue
*/
onPropertyChanged?(property: string, value: any, prevValue: any): void | boolean;
/** Called by `LGraphCanvas.processContextMenu` */
getMenuOptions?(graphCanvas: LGraphCanvas): ContextMenuItem[];
// @rgthree. This is fixed because the INodeSlot is wrong and, also, null can be returned to not trigger a menu.
// getSlotMenuOptions?(slot: INodeSlot): ContextMenuItem[];
getSlotMenuOptions(slot: {input?: INodeInputSlot, output?: INodeOutputSlot}): ContextMenuItem[] | null;
getExtraMenuOptions?(canvas: LGraphCanvas, options: ContextMenuItem[]): void;
// @rgthree - Called in LiteGraph.core when the properties panel is constructed.
onShowCustomPanelInfo(panel: HTMLElement): void;
}
export type LGraphNodeConstructor<T extends LGraphNode = LGraphNode> = {
new (): T;
// @rgthree
title_mode?:
typeof LiteGraph.NORMAL_TITLE |
typeof LiteGraph.TRANSPARENT_TITLE |
typeof LiteGraph.AUTOHIDE_TITLE |
typeof LiteGraph.NO_TITLE;
title: string;
category: string;
type: string;
comfyClass?: string;
};
export type SerializedLGraphGroup = {
title: LGraphGroup["title"];
bounding: LGraphGroup["_bounding"];
color: LGraphGroup["color"];
font: LGraphGroup["font"];
};
export declare class LGraphGroup {
title: string;
// @rgthree - mark unprivate
_bounding: Vector4;
// @rgthree - updated to make optional because it seems to be so.
color?: string|null;
font: string;
// @rgthree
_nodes: LGraphNode[];
// @rgthree
_pos: Vector2;
// @rgthree
_size: Vector2;
// @rgthree
graph: LGraph;
// @rgthree - apparently it is available?
size: Vector2;
// @rgthree - apparently it is available?
pos: Vector2;
configure(o: SerializedLGraphGroup): void;
serialize(): SerializedLGraphGroup;
move(deltaX: number, deltaY: number, ignoreNodes?: boolean): void;
recomputeInsideNodes(): void;
isPointInside: LGraphNode["isPointInside"];
setDirtyCanvas: LGraphNode["setDirtyCanvas"];
}
export declare class DragAndScale {
constructor(element?: HTMLElement, skipEvents?: boolean);
offset: [number, number];
scale: number;
max_scale: number;
min_scale: number;
onredraw: Function | null;
enabled: boolean;
last_mouse: Vector2;
element: HTMLElement | null;
visible_area: Vector4;
bindEvents(element: HTMLElement): void;
computeVisibleArea(): void;
onMouse(e: MouseEvent): void;
toCanvasContext(ctx: CanvasRenderingContext2D): void;
convertOffsetToCanvas(pos: Vector2): Vector2;
convertCanvasToOffset(pos: Vector2): Vector2;
mouseDrag(x: number, y: number): void;
changeScale(value: number, zooming_center?: Vector2): void;
changeDeltaScale(value: number, zooming_center?: Vector2): void;
reset(): void;
}
// @rgthree.
interface CanvasDivDialog extends HTMLDivElement {
close: () => void;
modified: () => void;
is_modified: boolean;
}
/**
* This class is in charge of rendering one graph inside a canvas. And provides all the interaction required.
* Valid callbacks are: onNodeSelected, onNodeDeselected, onShowNodePanel, onNodeDblClicked
*
* @param canvas the canvas where you want to render (it accepts a selector in string format or the canvas element itself)
* @param graph
* @param options { skip_rendering, autoresize }
*/
export declare class LGraphCanvas {
static node_colors: Record<
string,
{
color: string;
bgcolor: string;
groupcolor: string;
}
>;
static link_type_colors: Record<string, string>;
static gradients: object;
static search_limit: number;
static getFileExtension(url: string): string;
static decodeHTML(str: string): string;
static onMenuCollapseAll(): void;
static onMenuNodeEdit(): void;
static onShowPropertyEditor(
item: any,
options: any,
e: any,
menu: any,
node: any
): void;
/** Create menu for `Add Group` */
static onGroupAdd: ContextMenuEventListener;
/** Create menu for `Add Node` */
static onMenuAdd: ContextMenuEventListener;
static showMenuNodeOptionalInputs: ContextMenuEventListener;
static showMenuNodeOptionalOutputs: ContextMenuEventListener;
static onShowMenuNodeProperties: ContextMenuEventListener;
static onResizeNode: ContextMenuEventListener;
static onMenuNodeCollapse: ContextMenuEventListener;
static onMenuNodePin: ContextMenuEventListener;
static onMenuNodeMode: ContextMenuEventListener;
static onMenuNodeColors: ContextMenuEventListener;
static onMenuNodeShapes: ContextMenuEventListener;
static onMenuNodeRemove: ContextMenuEventListener;
static onMenuNodeClone: ContextMenuEventListener;
// @rgthree
static onShowPropertyEditor: ContextMenuEventListener;
constructor(
canvas: HTMLCanvasElement | string,
graph?: LGraph,
options?: {
skip_render?: boolean;
autoresize?: boolean;
}
);
// @rgthree. This was "HTMLCanvasElement" but that is just wrong... it's LGraphCanvas
static active_canvas: LGraphCanvas;
// @rgthree
pointer_is_down: boolean;
allow_dragcanvas: boolean;
allow_dragnodes: boolean;
/** allow to control widgets, buttons, collapse, etc */
allow_interaction: boolean;
/** allows to change a connection with having to redo it again */
allow_reconnect_links: boolean;
/** allow selecting multi nodes without pressing extra keys */
multi_select: boolean;
/** No effect */
allow_searchbox: boolean;
always_render_background: boolean;
autoresize?: boolean;
background_image: string;
bgcanvas: HTMLCanvasElement;
bgctx: CanvasRenderingContext2D;
canvas: HTMLCanvasElement;
canvas_mouse: Vector2;
// @rgthree - Looks like this is to replace canvas_mouse.
graph_mouse: Vector2;
clear_background: boolean;
// connecting_node: LGraphNode | null;
// // @rgthree - for overriding.
// _connecting_node: LGraphNode | null;
// @rgthree
// connecting_input: INodeInputSlot | null;
// // @rgthree
// connecting_output: INodeOutputSlot | null;
// // @rgthree
// connecting_slot: number;
// // @rgthree
// connecting_pos: Vector2 | null;
// @rgthree - for some reason, the new comfyUI update renamed connecting_node to connecting_links (maybe)
connecting_links: {
node: LGraphNode, input?: INodeInputSlot, output?: INodeOutputSlot, pos: Vector2, slot: number
}[] | null;
_connecting_links: this['connecting_links'] | null;
connections_width: number;
ctx: CanvasRenderingContext2D;
current_node: LGraphNode | null;
default_connection_color: {
input_off: string;
input_on: string;
output_off: string;
output_on: string;
};
default_link_color: string;
dirty_area: Vector4 | null;
dirty_bgcanvas?: boolean;
dirty_canvas?: boolean;
drag_mode: boolean;
dragging_canvas: boolean;
dragging_rectangle: Vector4 | null;
// @rgthree; mark undefined.
// It doesn't look like this should ever be undefined.. but something changed in Comfy and folks
// reported https://github.com/rgthree/rgthree-comfy/issues/71. I couldn't reproduce, but we can
// handle it.
ds?: DragAndScale;
/** used for transition */
editor_alpha: number;
filter: any;
fps: number;
frame: number;
graph: LGraph;
highlighted_links: Record<number, boolean>;
highquality_render: boolean;
inner_text_font: string;
is_rendering: boolean;
last_draw_time: number;
last_mouse: Vector2;
/**
* Possible duplicated with `last_mouse`
* https://github.com/jagenjo/litegraph.js/issues/70
*/
last_mouse_position: Vector2;
/** Timestamp of last mouse click, defaults to 0 */
last_mouseclick: number;
links_render_mode:
| typeof LiteGraph.STRAIGHT_LINK
| typeof LiteGraph.LINEAR_LINK
| typeof LiteGraph.SPLINE_LINK;
live_mode: boolean;
node_capturing_input: LGraphNode | null;
node_dragged: LGraphNode | null;
node_in_panel: LGraphNode | null;
node_over: LGraphNode | null;
node_title_color: string;
node_widget: [LGraphNode, IWidget] | null;
/** Called by `LGraphCanvas.drawBackCanvas` */
onDrawBackground:
| ((ctx: CanvasRenderingContext2D, visibleArea: Vector4) => void)
| null;
/** Called by `LGraphCanvas.drawFrontCanvas` */
onDrawForeground:
| ((ctx: CanvasRenderingContext2D, visibleArea: Vector4) => void)
| null;
onDrawOverlay: ((ctx: CanvasRenderingContext2D) => void) | null;
/** Called by `LGraphCanvas.processMouseDown` */
onMouse: ((event: MouseEvent) => boolean) | null;
/** Called by `LGraphCanvas.drawFrontCanvas` and `LGraphCanvas.drawLinkTooltip` */
onDrawLinkTooltip: ((ctx: CanvasRenderingContext2D, link: LLink, _this: this) => void) | null;
/** Called by `LGraphCanvas.selectNodes` */
onNodeMoved: ((node: LGraphNode) => void) | null;
/** Called by `LGraphCanvas.processNodeSelected` */
onNodeSelected: ((node: LGraphNode) => void) | null;
/** Called by `LGraphCanvas.deselectNode` */
onNodeDeselected: ((node: LGraphNode) => void) | null;
/** Called by `LGraphCanvas.processNodeDblClicked` */
onShowNodePanel: ((node: LGraphNode) => void) | null;
/** Called by `LGraphCanvas.processNodeDblClicked` */
onNodeDblClicked: ((node: LGraphNode) => void) | null;
/** Called by `LGraphCanvas.selectNodes` */
onSelectionChange: ((nodes: Record<number, LGraphNode>) => void) | null;
/** Called by `LGraphCanvas.showSearchBox` */
onSearchBox:
| ((
helper: Element,
value: string,
graphCanvas: LGraphCanvas
) => string[])
| null;
onSearchBoxSelection:
| ((name: string, event: MouseEvent, graphCanvas: LGraphCanvas) => void)
| null;
pause_rendering: boolean;
render_canvas_border: boolean;
render_collapsed_slots: boolean;
render_connection_arrows: boolean;
render_connections_border: boolean;
render_connections_shadows: boolean;
render_curved_connections: boolean;
render_execution_order: boolean;
render_only_selected: boolean;
render_shadows: boolean;
render_title_colored: boolean;
round_radius: number;
selected_group: null | LGraphGroup;
selected_group_resizing: boolean;
selected_nodes: Record<number, LGraphNode>;
show_info: boolean;
title_text_font: string;
/** set to true to render title bar with gradients */
use_gradients: boolean;
visible_area: DragAndScale["visible_area"];
visible_links: LLink[];
visible_nodes: LGraphNode[];
zoom_modify_alpha: boolean;
/** clears all the data inside */
clear(): void;
/** assigns a graph, you can reassign graphs to the same canvas */
setGraph(graph: LGraph, skipClear?: boolean): void;
/** opens a graph contained inside a node in the current graph */
openSubgraph(graph: LGraph): void;
/** closes a subgraph contained inside a node */
closeSubgraph(): void;
/** assigns a canvas */
setCanvas(canvas: HTMLCanvasElement, skipEvents?: boolean): void;
/** binds mouse, keyboard, touch and drag events to the canvas */
bindEvents(): void;
/** unbinds mouse events from the canvas */
unbindEvents(): void;
/**
* this function allows to render the canvas using WebGL instead of Canvas2D
* this is useful if you plant to render 3D objects inside your nodes, it uses litegl.js for webgl and canvas2DtoWebGL to emulate the Canvas2D calls in webGL
**/
enableWebGL(): void;
/**
* marks as dirty the canvas, this way it will be rendered again
* @param fg if the foreground canvas is dirty (the one containing the nodes)
* @param bg if the background canvas is dirty (the one containing the wires)
*/
setDirty(fg: boolean, bg: boolean): void;
/**
* Used to attach the canvas in a popup
* @return the window where the canvas is attached (the DOM root node)
*/
getCanvasWindow(): Window;
/** starts rendering the content of the canvas when needed */
startRendering(): void;
/** stops rendering the content of the canvas (to save resources) */
stopRendering(): void;
processMouseDown(e: MouseEvent): boolean | undefined;
processMouseMove(e: MouseEvent): boolean | undefined;
processMouseUp(e: MouseEvent): boolean | undefined;
processMouseWheel(e: MouseEvent): boolean | undefined;
/** returns true if a position (in graph space) is on top of a node little corner box */
isOverNodeBox(node: LGraphNode, canvasX: number, canvasY: number): boolean;
/** returns true if a position (in graph space) is on top of a node input slot */
isOverNodeInput(
node: LGraphNode,
canvasX: number,
canvasY: number,
slotPos: Vector2
): boolean;
/** process a key event */
processKey(e: KeyboardEvent): boolean | undefined;
// @rgthree - added param
copyToClipboard(nodes: LGraphNode[]|{[key:number]:LGraphNode}): void;
pasteFromClipboard(): void;
processDrop(e: DragEvent): void;
checkDropItem(e: DragEvent): void;
processNodeDblClicked(n: LGraphNode): void;
processNodeSelected(n: LGraphNode, e: MouseEvent): void;
processNodeDeselected(node: LGraphNode): void;
/** selects a given node (or adds it to the current selection) */
selectNode(node: LGraphNode, add?: boolean): void;
/** selects several nodes (or adds them to the current selection) */
selectNodes(nodes?: LGraphNode[], add?: boolean): void;
/** removes a node from the current selection */
deselectNode(node: LGraphNode): void;
/** removes all nodes from the current selection */
deselectAllNodes(): void;
/** deletes all nodes in the current selection from the graph */
deleteSelectedNodes(): void;
/** centers the camera on a given node */
// @rgthree - narrow parameter
centerOnNode(node: {pos: Vector2, size: Vector2}): void;
/** changes the zoom level of the graph (default is 1), you can pass also a place used to pivot the zoom */
setZoom(value: number, center: Vector2): void;
/** brings a node to front (above all other nodes) */
bringToFront(node: LGraphNode): void;
/** sends a node to the back (below all other nodes) */
sendToBack(node: LGraphNode): void;
/** checks which nodes are visible (inside the camera area) */
computeVisibleNodes(nodes: LGraphNode[]): LGraphNode[];
/** renders the whole canvas content, by rendering in two separated canvas, one containing the background grid and the connections, and one containing the nodes) */
draw(forceFG?: boolean, forceBG?: boolean): void;
/** draws the front canvas (the one containing all the nodes) */
drawFrontCanvas(): void;
/** draws some useful stats in the corner of the canvas */
renderInfo(ctx: CanvasRenderingContext2D, x: number, y: number): void;
/** draws the back canvas (the one containing the background and the connections) */
drawBackCanvas(): void;
/** draws the given node inside the canvas */
drawNode(node: LGraphNode, ctx: CanvasRenderingContext2D): void;
/** draws graphic for node's slot */
drawSlotGraphic(ctx: CanvasRenderingContext2D, pos: number[], shape: SlotShape, horizontal: boolean): void;
/** draws the shape of the given node in the canvas */
drawNodeShape(
node: LGraphNode,
ctx: CanvasRenderingContext2D,
size: [number, number],
fgColor: string,
bgColor: string,
selected: boolean,
mouseOver: boolean
): void;
/** draws every connection visible in the canvas */
drawConnections(ctx: CanvasRenderingContext2D): void;
/**
* draws a link between two points
* @param a start pos
* @param b end pos
* @param link the link object with all the link info
* @param skipBorder ignore the shadow of the link
* @param flow show flow animation (for events)
* @param color the color for the link
* @param startDir the direction enum
* @param endDir the direction enum
* @param numSublines number of sublines (useful to represent vec3 or rgb)
**/
renderLink(
a: Vector2,
b: Vector2,
link: object,
skipBorder: boolean,
flow: boolean,
color?: string,
startDir?: number,
endDir?: number,
numSublines?: number
): void;
computeConnectionPoint(
a: Vector2,
b: Vector2,
t: number,
startDir?: number,
endDir?: number
): void;
drawExecutionOrder(ctx: CanvasRenderingContext2D): void;
/** draws the widgets stored inside a node */
drawNodeWidgets(
node: LGraphNode,
posY: number,
ctx: CanvasRenderingContext2D,
activeWidget: object
): void;
/** process an event on widgets */
processNodeWidgets(
node: LGraphNode,
pos: Vector2,
event: Event,
activeWidget: object
): void;
/** draws every group area in the background */
drawGroups(canvas: any, ctx: CanvasRenderingContext2D): void;
adjustNodesSize(): void;
/** resizes the canvas to a given size, if no size is passed, then it tries to fill the parentNode */
resize(width?: number, height?: number): void;
/**
* switches to live mode (node shapes are not rendered, only the content)
* this feature was designed when graphs where meant to create user interfaces
**/
switchLiveMode(transition?: boolean): void;
onNodeSelectionChange(): void;
touchHandler(event: TouchEvent): void;
showLinkMenu(link: LLink, e: any): false;
prompt(
title: string,
value: any,
callback: Function,
event: any
): HTMLDivElement;
showSearchBox(event?: MouseEvent): void;
showEditPropertyValue(node: LGraphNode, property: any, options: any): void;
createDialog(
html: string,
options?: { position?: Vector2; event?: MouseEvent }
// @rgthree - Fix return type from void (added above)
): CanvasDivDialog;
convertOffsetToCanvas: DragAndScale["convertOffsetToCanvas"];
convertCanvasToOffset: DragAndScale["convertCanvasToOffset"];
/** converts event coordinates from canvas2D to graph coordinates */
// @rgthree - change MouseEvent to less restrictive {clientX: number, clientY: number} that
// implementation uses.
convertEventToCanvasOffset(e: {clientX: number, clientY: number}): Vector2;
/** adds some useful properties to a mouse event, like the position in graph coordinates */
adjustMouseEvent(e: MouseEvent): void;
getCanvasMenuOptions(): ContextMenuItem[];
getNodeMenuOptions(node: LGraphNode): ContextMenuItem[];
getGroupMenuOptions(): ContextMenuItem[];
/** Called by `getCanvasMenuOptions`, replace default options */
getMenuOptions?(): ContextMenuItem[];
/** Called by `getCanvasMenuOptions`, append to default options */
getExtraMenuOptions?(): ContextMenuItem[];
/** Called when mouse right click */
processContextMenu(node: LGraphNode, event: Event): void;
// @rgthree - Adding this for ComfyUI, since they add this in their own overload in app.js
selected_group_moving?: boolean;
// @rgthree
showShowNodePanel(node: LGraphNode): void;
}
// @rgthree - The adjusted pointer event after calling adjustMouseEvent
export interface AdjustedMouseEvent extends PointerEvent {
deltaX: number;
deltaY: number;
canvasX: number;
canvasY: number;
}
declare class ContextMenu {
static trigger(
element: HTMLElement,
event_name: string,
params: any,
origin: any
): void;
static isCursorOverElement(event: MouseEvent, element: HTMLElement): void;
static closeAllContextMenus(window: Window): void;
constructor(values: ContextMenuItem[]|string[], options?: IContextMenuOptions, window?: Window);
options: IContextMenuOptions;
parentMenu?: ContextMenu;
lock: boolean;
current_submenu?: ContextMenu;
addItem(
name: string,
value: ContextMenuItem,
options?: IContextMenuOptions
): void;
close(e?: MouseEvent, ignore_parent_menu?: boolean): void;
getTopMenu(): void;
getFirstEvent(): void;
}
declare global {
interface Math {
clamp(v: number, min: number, max: number): number;
}
}1234import type { TLGraphNode } from './comfy/index.js';
import { ComfyApp } from './comfy/index.js';
export declare const commonPrefix = "\uD83E\uDE9B";
export declare function displayContext(nodeType: TLGraphNode, appFromArg: ComfyApp, index?: number, serialize_widgets?: boolean, isVirtualNode?: boolean): void;1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950import { ComfyWidgets } from './comfy/index.js';
export const commonPrefix = '🪛';
export function displayContext(nodeType, appFromArg, index = 0, serialize_widgets = false, isVirtualNode = false) {
function populate(text) {
if (this.widgets) {
const pos = this.widgets.findIndex((w) => w.name === 'text');
if (pos !== -1) {
for (let i = pos; i < this.widgets.length; i++) {
this.widgets[i]?.onRemove?.();
}
this.widgets.length = pos;
}
}
this.serialize_widgets = serialize_widgets;
this.isVirtualNode = isVirtualNode;
const widget = ComfyWidgets.STRING(this, 'text', [
'STRING', { multiline: true },
], appFromArg).widget;
widget.inputEl.readOnly = true;
widget.inputEl.style.opacity = 0.6;
if (Array.isArray(text) && index !== undefined && text[index] !== undefined) {
text = text[index];
}
widget.value = text || '';
widget.serializeValue = async () => { };
requestAnimationFrame(() => {
const sz = this.computeSize();
if (sz[0] < this.size[0]) {
sz[0] = this.size[0];
}
if (sz[1] < this.size[1]) {
sz[1] = this.size[1];
}
this.onResize?.(sz);
appFromArg.graph.setDirtyCanvas(true, false);
});
}
const onExecutedOriginal = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function (message) {
onExecutedOriginal?.apply(this, arguments);
populate.call(this, message.text);
};
const onConfigureOriginal = nodeType.prototype.onConfigure;
nodeType.prototype.onConfigure = function () {
onConfigureOriginal?.apply(this, arguments);
if (this.widgets_values?.length) {
populate.call(this, this.widgets_values);
}
};
}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192import type { TLGraphNode } from './comfy/index.js';
import { ComfyWidgets, ComfyApp } from './comfy/index.js';
export const commonPrefix = '🪛';
export function displayContext(
nodeType: TLGraphNode,
appFromArg: ComfyApp,
index = 0, serialize_widgets = false, isVirtualNode = false,
): void {
function populate(this: TLGraphNode, text: string | string[]): void {
if (this.widgets) {
const pos = this.widgets.findIndex((w) => w.name === 'text');
if (pos !== -1) {
for (let i = pos; i < this.widgets.length; i++) {
this.widgets[i]?.onRemove?.();
}
this.widgets.length = pos;
}
}
// If you want to do not save properties in the node (be careful with F5)
// BUG on isVirtualNode, with "true", it ignores OUTPUT_NODE on py file!
this.serialize_widgets = serialize_widgets;
this.isVirtualNode = isVirtualNode;
const widget = ComfyWidgets.STRING(this, 'text', [
'STRING', { multiline: true },
], appFromArg).widget;
widget.inputEl.readOnly = true;
widget.inputEl.style.opacity = 0.6;
if (Array.isArray(text) && index !== undefined && text[index] !== undefined) {
// @ts-ignore
text = text[index];
}
widget.value = text || '';
// eslint-disable-next-line @typescript-eslint/no-empty-function
widget.serializeValue = async(): Promise<void> => {}; // just for no serialized to itself!
requestAnimationFrame(() => {
const sz = this.computeSize();
if (sz[0] < this.size[0]) {
sz[0] = this.size[0];
}
if (sz[1] < this.size[1]) {
sz[1] = this.size[1];
}
this.onResize?.(sz);
appFromArg.graph.setDirtyCanvas(true, false);
});
}
// When the node is executed we will be sent the input text, display this in the widget
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/unbound-method
const onExecutedOriginal = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function(message: { text: string }): void {
// @ts-ignore
onExecutedOriginal?.apply(this, arguments);
populate.call(this, message.text);
};
// eslint-disable-next-line @typescript-eslint/unbound-method
const onConfigureOriginal = nodeType.prototype.onConfigure;
nodeType.prototype.onConfigure = function(): void {
// @ts-ignore
onConfigureOriginal?.apply(this, arguments);
if (this.widgets_values?.length) {
populate.call(this, this.widgets_values);
}
};
}
// propagate the output value to the dependents nodes, it does not work with some nodes ¯\_(ツ)_/¯
// const propagateOutputToDependentsNodes = function(output: serializedLGraph, value: string) {
// if (output.links?.length) {
// for (const l of output.links) {
// const link_info = app.graph.links[l];
// const outNode = app.graph.getNodeById(link_info.target_id);
// const outIn = outNode?.inputs?.[link_info.target_slot];
// if (outIn.widget) {
// const widget = outNode.widgets.find((w: IWidget) => w.name === outIn.widget.name);
// if (!widget) {
// continue;
// }
// widget.value = value;
// }
// }
// }
// };1export {};1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677import { app, api, ComfyWidgets, LiteGraph, TLGraphNode } from './comfy/index.js';
import { commonPrefix, displayContext } from './common.js';
app.registerExtension({
name: 'Crystools.Debugger.ConsoleAny',
beforeRegisterNodeDef(nodeType, nodeData, appFromArg) {
if (nodeData.name === 'Show any [Crystools]') {
displayContext(nodeType, appFromArg, 3);
}
},
});
app.registerExtension({
name: 'Crystools.Debugger.Metadata',
registerCustomNodes() {
class MetadataNode extends TLGraphNode {
constructor() {
super(`${commonPrefix} Show Metadata `);
Object.defineProperty(this, "fillMetadataWidget", {
enumerable: true,
configurable: true,
writable: true,
value: () => {
return app.graphToPrompt()
.then((workflow) => {
let result = 'inactive';
if (this.widgets?.length !== 4) {
console.error('Something is wrong with the widgets, should be 4!');
return 'error';
}
const output = this.widgets[0];
const active = this.widgets[1]?.value;
const parsed = this.widgets[2]?.value;
let what = this.widgets[3]?.value.toLowerCase();
if (active) {
what = what === 'prompt' ? 'output' : what;
result = workflow[what];
if (parsed) {
result = JSON.stringify(result, null, 2);
}
else {
result = JSON.stringify(result);
}
}
if (output) {
output.value = result;
}
else {
console.error('Something is wrong with the widgets, output is undefined!');
return 'error';
}
return result;
});
}
});
this.serialize_widgets = false;
this.isVirtualNode = true;
const widget = ComfyWidgets.STRING(this, '', [
'', { default: '', multiline: true },
], app).widget;
widget.inputEl.readOnly = true;
ComfyWidgets.BOOLEAN(this, 'Active', [
'', { default: true },
]);
ComfyWidgets.BOOLEAN(this, 'Parsed', [
'', { default: true },
]);
ComfyWidgets.COMBO(this, 'What', [
['Prompt', 'Workflow'], { default: 'Prompt' },
]);
api.addEventListener('executed', this.fillMetadataWidget, false);
}
}
LiteGraph.registerNodeType('Show Metadata [Crystools]', MetadataNode);
MetadataNode.category = `crystools ${commonPrefix}/Debugger`;
MetadataNode.shape = LiteGraph.BOX_SHAPE;
MetadataNode.title = `${commonPrefix} Show Metadata`;
},
});1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586import type { ComfyNode } from './comfy/index.js';
import { app, api, ComfyWidgets, LiteGraph, TLGraphNode, ComfyApp } from './comfy/index.js';
import { commonPrefix, displayContext } from './common.js';
// "Show any" Node
app.registerExtension({
name: 'Crystools.Debugger.ConsoleAny',
beforeRegisterNodeDef(nodeType: ComfyNode, nodeData: TLGraphNode, appFromArg: ComfyApp) {
if (nodeData.name === 'Show any [Crystools]') {
// 3 is the index of the text field in the node
displayContext(nodeType, appFromArg, 3);
}
},
});
app.registerExtension({
name: 'Crystools.Debugger.Metadata',
registerCustomNodes() {
class MetadataNode extends TLGraphNode {
constructor() {
super(`${commonPrefix} Show Metadata `);
this.serialize_widgets = false;
this.isVirtualNode = true;
const widget = ComfyWidgets.STRING(this, '', [
'', {default: '', multiline: true},
], app).widget;
widget.inputEl.readOnly = true;
ComfyWidgets.BOOLEAN(this, 'Active', [
'', {default: true},
]);
ComfyWidgets.BOOLEAN(this, 'Parsed', [
'', {default: true},
]);
ComfyWidgets.COMBO(this, 'What', [
['Prompt', 'Workflow'], {default: 'Prompt'},
]);
// It runs at finish on each prompt queue
api.addEventListener('executed', this.fillMetadataWidget, false);
}
fillMetadataWidget = (): Promise<string> => {
return app.graphToPrompt()
.then((workflow: any): string => {
let result = 'inactive';
if (this.widgets?.length !== 4) {
console.error('Something is wrong with the widgets, should be 4!');
return 'error';
}
const output = this.widgets[0];
const active = this.widgets[1]?.value;
const parsed = this.widgets[2]?.value;
let what = this.widgets[3]?.value.toLowerCase();
if (active) {
what = what === 'prompt' ? 'output' : what; // little fix for better understanding
// @ts-ignore
result = workflow[what];
if (parsed) {
result = JSON.stringify(result, null, 2);
} else {
result = JSON.stringify(result);
}
}
if (output) {
output.value = result;
} else {
console.error('Something is wrong with the widgets, output is undefined!');
return 'error';
}
return result;
});
};
}
// I'm not sure for what they're using prototype and lots of black magic, don't change the order!
LiteGraph.registerNodeType('Show Metadata [Crystools]', MetadataNode);
MetadataNode.category = `crystools ${commonPrefix}/Debugger`;
MetadataNode.shape = LiteGraph.BOX_SHAPE;
MetadataNode.title = `${commonPrefix} Show Metadata`;
// MetadataNode.collapsable = false;
// MetadataNode.color = '#FF2222';
// MetadataNode.bgcolor = '#000000';
},
});1export {};1234567891011121314151617181920212223242526272829303132import { app } from './comfy/index.js';
import { displayContext } from './common.js';
const crystoolsExtensionsSerialized = {
'Read JSON file [Crystools]': 'Crystools.Utils.ReadJsonFile',
'JSON extractor [Crystools]': 'Crystools.Utils.JsonExtractor',
};
const crystoolsExtensions = {
'Get resolution [Crystools]': 'Crystools.Image.GetResolution',
'Preview from image [Crystools]': 'Crystools.Image.PreviewFromImage',
'Preview from metadata [Crystools]': 'Crystools.Image.PreviewFromMetadata',
'Metadata comparator [Crystools]': 'Crystools.Metadata.MetadataComparator',
'Stats system [Crystools]': 'Crystools.Utils.StatsSystem',
'Show any to JSON [Crystools]': 'Crystools.Debugger.ConsoleAnyToJson',
};
Object.keys(crystoolsExtensionsSerialized).forEach(prop => {
crystoolsExtensions[prop] = crystoolsExtensionsSerialized[prop];
});
Object.keys(crystoolsExtensions).forEach(key => {
app.registerExtension({
name: crystoolsExtensions[key],
beforeRegisterNodeDef(nodeType, nodeData, appFromArg) {
if (nodeData.name === key) {
if (nodeData.name in crystoolsExtensionsSerialized) {
displayContext(nodeType, appFromArg, 0, true);
}
else {
displayContext(nodeType, appFromArg, 0);
}
}
},
});
});1234567891011121314151617181920212223242526272829303132333435363738import { app, TLGraphNode, ComfyApp } from './comfy/index.js';
import type { ComfyNode } from './comfy/index.js';
import { displayContext } from './common.js';
const crystoolsExtensionsSerialized: Record<string, string> = {
// 'External parameter from JSON file [Crystools]': 'Crystools.Utils.ExternalParameterFromJson',
'Read JSON file [Crystools]': 'Crystools.Utils.ReadJsonFile',
'JSON extractor [Crystools]': 'Crystools.Utils.JsonExtractor',
};
const crystoolsExtensions: Record<string, string> = {
'Get resolution [Crystools]': 'Crystools.Image.GetResolution',
'Preview from image [Crystools]': 'Crystools.Image.PreviewFromImage',
'Preview from metadata [Crystools]': 'Crystools.Image.PreviewFromMetadata',
'Metadata comparator [Crystools]': 'Crystools.Metadata.MetadataComparator',
'Stats system [Crystools]': 'Crystools.Utils.StatsSystem',
'Show any to JSON [Crystools]': 'Crystools.Debugger.ConsoleAnyToJson',
};
Object.keys(crystoolsExtensionsSerialized).forEach(prop => {
// @ts-ignore
crystoolsExtensions[prop] = crystoolsExtensionsSerialized[prop];
});
Object.keys(crystoolsExtensions).forEach(key => {
app.registerExtension({
name: crystoolsExtensions[key],
beforeRegisterNodeDef(nodeType: ComfyNode, nodeData: TLGraphNode, appFromArg: ComfyApp) {
if (nodeData.name === key) {
if (nodeData.name in crystoolsExtensionsSerialized) {
displayContext(nodeType, appFromArg, 0, true); // serialize_widgets = true
} else {
displayContext(nodeType, appFromArg, 0);
}
}
},
});
});123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188/* Vertical UI */
.comfy-menu, .side-bar-panel {
#crystools-monitors-root {
/*background-color: red;*/
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
background-color: var(--comfy-menu-bg);
border-radius: 6px;
border: 1px solid var(--border-color);
display: flex;
width: 100%;
flex-direction: column;
margin: 7px;
padding: 5px 0;
cursor: crosshair;
/* MONITORS */
.crystools-monitor {
margin: 1px 10px;
height: 12px;
display: flex;
align-items: center;
.crystools-text {
width: 40px;
font-size: 10px;
text-align: right;
margin-right: 3px;
&:hover {
font-weight: 600;
color: var(--input-text);
}
}
.crystools-label {
&:hover {
font-weight: 700;
color: var(--input-text);
}
}
}
.crystools-content {
flex-grow: 1;
position: relative;
background-color: var(--content-hover-bg)
}
.crystools-slider {
position: absolute;
height: 100%;
width: 0;
box-shadow: inset 2px 2px 10px rgba(0, 0, 0, 0.2);
}
.crystools-label {
position: relative;
color: var(--input-text);
font-size: 10px;
}
}
/* PROGRESS BAR */
#crystools-progressBar-root {
cursor: pointer;
margin: 0 12px 4px;
height: 18px;
position: relative;
border-radius: 3px;
width: 100%;
background-color: var(--comfy-input-bg);
.crystools-slider {
position: absolute;
height: 100%;
width: 50%;
transition: width 0.2s;
background-color: green;
box-shadow: inset 2px 2px 10px rgba(0, 0, 0, 0.3);
}
.crystools-label {
position: absolute;
margin: auto 0;
width: 100%;
color: var(--input-text);
font-size: 14px;
}
}
}
/* side-bar-panel */
.side-bar-panel {
#crystools-monitors-root {
width: 230px;
margin-left: auto;
margin-right: auto;
}
}
.comfyui-queue-button {
/*width: unset !important;*/
}
/* Horizontal UI */
#crystools-monitors-root {
/*background-color: red;*/
/*display: none;*/
flex-direction: row;
/*flex-grow: 5;*/
justify-content: flex-end;
/*flex: auto;*/
flex-shrink: 1;
/*min-width: max-content;*/
/*height: 100%;*/
/* max-width: 40vw;*/
/* min-width: 10vw;*/
/*gap: 5px;*/
/*margin: 0 auto;*/
/*align-items: center;*/
/*align-self: center;*/
/*width: min-content;*/
/*width: 100%;*/
cursor: crosshair;
/*margin: 4px 0;*/
display: flex; /* by progress bar base */
flex-wrap: wrap;
/*flex-direction: row;*/
/*justify-content: flex-end;*/
/*align-items: center;*/
gap: 5px;
align-self: center;
.crystools-monitor {
background-color: var(--comfy-input-bg);
position: relative;
align-items: center;
flex-direction: row;
/*width: 60px;*/
/*height: 100%;*/
.crystools-text {
font-size: 10px;
text-align: right;
margin-left: 3px;
position: absolute;
font-weight: 100;
bottom: 2px;
z-index: 10;
/*&:hover {*/
/* font-weight: 600;*/
/* color: var(--input-text);*/
/*}*/
}
/*.crystools-label {*/
/* &:hover {*/
/* font-weight: 800;*/
/* color: var(--input-text);*/
/* }*/
/*}*/
}
.crystools-content {
position: relative;
}
.crystools-slider {
position: absolute;
height: 100%;
width: 0;
box-shadow: inset 2px 2px 10px rgba(0, 0, 0, 0.2);
}
.crystools-label {
position: relative;
width: 100%;
color: var(--input-text);
font-weight: 500;
font-size: 11px;
right: 2px;
top: 2px;
text-align: right;
}
}ComfyUI-Crystools/__pycache__/__init__.cpython-310.pycAdded
ComfyUI-Crystools/nodes/__pycache__/__init__.cpython-310.pycAdded
ComfyUI-Crystools/nodes/__pycache__/_names.cpython-310.pycAdded
ComfyUI-Crystools/nodes/__pycache__/switch.cpython-310.pycAdded
ComfyUI-Crystools/nodes/switch.pyAdded+225
ComfyUI-Crystools/samples/debugger-any.jsonAdded+102
ComfyUI-Crystools/samples/debugger-json.jsonAdded+182
ComfyUI-Crystools/samples/debugger-metadata.jsonAdded+382
ComfyUI-Crystools/samples/image-load.jsonAdded+59
ComfyUI-Crystools/samples/image-preview-image.jsonAdded+373
ComfyUI-Crystools/samples/image-preview-metadata.jsonAdded+104
ComfyUI-Crystools/samples/image-resolution.jsonAdded+512
ComfyUI-Crystools/samples/image-save.jsonAdded+422
ComfyUI-Crystools/samples/list-any.jsonAdded+375
ComfyUI-Crystools/samples/list-strings.jsonAdded+177
ComfyUI-Crystools/samples/metadata-comparator.jsonAdded+168
ComfyUI-Crystools/samples/metadata-extractor.jsonAdded+350
ComfyUI-Crystools/samples/pipe-1.jsonAdded+564
ComfyUI-Crystools/samples/pipe-2.jsonAdded+849
ComfyUI-Crystools/samples/switch.jsonAdded+496
ComfyUI-Crystools/samples/utils-json-comparator.jsonAdded+212
ComfyUI-Crystools/samples/utils-stats.jsonAdded+410
ComfyUI-Crystools/server/__init__.pyAdded+1
ComfyUI-Crystools/server/__pycache__/__init__.cpython-310.pycAdded
ComfyUI-Crystools/server/__pycache__/monitor.cpython-310.pycAdded
ComfyUI-Crystools/server/monitor.pyAdded+125
ComfyUI-Crystools/web/comfy/index.d.tsAdded+5
ComfyUI-Crystools/web/comfy/index.jsAdded+2
ComfyUI-Crystools/web/comfy/index.tsAdded+5
ComfyUI-Crystools/web/comfy/liteGraph.d.tsAdded+19
ComfyUI-Crystools/web/comfy/liteGraph.jsAdded+30
ComfyUI-Crystools/web/comfy/liteGraph.tsAdded+32
ComfyUI-Crystools/web/comfy/liteGraph.types.d.tsAdded+19
ComfyUI-Crystools/web/comfy/scripts.d.tsAdded+5
ComfyUI-Crystools/web/comfy/scripts.jsAdded+5
ComfyUI-Crystools/web/comfy/scripts.tsAdded+10
ComfyUI-Crystools/web/comfy/typings/README.mdAdded+5
ComfyUI-Crystools/web/comfy/typings/comfy.d.tsAdded+227
ComfyUI-Crystools/web/comfy/typings/index.d.tsAdded+55
ComfyUI-Crystools/web/comfy/typings/litegraph.d.tsAdded+1750
ComfyUI-Crystools/web/common.d.tsAdded+4
ComfyUI-Crystools/web/common.jsAdded+50
ComfyUI-Crystools/web/common.tsAdded+92
ComfyUI-Crystools/web/debugger.d.tsAdded+1
ComfyUI-Crystools/web/debugger.jsAdded+77
ComfyUI-Crystools/web/debugger.tsAdded+86
ComfyUI-Crystools/web/extensions.d.tsAdded+1
ComfyUI-Crystools/web/extensions.jsAdded+32
ComfyUI-Crystools/web/extensions.tsAdded+38
ComfyUI-Crystools/web/monitor.cssAdded+188