Add files via upload

This commit is contained in:
drago87
2023-11-20 20:53:02 +01:00
committed by GitHub
commit 0c3e287168
5 changed files with 56 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
from .file_padding import *
Binary file not shown.
Binary file not shown.
Binary file not shown.
+55
View File
@@ -0,0 +1,55 @@
import math
import glob
class file_padding:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"path": ("STRING",{
"multiline": False,
"default": "./ComfyUI/output/"
}),
"padding": ("INT", {
"default": 4,
"min": 0,
"max": 10,
"step": 1,
"display": "number"
})
}
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("Number of Images (as str)",)
FUNCTION = "run"
CATEGORY = "DragosNodes"
def run(self, path, padding):
#print("init "+str(path))
if (path[-1]!="/"):
path = path+"/"
#print("after "+ str(path))
#print(str(glob.glob(path+"*.png")))
if padding > 0:
lenght = str(len(glob.glob(path+"*.png")))
return(lenght)
else:
lenght = ""
for x in padding-1:
lenght = lenght+"0"
lenght = lenght + str(len(glob.glob(path+"*.png")))
return(lenght)
NODE_CLASS_MAPPINGS = {
"file_padding": file_padding
}
NODE_DISPLAY_NAME_MAPPINGS = {
"file_padding": "File Padding"
}