mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-06 03:22:33 +08:00
Merge 535ef70698 into 32621c6a11
This commit is contained in:
commit
70a65a4c34
47
comfy_extras/nodes_toolkit.py
Normal file
47
comfy_extras/nodes_toolkit.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
from typing_extensions import override
|
||||||
|
from comfy_api.latest import ComfyExtension, io
|
||||||
|
|
||||||
|
|
||||||
|
class CreateList(io.ComfyNode):
|
||||||
|
@classmethod
|
||||||
|
def define_schema(cls):
|
||||||
|
template_matchtype = io.MatchType.Template("type")
|
||||||
|
template_autogrow = io.Autogrow.TemplatePrefix(
|
||||||
|
input=io.MatchType.Input("input", template=template_matchtype),
|
||||||
|
prefix="input",
|
||||||
|
)
|
||||||
|
return io.Schema(
|
||||||
|
node_id="CreateList",
|
||||||
|
display_name="Create List",
|
||||||
|
category="logic",
|
||||||
|
is_input_list=True,
|
||||||
|
search_aliases=["Image Iterator", "Text Iterator", "Iterator"],
|
||||||
|
inputs=[io.Autogrow.Input("inputs", template=template_autogrow)],
|
||||||
|
outputs=[
|
||||||
|
io.MatchType.Output(
|
||||||
|
template=template_matchtype,
|
||||||
|
is_output_list=True,
|
||||||
|
display_name="list",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def execute(cls, inputs: io.Autogrow.Type) -> io.NodeOutput:
|
||||||
|
output_list = []
|
||||||
|
for input in inputs.values():
|
||||||
|
output_list += input
|
||||||
|
return io.NodeOutput(output_list)
|
||||||
|
|
||||||
|
|
||||||
|
class ToolkitExtension(ComfyExtension):
|
||||||
|
@override
|
||||||
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||||
|
return [
|
||||||
|
CreateList,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
async def comfy_entrypoint() -> ToolkitExtension:
|
||||||
|
return ToolkitExtension()
|
||||||
3
nodes.py
3
nodes.py
@ -2433,7 +2433,8 @@ async def init_builtin_extra_nodes():
|
|||||||
"nodes_image_compare.py",
|
"nodes_image_compare.py",
|
||||||
"nodes_zimage.py",
|
"nodes_zimage.py",
|
||||||
"nodes_lora_debug.py",
|
"nodes_lora_debug.py",
|
||||||
"nodes_color.py"
|
"nodes_color.py",
|
||||||
|
"nodes_toolkit.py",
|
||||||
]
|
]
|
||||||
|
|
||||||
import_failed = []
|
import_failed = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user