加入了小说分镜规格化为类json格式供Fizznode使用

This commit is contained in:
AbyssYuan0
2023-11-07 15:51:28 +08:00
parent e6d1777746
commit 2fd9089f23
+26 -1
View File
@@ -317,6 +317,30 @@ class ImageScaleToSide:
cls = cls.movedim(1, -1)
return (cls,)
class NovelToFizz:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {"required": {"text": ("STRING", {"multiline": True})}}
RETURN_TYPES = ("STRING", "INT",)
FUNCTION = "novelToFizz"
CATEGORY = "badger"
def novelToFizz(self, text):
textA = text.split("\n")
lines = 0
outText = ""
for line in textA:
if(len(line)>0):
line = "\""+str(lines)+"\":\""+line+"\",\n"
lines = lines+1
outText = outText+line
outText = outText[:-2]
return (outText, lines, )
@@ -326,7 +350,8 @@ NODE_CLASS_MAPPINGS = {
"IntToString-badger": IntToString,
"FloatToString-badger": FloatToString,
"ImageNormalization-badger": ImageNormalization,
"ImageScaleToSide-badger": ImageScaleToSide
"ImageScaleToSide-badger": ImageScaleToSide,
"NovelToFizz-badger": NovelToFizz
}
NODE_DISPLAY_NAME_MAPPINGS = {