diff --git a/__init__.py b/__init__.py index 443aead..97c89e0 100644 --- a/__init__.py +++ b/__init__.py @@ -8,6 +8,7 @@ from .custom_name_selector import IndexedStringSelector from .ksampler_fun import KSampler from .fal_recraft_upscale import FalAPI_recraft_upscale from .fal_kling_video import FalAPI_kling_video +from .string_lower import StringLower WEB_DIRECTORY = "./js" NODE_CLASS_MAPPINGS = { @@ -19,7 +20,8 @@ NODE_CLASS_MAPPINGS = { "IndexedStringSelector": IndexedStringSelector, "Fun KSampler": KSampler, "FalAPI_recraft_upscale": FalAPI_recraft_upscale, - "FalAPI_kling_video": FalAPI_kling_video + "FalAPI_kling_video": FalAPI_kling_video, + "StringLower": StringLower } NODE_DISPLAY_NAME_MAPPINGS = { "LayeredInfiniteZoom": "Layered Infinite Zoom", @@ -30,7 +32,8 @@ NODE_DISPLAY_NAME_MAPPINGS = { "IndexedStringSelector": "Indexed String Selector", "Fun KSampler": "Fun KSampler", "FalAPI_recraft_upscale": "Fal API Recraft Upscale", - "FalAPI_kling_video": "Fal API Kling Video" + "FalAPI_kling_video": "Fal API Kling Video", + "StringLower": "String to Lowercase" } __all__ = [ diff --git a/string_lower.py b/string_lower.py new file mode 100644 index 0000000..87486cd --- /dev/null +++ b/string_lower.py @@ -0,0 +1,17 @@ +class StringLower: + CATEGORY = "Text" # shows up under "Text" in the node picker + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "text": ("STRING",), # one STRING input + } + } + + RETURN_TYPES = ("STRING",) # one STRING output (fixed syntax error) + FUNCTION = "to_lower" # name of the method to call + + def to_lower(self, text): + # do the work and return a tuple matching RETURN_TYPES + return (text.lower(),) \ No newline at end of file