ComfyUI
ComfyUI copied to clipboard
save file image using formatting doesn't work
After updating comfyui, the method of inserting a date into the filename prefix does not work. If i save the image after inserting the value %date:yyyy-MM-dd%/%date:hhmm% in the filename prefix, the following error is showed:
Error occurred when executing SaveImage:
[WinError 267] The directory name is invalid.: 'E:\ComfyUI\output\%date:yyyy-MM-dd%'
File "E:\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI\nodes.py", line 1440, in save_images full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI\folder_paths.py", line 260, in get_save_image_path os.makedirs(full_output_folder, exist_ok=True) File "", line 225, in makedirs
Could it be caused by one of your extensions? I've encountered this issue with ComfyUI-Custom-Scripts installed. I don't really understand why.
With that extension installed, instead of using a primitive node plugged into the save image node, I can directly use the date format in filename_prefix
(without converting to widget).
It's happening for me too. I updated ComfyUI today, and I get the same error due to date strings in a workflow that hasn't changed in a while. It has been a couple of months since I last updated ComfyUI.
I tried removing the primitive plugged into SaveImage, but that didn't solve it.
I was going to look alternative ways of saving files, and it seems I already have a node called Image Save
as well as one from Searge in there. Unfortunately I haven't had the opportunity to try them out. I just replaced my date formatting template stuff with today's date, which worked for what I needed today.
It's happening for me too. I updated ComfyUI today, and I get the same error due to date strings in a workflow that hasn't changed in a while. It has been a couple of months since I last updated ComfyUI.
I tried removing the primitive plugged into SaveImage, but that didn't solve it.
I was going to look alternative ways of saving files, and it seems I already have a node called
Image Save
as well as one from Searge in there. Unfortunately I haven't had the opportunity to try them out. I just replaced my date formatting template stuff with today's date, which worked for what I needed today.
i solved this problem, would you remove that 'save image' node and redeploy? update and not redeploy made an error but after redeploy the error doesn't showed
i solved this problem, would you remove that 'save image' node and redeploy? update and not redeploy made an error but after redeploy the error doesn't showed
I tried remove that 'save image' node and redeploy but still come up the same error
Just replied in https://github.com/comfyanonymous/ComfyUI/issues/2905
... With that extension installed, instead of using a primitive node plugged into the save image node, I can directly use the date format in
filename_prefix
(without converting to widget).
You are absolutely right. Removing the Primitive node and converting filename_prefix to widget magically solves the problem. At first the GUI needs to be reloaded for this fix to work, but it finally works and saved me from installing yet another plugin.
I finally got this to work, but I had to do multiple rounds of removing the widget, re-adding the widget rebooting the server. I literally tried 3 or 4 times or else it would just not substitute things into the string and add the things with the percent signs around them in the filename.
So if it doesn't work, try again and again and again and maybe you'll get lucky. :-/