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}),
|
"seed": ("INT", {"max": 2**64 - 1}),
|
||||||
},
|
},
|
||||||
"optional": {"settings": ("EXL_SETTINGS",)},
|
"optional": {"settings": ("EXL_SETTINGS",)},
|
||||||
"hidden": {"info": "EXTRA_PNGINFO", "id": "UNIQUE_ID"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CATEGORY = _CATEGORY
|
CATEGORY = _CATEGORY
|
||||||
@@ -277,8 +276,6 @@ class Generator:
|
|||||||
max_tokens,
|
max_tokens,
|
||||||
seed,
|
seed,
|
||||||
settings=None,
|
settings=None,
|
||||||
info=None,
|
|
||||||
id=None,
|
|
||||||
):
|
):
|
||||||
if unload:
|
if unload:
|
||||||
unload_all_models()
|
unload_all_models()
|
||||||
@@ -324,7 +321,7 @@ class Generator:
|
|||||||
progress.update(1)
|
progress.update(1)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
output = "".join(chunks).strip()
|
output = "".join(chunks)
|
||||||
total = round(time() - start, 2)
|
total = round(time() - start, 2)
|
||||||
speed = round(count / total, 2)
|
speed = round(count / total, 2)
|
||||||
|
|
||||||
@@ -336,13 +333,6 @@ class Generator:
|
|||||||
if unload:
|
if unload:
|
||||||
model.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,)
|
return (output,)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ class Convert:
|
|||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"text": ("STRING", {"forceInput": True}),
|
"text": ("STRING", {"forceInput": True}),
|
||||||
"strip": (("punctuation", "whitespace", "both", False),),
|
"strip": (("punctuation", "whitespace", "both", "none"),),
|
||||||
"case": (("lower", "upper", "capitalize", False),),
|
"case": (("lower", "upper", "capitalize", "title", "none"),),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,9 +23,13 @@ class Convert:
|
|||||||
def convert(self, text, strip, case):
|
def convert(self, text, strip, case):
|
||||||
if strip == "both":
|
if strip == "both":
|
||||||
text = text.strip(string.punctuation + string.whitespace)
|
text = text.strip(string.punctuation + string.whitespace)
|
||||||
elif strip:
|
text = " ".join(text.split()).strip()
|
||||||
|
elif strip != "none":
|
||||||
text = text.strip(getattr(string, strip))
|
text = text.strip(getattr(string, strip))
|
||||||
if case:
|
|
||||||
|
if case == "title":
|
||||||
|
text = string.capwords(text)
|
||||||
|
elif case != "none":
|
||||||
text = getattr(text, case)()
|
text = getattr(text, case)()
|
||||||
|
|
||||||
return (text,)
|
return (text,)
|
||||||
|
|||||||
Reference in New Issue
Block a user