From 9ab9d6efc91d237ca0e3135a569542535e79df57 Mon Sep 17 00:00:00 2001 From: Isulion <138410193+Isulion@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:27:53 +0100 Subject: [PATCH 1/2] Add files via upload --- __init__.py | 11 +++++++-- isulion_animal_generator.py | 40 ++++++++++++++++++++++++++++++++ isulion_cute_animal_generator.py | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 isulion_animal_generator.py create mode 100644 isulion_cute_animal_generator.py diff --git a/__init__.py b/__init__.py index 691aa3a..bb8f6a2 100644 --- a/__init__.py +++ b/__init__.py @@ -1,13 +1,20 @@ from .isulion_prompt_generator import IsulionPromptGenerator from .isulion_OllamaGenerate import OllamaGenerate +from .isulion_animal_generator import IsulionAnimalRandom +from .isulion_cute_animal_generator import IsulionCuteAnimalRandom NODE_CLASS_MAPPINGS = { "IsulionPromptGenerator": IsulionPromptGenerator, - "OllamaGenerate": OllamaGenerate + "OllamaGenerate": OllamaGenerate, + "AnimalGenerator": IsulionAnimalRandom, + "CuteAnimalGenerator": IsulionCuteAnimalRandom } # Optional: Provide a custom display name for the node NODE_DISPLAY_NAME_MAPPINGS = { "IsulionPromptGenerator": "Isulion Prompt Generator", - "OllamaGenerate": "Isulion Ollama Generate" + "OllamaGenerate": "Isulion Ollama Generate", + "AnimalGenerator": "Isulion Animal Selector", + "AnimalGenerator": "Isulion Cute Animal Selector" + } diff --git a/isulion_animal_generator.py b/isulion_animal_generator.py new file mode 100644 index 0000000..195a077 --- /dev/null +++ b/isulion_animal_generator.py @@ -0,0 +1,40 @@ +import random +from nodes import NODE_CLASS_MAPPINGS + +class IsulionAnimalRandom: + animals = [ + 'Dog','Cat','Horse','Cow','Chicken','Pig','Sheep','Goat','Lion','Tiger','Elephant','Bear','Wolf','Fox','Deer','Rabbit','Kangaroo','Giraffe','Zebra','Monkey','Chimpanzee','Gorilla','Orangutan','Panda','Koala','Hippopotamus','Rhinoceros','Crocodile','Alligator','Eagle','Hawk','Falcon','Owl','Penguin','Dolphin','Whale','Shark','Octopus','Squid','Jellyfish','Crab','Lobster','Clownfish','Sea Turtle','Frog','Toad','Snake','Lizard','Gecko','Tortoise','Camel','Donkey','Bat','Rat','Mouse','Squirrel','Chipmunk','Porcupine','Hedgehog','Skunk','Raccoon','Otter','Seal','Walrus','Polar Bear','Grizzly Bear','Cheetah','Leopard','Jaguar','Antelope','Buffalo','Bison','Moose','Reindeer','Mole','Platypus','Echidna','Parrot','Peacock','Swan','Duck','Goose','Turkey','Flamingo','Pelican','Seagull','Sparrow','Pigeon','Crow','Magpie','Woodpecker','Hummingbird','Butterfly','Bee','Ant','Spider','Scorpion','Worm','Snail','Slug' + ] + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "randomize": (["enable", "disable"],), + "seed": ("INT", {"default": 0, "min": 0, "max": 999999999}), + "animal": (cls.animals,) + } + } + + RETURN_TYPES = ("Animal", "Seed",) # Two outputs: prompt string and seed + FUNCTION = "random_animal" + CATEGORY = "Art/Styles" + + def random_animal(self, randomize, seed, animal): + if randomize == "enable": + # Set seed for reproducibility if provided + if seed is not None and seed > 0: + random.seed(seed) + else: + seed = random.randint(0, 999999999) + random.seed(seed) + + # Randomly select from predefined lists + animal = random.choice(self.animals) + + return (f"{animal}\n", animal, seed) + +# Register the node with ComfyUI +NODE_CLASS_MAPPINGS.update({ + "IsulionAnimalRandom": IsulionAnimalRandom +}) diff --git a/isulion_cute_animal_generator.py b/isulion_cute_animal_generator.py new file mode 100644 index 0000000..008c4c6 --- /dev/null +++ b/isulion_cute_animal_generator.py @@ -0,0 +1,40 @@ +import random +from nodes import NODE_CLASS_MAPPINGS + +class IsulionCuteAnimalRandom: + animals = [ + 'Red Panda','Koala','Fennec Fox','Pygmy Marmoset','Quokka','Sea Otter','Harp Seal Pup','Panda Cub','Penguin Chick','Hedgehog','Axolotl','Sloth','Rabbit','Kitten','Puppy','Meerkat','Sugar Glider','Chinchilla','Slow Loris','Hamster','Red Fox Kit','Lamb','Piglet','Duckling','Pygmy Hippo','Baby Giraffe','Baby Alpaca','Otter Pup','Corgi Puppy','Golden Retriever Puppy','Seal Pup','Snow Leopard Cub','Tiger Cub','Lion Cub','Baby Gorilla','Baby Orangutan','Pygmy Goat','Fawn (Baby Deer)','Ferret','Platypus','Kangaroo Joey','Wallaby','Dik-Dik','Serval Kitten','Caracal Kitten','Clouded Leopard Cub','Red Squirrel','Chipmunk','Prairie Dog','Arctic Fox','Polar Bear Cub','Bottlenose Dolphin Calf','Beluga Whale Calf','Manatee Calf','Baby Skunk','Raccoon Kit','Baby Opossum','Baby Echidna (Puggle)','Baby Tapir','GiantPanda Cub','Baby Hippo','Baby Rhino','Baby Zebra','Baby Elephant Seal','Baby Wombat','Baby Emu','Baby Kiwi Bird','Baby Flamingo','Cygnet (Baby Swan)','Baby Tortoise','Baby Alligator','Baby Crocodile','Baby Chameleon','Baby Iguana','Baby Frog','Baby Toad','Baby Gecko','Ring-tailed Lemur','Sifaka Lemur','Mouse Lemur','Bush Baby','PygmyPossum','Baby Mole','Baby Bat','Leveret (Baby Hare)','Baby Mole Rat','Baby Porcupine','Baby Badger','Pygmy Rabbit','Baby Seal','Baby Puffin','Owlet (Baby Owl)','Hoglet(Baby Hedgehog)','Baby Armadillo','Baby Pangolin','Baby Okapi','Baby Cheetah','Baby Ocelot','Baby Lynx','Baby Tasmanian Devil' + ] + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "randomize": (["enable", "disable"],), + "seed": ("INT", {"default": 0, "min": 0, "max": 999999999}), + "animal": (cls.animals,) + } + } + + RETURN_TYPES = ("Animal", "Seed",) # Two outputs: prompt string and seed + FUNCTION = "random_animal" + CATEGORY = "Art/Styles" + + def random_animal(self, randomize, seed, animal): + if randomize == "enable": + # Set seed for reproducibility if provided + if seed is not None and seed > 0: + random.seed(seed) + else: + seed = random.randint(0, 999999999) + random.seed(seed) + + # Randomly select from predefined lists + animal = random.choice(self.animals) + + return (f"{animal}\n", animal, seed) + +# Register the node with ComfyUI +NODE_CLASS_MAPPINGS.update({ + "IsulionCuteAnimalRandom": IsulionCuteAnimalRandom +}) From 5eeae9531c3a965abf17b4d90ddd14ef8e64ed66 Mon Sep 17 00:00:00 2001 From: Isulion <138410193+Isulion@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:31:14 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7a0cf74..e4de235 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,7 @@ Use this example workflow to get started: Advanced Mode for More Flexibility: ![Example_Isulion_Workflow_Split](https://github.com/user-attachments/assets/e578ff7a-0c03-47a1-900f-a7e209a64914) + +Chimere Animals Workflow + +![workflowAnimals](https://github.com/user-attachments/assets/100cb116-c6ef-43cf-b5d3-d7782949ad9c)