WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.15k stars 170 forks source link

Error when creating a new folder with a subfolder using Image Save node #56

Closed N3-Oti closed 1 year ago

N3-Oti commented 1 year ago

I encountered an issue when using the Image Save node to create a new folder with a subfolder. When I try to create a folder with the structure '/[time(%Y-%m-%d)]/S', an error occurs, and the creation and saving process fails. However, when I attempt to create a folder with the structure '/[time(%Y-%m-%d)]', it succeeds. I believe the error occurs when trying to create a subfolder within the main folder. Could you please look into this issue?

WASasquatch commented 1 year ago

Please provide all errors.

It's likely because WAS Node Suite uses mkdir, not makedirs, so it has no tree support.

N3-Oti commented 1 year ago

Thank you for your response. here is the error message I encountered when trying to create a nested subfolder using the Image Save Node:

WAS NS Warning: The path ./ComfyUI/output/2023-04-30/S specified doesn't exist! Creating directory. Traceback (most recent call last): File "J:\ComfyUI_windows_portable\ComfyUI\execution.py", line 184, in execute executed += recursive_execute(self.server, prompt, self.outputs, x, extra_data) File "J:\ComfyUI_windows_portable\ComfyUI\execution.py", line 69, in recursive_execute outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all) File "J:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\WAS_Node_Suite.py", line 4370, in save_images os.mkdir(output_path.strip()) FileNotFoundError: [WinError 3] 指定されたパスが見つかりません。: './ComfyUI/output/2023-04-30/S'

Please let me know if you need any further information or if there's anything else I can provide to help resolve this issue.

Best regards.

WASasquatch commented 1 year ago

Thank you.

I will push a patch soon. In the mean time. You can get by this by replacing os.mkdir(output_path.strip()) with os.makedirs(output_path.strip(), exist_ok=True) on line 4370

WASasquatch commented 1 year ago

This should be patched now.