mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-29 11:19:23 +08:00
feat: Add Support For Simple Seed (CORE-295) (#14616)
This commit is contained in:
parent
5236cd02e6
commit
b22d0fb9c0
33
comfy_extras/nodes_seed.py
Normal file
33
comfy_extras/nodes_seed.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import sys
|
||||||
|
from typing_extensions import override
|
||||||
|
|
||||||
|
from comfy_api.latest import ComfyExtension, io
|
||||||
|
|
||||||
|
|
||||||
|
class SeedNode(io.ComfyNode):
|
||||||
|
@classmethod
|
||||||
|
def define_schema(cls):
|
||||||
|
return io.Schema(
|
||||||
|
node_id="SeedNode",
|
||||||
|
display_name="Seed",
|
||||||
|
search_aliases=["seed", "random"],
|
||||||
|
category="utilities",
|
||||||
|
inputs=[
|
||||||
|
io.Int.Input("seed", min=0, max=sys.maxsize, control_after_generate=io.ControlAfterGenerate.fixed),
|
||||||
|
],
|
||||||
|
outputs=[io.Int.Output(display_name="seed")],
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def execute(cls, seed: int) -> io.NodeOutput:
|
||||||
|
return io.NodeOutput(seed)
|
||||||
|
|
||||||
|
|
||||||
|
class SeedExtension(ComfyExtension):
|
||||||
|
@override
|
||||||
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||||
|
return [SeedNode]
|
||||||
|
|
||||||
|
|
||||||
|
async def comfy_entrypoint() -> SeedExtension:
|
||||||
|
return SeedExtension()
|
||||||
Loading…
Reference in New Issue
Block a user