TinyTerra / ComfyUI_tinyterraNodes

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

The save_prefix tokens is broken #5

Closed hortom closed 1 year ago

hortom commented 1 year ago

Hi, thanks again to fix this last time. Unfortunately, it is broken now. Maybe because of a comfyui update? As before, any of these formats would be amazing:

Could you please fix it again?

Suzie1 commented 1 year ago

Hello, my filename_prefix is also broken after the latest nodes update. I get a Win 267 error:

Traceback (most recent call last): File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 141, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 68, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\tinyterraNodes.py", line 1449, in output results = save_images(self, image, preview_prefix, save_prefix, image_output, prompt, extra_pnginfo) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\tinyterraNodes.py", line 356, in save_images full_output_folder, filename, counter, subfolder, filename_prefix = get_save_image_path(filename_prefix, output_dir, images[0].shape[1], images[0].shape[0], output_folder) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes\tinyterraNodes.py", line 342, in get_save_image_path os.makedirs(full_output_folder, exist_ok=True) File "os.py", line 225, in makedirs NotADirectoryError: [WinError 267] The directory name is invalid: 'F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\output\%date:d-M-yy%'

It was working okay immediately before I ran the update. The update also appears to have broken the filename_prefix on the standard Save Image node.

hortom commented 1 year ago

Oh, if the ComfyUI default save image is also broken then this can be closed after Comfy is fixed and we confirm that it works again, I guess.

TinyTerra commented 1 year ago

Strange... regardless I've just pushed a fix for tinyterra nodes at least - that formats the string within the python save function instead of using javascript in the same way default comfy does..

the formatting should still follow the default comfy %date:yyyy-MM-dd-hh-mm-ss% etc... but since the parsing code has been moved to python please let me know if the date isn't being parsed as you'd expect it to

hortom commented 1 year ago

Thank you. Your solution fixed your sampler. The original ComfyUI Save Image still seems to be broken and it should be fixed by comfyanonymous.

TinyTerra commented 1 year ago

Yup, should be. If you need something similar there is always the output image node in this pack :)