mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-27 10:19:37 +08:00
Add Color primitive
This commit is contained in:
parent
bd7da053ae
commit
89f4998979
@ -97,6 +97,24 @@ class Boolean(io.ComfyNode):
|
||||
return io.NodeOutput(value)
|
||||
|
||||
|
||||
class Color(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="PrimitiveColor",
|
||||
display_name="Color",
|
||||
category="utilities/primitive",
|
||||
inputs=[
|
||||
io.Color.Input("value", default="#FFFFFF"),
|
||||
],
|
||||
outputs=[io.Color.Output()],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, value: str) -> io.NodeOutput:
|
||||
return io.NodeOutput(value)
|
||||
|
||||
|
||||
class PrimitivesExtension(ComfyExtension):
|
||||
@override
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
@ -106,6 +124,7 @@ class PrimitivesExtension(ComfyExtension):
|
||||
Int,
|
||||
Float,
|
||||
Boolean,
|
||||
Color,
|
||||
]
|
||||
|
||||
async def comfy_entrypoint() -> PrimitivesExtension:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user