mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-27 08:16:44 +00:00
33 lines
968 B
Python
33 lines
968 B
Python
from comfy_api.v3 import io, ui
|
|
|
|
|
|
class MaskPreview(io.ComfyNodeV3):
|
|
"""Mask Preview - original implement in ComfyUI_essentials.
|
|
|
|
https://github.com/cubiq/ComfyUI_essentials/blob/9d9f4bedfc9f0321c19faf71855e228c93bd0dc9/mask.py#L81
|
|
Upstream requested in https://github.com/Kosinkadink/rfcs/blob/main/rfcs/0000-corenodes.md#preview-nodes
|
|
"""
|
|
|
|
@classmethod
|
|
def DEFINE_SCHEMA(cls):
|
|
return io.SchemaV3(
|
|
node_id="MaskPreview",
|
|
display_name="Convert Mask to Image",
|
|
category="mask",
|
|
inputs=[
|
|
io.Mask.Input(
|
|
"masks",
|
|
display_name="masks",
|
|
),
|
|
],
|
|
hidden=[io.Hidden.prompt, io.Hidden.extra_pnginfo],
|
|
is_output_node=True,
|
|
)
|
|
|
|
@classmethod
|
|
def execute(cls, masks):
|
|
return io.NodeOutput(ui=ui.PreviewMask(masks))
|
|
|
|
|
|
NODES_LIST: list[type[io.ComfyNodeV3]] = [MaskPreview]
|