Remove the hidden inputs since they don't seem to be working anyway (no prompt in workflow), touch-up the convert node a bit
This commit is contained in:
+1
-11
@@ -260,7 +260,6 @@ class Generator:
|
||||
"seed": ("INT", {"max": 2**64 - 1}),
|
||||
},
|
||||
"optional": {"settings": ("EXL_SETTINGS",)},
|
||||
"hidden": {"info": "EXTRA_PNGINFO", "id": "UNIQUE_ID"},
|
||||
}
|
||||
|
||||
CATEGORY = _CATEGORY
|
||||
@@ -277,8 +276,6 @@ class Generator:
|
||||
max_tokens,
|
||||
seed,
|
||||
settings=None,
|
||||
info=None,
|
||||
id=None,
|
||||
):
|
||||
if unload:
|
||||
unload_all_models()
|
||||
@@ -324,7 +321,7 @@ class Generator:
|
||||
progress.update(1)
|
||||
count += 1
|
||||
|
||||
output = "".join(chunks).strip()
|
||||
output = "".join(chunks)
|
||||
total = round(time() - start, 2)
|
||||
speed = round(count / total, 2)
|
||||
|
||||
@@ -336,13 +333,6 @@ class Generator:
|
||||
if unload:
|
||||
model.unload()
|
||||
|
||||
if id and info and "workflow" in info:
|
||||
nodes = info["workflow"]["nodes"]
|
||||
node = next((n for n in nodes if str(n["id"]) == id), None)
|
||||
|
||||
if node:
|
||||
node["widgets_values"] = [output]
|
||||
|
||||
return (output,)
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ class Convert:
|
||||
return {
|
||||
"required": {
|
||||
"text": ("STRING", {"forceInput": True}),
|
||||
"strip": (("punctuation", "whitespace", "both", False),),
|
||||
"case": (("lower", "upper", "capitalize", False),),
|
||||
"strip": (("punctuation", "whitespace", "both", "none"),),
|
||||
"case": (("lower", "upper", "capitalize", "title", "none"),),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -23,9 +23,13 @@ class Convert:
|
||||
def convert(self, text, strip, case):
|
||||
if strip == "both":
|
||||
text = text.strip(string.punctuation + string.whitespace)
|
||||
elif strip:
|
||||
text = " ".join(text.split()).strip()
|
||||
elif strip != "none":
|
||||
text = text.strip(getattr(string, strip))
|
||||
if case:
|
||||
|
||||
if case == "title":
|
||||
text = string.capwords(text)
|
||||
elif case != "none":
|
||||
text = getattr(text, case)()
|
||||
|
||||
return (text,)
|
||||
|
||||
Reference in New Issue
Block a user