Add TextWildcards

This commit is contained in:
Filipe
2023-04-04 19:06:33 -03:00
parent 222c0b2c65
commit f8863c5cb2
2 changed files with 34 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import os, glob, sys
import random
import re
import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] or __name__ =='__main__':
from ConsoleColor import print, console
from wildcards import wildcards
else:
from .ConsoleColor import print, console
from .wildcards import wildcards
class TextWildcards:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {"multiline": True}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
}
}
RETURN_TYPES = ("STRING",)
FUNCTION = "encode"
CATEGORY = "utils"
def encode(self, seed, text):
random.seed(seed)
print(f"[green]text : [/green]",text)
r=wildcards.run(text)
print(f"[green]result : [/green]",r)
return ([r], )
+1
View File
@@ -70,6 +70,7 @@ if not md.startswith("custom_nodes."):
add("VAELoaderDecode")
add("SimpleSampler",["SimpleSampler","SimpleSamplerVAE"])
add("SaveImageSimple")
add("TextWildcards")
#add("test")
console.rule(" init end ", style="bold green")