WASasquatch / was-node-suite-comfyui

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

"Save Text File" node does not work correctly #14

Closed BoosterCore closed 1 year ago

BoosterCore commented 1 year ago

I used "Text to Console" node to check in the CMD, every thing seems OK. It showed like this: got prompt WAS Node Suite Text Output: cyberpunk railway station cliff morning cinematic lighting dim lighting warm lighting hyperrealistic digital painting cinematic landscape concept art award-winning HD highly detailed attributes and atmosphere award-winning

But when I used "Save Text File" node to save the file. It got like this: cyb1680251075rpunk ra1680251075lway s1680251075a16802510751680251075on cl1680251075ff 1680251075orn1680251075ng c1680251075n16802510751680251075a16802510751680251075c l1680251075gh16802510751680251075ng d16802510751680251075 l1680251075gh16802510751680251075ng war1680251075 l1680251075gh16802510751680251075ng hyp1680251075rr1680251075al1680251075s16802510751680251075c d1680251075g16802510751680251075al pa1680251075n16802510751680251075ng c1680251075n16802510751680251075a16802510751680251075c landscap1680251075 conc1680251075p1680251075 ar1680251075 award-w1680251075nn1680251075ng HD h1680251075ghly d16802510751680251075a1680251075l1680251075d a16802510751680251075r1680251075bu16802510751680251075s and a16802510751680251075osph1680251075r1680251075 award-w1680251075nn1680251075ng

WASasquatch commented 1 year ago

Well that's not "write". Looks like it might be saving bytes for some reason. I'll take a look. Are you using Linux?

WASasquatch commented 1 year ago

See if this patch fixes the issue. Apparently some systems have different default encoding, so when using "w'' mode, which is for text, it can default to wrong mode. We're trying to make sure the file encoding is utf-8 now.

https://github.com/WASasquatch/was-node-suite-comfyui/blob/main/WAS_Node_Suite.py#L3493

BoosterCore commented 1 year ago

It is work perfectly now!Thanks!

WASasquatch commented 1 year ago

It is work perfectly now!Thanks!

Awesome! It also helps if I don't replace the text with time format, instead of the filename var. Oops.