From d6eafab562f458d0f5491b7a3ff5de37c1da2dfb Mon Sep 17 00:00:00 2001 From: Nik Clark <24965799+zzubnik@users.noreply.github.com> Date: Tue, 1 Apr 2025 21:52:43 +0100 Subject: [PATCH] Delete TT_CountryOfOrigin.py --- TT_CountryOfOrigin.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 TT_CountryOfOrigin.py diff --git a/TT_CountryOfOrigin.py b/TT_CountryOfOrigin.py deleted file mode 100644 index 0a9120c..0000000 --- a/TT_CountryOfOrigin.py +++ /dev/null @@ -1,39 +0,0 @@ -import os -import json -import random -from typing import List -import comfy.model_management -from nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS - -class TT_CountryOfOrigin: - @classmethod - def INPUT_TYPES(cls): - options = cls.load_options() - if options: - options.insert(0, "Random Choice") # Add 'Random Choice' at the top - return {"required": {"selection": (options, {"default": options[0] if options else ""}), "seed": ("INT", {"default": 42})}} - - RETURN_TYPES = ("STRING",) - FUNCTION = "output_selection" - CATEGORY = "TT_TextTools" - - @staticmethod - def load_options() -> List[str]: - file_path = os.path.join(os.path.dirname(__file__), "CountryOfOrigin.txt") - if os.path.exists(file_path): - with open(file_path, "r", encoding="utf-8") as f: - return [line.strip() for line in f.readlines() if line.strip()] - return ["No options found"] - - def output_selection(self, selection: str, seed: int): - if selection == "Random Choice": - options = self.load_options() - if options and "Random Choice" in options: - options.remove("Random Choice") # Remove 'Random Choice' before picking - random.seed(seed) # Set seed for reproducibility - return (random.choice(options) if options else "No options available",) - return (selection,) - -# Register the node -NODE_CLASS_MAPPINGS["TT_CountryOfOrigin"] = TT_CountryOfOrigin -NODE_DISPLAY_NAME_MAPPINGS["TT_CountryOfOrigin"] = "TT_CountryOfOrigin" \ No newline at end of file