-
Notifications
You must be signed in to change notification settings - Fork 0
/
Text Utils.py
81 lines (68 loc) · 1.7 KB
/
Text Utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import math
import random
import torch
class toUpper:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {
}),
},
}
RETURN_TYPES = ("STRING",)
#RETURN_NAMES = ("image_output_name",)
FUNCTION = "toUpper"
# OUTPUT_NODE = True
CATEGORY = "Utils"
@staticmethod
def toUpper(text):
text = text.upper()
return (text,)
class toLower:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {}),
},
}
RETURN_TYPES = ("STRING", )
#RETURN_NAMES = ("image_output_name",)
FUNCTION = "toUpper"
# OUTPUT_NODE = True
CATEGORY = "Utils"
@staticmethod
def toUpper(text):
text = text.lower()
return (text,)
class toMiddle:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING",{}),
},
}
RETURN_TYPES = ("STRING", )
#RETURN_NAMES = ("image_output_name",)
FUNCTION = "toUpper"
# OUTPUT_NODE = True
CATEGORY = "Utils"
@staticmethod
def toUpper(text):
text = text.title()
return (text,)
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"String to Upper Case": toUpper,
"String to Title Case": toMiddle,
"String to Lower Case": toLower,
}