Nodes/ControlFlowUtils/๐Ÿ’พ Save Text File
ComfyUI Node

๐Ÿ’พ Save Text File

This node receives a file path and writes the contents of Text to the file in question, in UTF-8 plaintext format. The result of the operation is then returned by the Boolean Output SUCCESS?. Depending on the writing Mode of your choice, the file may be either Appended to (new lines will be added to the end of the file without changing the original content), Overwritten (the file will be removed and replaced with the contents of Text) or if Mode is set to New Only, the operation will fail if the file already exists and its contents will remain unchanged. Additionally, if the Mode is set to Append you may choose whether or not to add a New Line terminator at the end of the file, so that any subsequent writes start in a new line rather than being written contiguously. To specify a dynamic Text, convert the Text widget of this node to an input. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.

By VykosXยทCreated 2 years agoยทUpdated 2 years agoยท 147
๐Ÿ’พ Save Text File
    • SUCCESS?
    โ—„file_pathout.txtโ–บ
    โ—„modeโ–พโ–บ
    โ—„terminatortrueโ–บ
    โ—„textโ€”โ–บ
    Category๐Ÿบ VykosX-ControlFlowUtils

    Inputs (4)

    NameTypeDefaultDescription
    file_pathSTRINGout.txtAbsolute or relative path of the file to write to
    modeCOMBOMode that the file should be written as
    terminatorBOOLEANtrueWhether to include a new line after appending to the file
    textSTRINGText to write to the file. Right Click and convert to input to specify dynamicaly

    Outputs (1)

    NameTypeDescription
    SUCCESS?BOOLEANReturns True if the file was successfully written to, False otherwise