TinyTerra / ComfyUI_tinyterraNodes

A selection of nodes for Stable Diffusion ComfyUI
GNU General Public License v3.0
330 stars 39 forks source link

Image Output Number Padding Not Working #129

Open fuzzyfaraway opened 6 days ago

fuzzyfaraway commented 6 days ago

After today's update I get this error back from the ImageOuput node when number_padding is set to "None":

Error occurred when executing ttN imageOutput:

unsupported operand type(s) for -: 'int' and 'NoneType'

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\ttNpy\tinyterraNodes.py", line 3405, in output
results = ttN_save.images(image, save_prefix, image_output, embed_workflow, file_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\ttNpy\tinyterraNodes.py", line 1022, in images
filename, subfolder = ttNsave.filename_parser(output_dir, filename, self.prompt, self.my_unique_id, self.number_padding, group_id, ext)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\ttNpy\tinyterraNodes.py", line 979, in filename_parser
filename = re.sub(r'[^a-zA-Z0-9_\-\. ]', '', filename)[:255-number_padding-len(ext)-2]
~~~^~~~~~~~~~~~~~~

It's working fine with a number set, but "None" gets bounced, and that's the setting I want/need!

TinyTerra commented 6 days ago

Ah, that was an oversight sorry. Should be fixed in https://github.com/TinyTerra/ComfyUI_tinyterraNodes/commit/f12d0aab86afb3505e0460675cb34bbf6de36f7a