commit 5b00a5cd65e58eb393b109e689151216fa165848 Author: BetaDoggo Date: Tue Aug 27 19:30:36 2024 -0400 init diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..d721463 --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS + +__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] \ No newline at end of file diff --git a/nodes.py b/nodes.py new file mode 100644 index 0000000..42135fe --- /dev/null +++ b/nodes.py @@ -0,0 +1,40 @@ +import random + +class GatchaEmbedding: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "seed": ("INT", {"default": 1337, "min": 1, "max": 16777215}), + }, + "optional": { + "clip1": ("CLIP",), + "clip2": ("CLIP",), + "clip3": ("CLIP",), + "clip4": ("CLIP",), + "clip5": ("CLIP",), + "clip6": ("CLIP",), + "clip7": ("CLIP",), + "clip8": ("CLIP",), + "clip9": ("CLIP",), + "clip10": ("CLIP",), + }, + } + + RETURN_TYPES = ("CLIP",) + FUNCTION = "roll_gatcha" + CATEGORY = "ComfyCloudAPIs" + + def roll_gatcha(self, seed, clip1=None, clip2=None, clip3=None, clip4=None, clip5=None, clip6=None, clip7=None, clip8=None, clip9=None, clip10=None,): + clips = [clip for clip in [clip1, clip2, clip3, clip4, clip5, clip6, clip7, clip8, clip9, clip10] if clip is not None] + random.seed(seed) + clip = random.choice(clips) + return (clip,) + +NODE_CLASS_MAPPINGS = { + "GatchaEmbedding": GatchaEmbedding, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "GatchaEmbedding": "GatchaEmbedding", +} \ No newline at end of file diff --git a/preview.png b/preview.png new file mode 100644 index 0000000..0528ccf Binary files /dev/null and b/preview.png differ