mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-30 19:59:32 +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)
|
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):
|
class PrimitivesExtension(ComfyExtension):
|
||||||
@override
|
@override
|
||||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||||
@ -106,6 +124,7 @@ class PrimitivesExtension(ComfyExtension):
|
|||||||
Int,
|
Int,
|
||||||
Float,
|
Float,
|
||||||
Boolean,
|
Boolean,
|
||||||
|
Color,
|
||||||
]
|
]
|
||||||
|
|
||||||
async def comfy_entrypoint() -> PrimitivesExtension:
|
async def comfy_entrypoint() -> PrimitivesExtension:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user