ComfyUI_Comfyroll_CustomNodes
ComfyUI_Comfyroll_CustomNodes copied to clipboard
CR_SaveTextToFile. File delimiter incompatible with Linux
Made the following changes highlighted in red boxes to support using this node in Linux OS's. Simple fix since module already imports the os module.
Don't forget to delete node's cached python import files for change to take effect. These files are in custom_nodes/ComfyUI_Comfyroll_CustomerNodes/pycache/ folder. Delete the cache files then restart Comfyui and node should work in Linux.
Also using "os.path.join()" is another way to fix this issue.
Meh, should have looked at the issue list before the code ... and obviously this breaks on a Mac, too. May I suggest something like:
$ diff -Naurw nodes_utils_text.py.orig nodes_utils_text.py
--- nodes_utils_text.py.orig 2025-03-22 17:07:48
+++ nodes_utils_text.py 2025-03-22 17:26:30
@@ -162,7 +162,7 @@
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/List-Nodes#cr-save-text-to-file"
- filepath = output_file_path + "\\" + file_name + "." + file_extension
+ filepath = os.path.join(output_file_path, file_name + os.extsep + file_extension)
index = 1