Suzie1 / ComfyUI_Comfyroll_CustomNodes

Custom nodes for SDXL and SD1.5 including Multi-ControlNet, LoRA, Aspect Ratio, Process Switches, and many more nodes.
https://civitai.com/models/183551/comfyui-comfyroll-custom-nodes
502 stars 68 forks source link

CR Save Text to File Node does not work correctly #180

Open Joly0 opened 2 weeks ago

Joly0 commented 2 weeks ago

I have noticed, that files saved using that node use a "\" instead of "/" for the concatenation between the path string and the filename string. So when i put path as "/config/images" and the filename is "comfyui01.png", then the output path would be "/config/images\comfyui01.txt".

Somehow then this is not correctly saved and the file ends up as this "/config/56as4dfg56.txt"

I got around this by changing this line https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/d78b780ae43fcf8c6b7c6505e6ffb4584281ceca/nodes/nodes_utils_text.py#L165 to: filepath = output_file_path + "/" + file_name + "." + file_extension

I might assume, that this is only an issue on linux, as in windows the delimiter for paths is \ and not / like for linux.

Some check here might be useful. Though i think instead of checking the os, it should check the delimiter of the input path and try to parse, which one is used there

Though i noticed, with my change the path thats outputed in the log is shown as "/config/images//comfyui01.txt", so double // here, but its still saving correctly