String Converter Node

This commit is contained in:
nofunstudio
2025-06-23 21:51:21 -06:00
parent fa970a551a
commit ef5b94c0d5
2 changed files with 22 additions and 2 deletions
+5 -2
View File
@@ -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__ = [
+17
View File
@@ -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(),)