4 Commits
Author SHA1 Message Date
lilly 01590a7839 Merge branch 'pr/5' 2023-04-05 20:05:02 +09:00
lilly cf91e6a57a msg 2023-04-05 19:53:40 +09:00
Filipe 1e7442625b Add suport for WAS text utils nodes 2023-04-04 19:26:02 -03:00
Filipe f8863c5cb2 Add TextWildcards 2023-04-04 19:06:33 -03:00
4 changed files with 40 additions and 3 deletions
+1
View File
@@ -22,6 +22,7 @@ custom_theme = Theme({
})
console = Console(theme=custom_theme)
print=console.log
ccolor="bright_yellow"
"""
print("test", style="bold white on blue")
print("test", style="bold green")
+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","ASCII")
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, 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")
+5 -3
View File
@@ -3,9 +3,9 @@ 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 ConsoleColor import print, console, ccolor
else:
from .ConsoleColor import print, console
from .ConsoleColor import print, console , ccolor
#print(__file__)
#print(os.path.basename(__file__))
#print(os.getcwd())
@@ -155,7 +155,9 @@ class wildcards:
# 실행기
def run(text):
if text is None or type(text) is not str:
print("[red]text is not str : [/red]",text)
return None
wildcards.card_load()
#print(f"text : {text}")