Skip to content

%date% formatting cannot be set for filenames via "String" #9503

@altoiddealer

Description

@altoiddealer

Custom Node Testing

Expected Behavior

Save File Formatting is wonderful when using something like WAN/%date:yyyy-MM-dd%_%date:hhmmss%_ in the filename field for nodes like Save Image, etc.

However, if the same value is input in a "String" node and fed in to that field, it fails to apply the formatting and results in bad file error (tried to write file including % in it)

EXPECTED BEHAVIOR:

  1. Put a value like ``WAN/%date:yyyy-MM-dd%%date:hhmmss%` into a "String" node.
  2. Pass that into a filename field, such as in "Save Image" node
  3. Dynamically updates the filename

Actual Behavior

fails to apply the formatting and results in bad file error (tried to write file including % in it)

Steps to Reproduce

Do what I wrote above

Debug Logs

Prompt executed in 0.11 seconds
got prompt
!!! Exception during processing !!! [Errno 22] Invalid argument: 'D:\\0_AI\\ComfyUI_windows_portable\\ComfyUI\\output\\xtra\\\\%date:yyyy-MM-dd%_%date:hhmmss%__00001.png'
Traceback (most recent call last):
  File "D:\0_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 496, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\0_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 315, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\0_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 289, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "D:\0_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 277, in process_inputs
    result = f(**inputs)
             ^^^^^^^^^^^
  File "D:\0_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-videohelpersuite\videohelpersuite\nodes.py", line 381, in combine_video
    Image.fromarray(tensor_to_bytes(first_image)).save(
  File "D:\0_AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\PIL\Image.py", line 2583, in save
    fp = builtins.open(filename, "w+b")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'D:\\0_AI\\ComfyUI_windows_portable\\ComfyUI\\output\\xtra\\\\%date:yyyy-MM-dd%_%date:hhmmss%__00001.png'

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions