Nodes/Y7Nodes for ComfyUI/Y7 Caption Saver
ComfyUI Node

Y7 Caption Saver

Caption Saver<div style="font-size: 0.8em"><div id="Y7_shortdesc" style="margin-bottom: 15px;">Save a caption string as a .txt file next to the source image, using the same filename stem.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Designed to pair with ImageBatchPath and JoyCaption (or any VLM that outputs a STRING): connect <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">IMAGE_PATH</code> from ImageBatchPath and the caption <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">STRING</code> from JoyCaption.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Compatible with any node that outputs a STRING — not limited to JoyCaption. Examples: Florence2, MiniCPM, LLaVA, Qwen-VL, etc.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Example: <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">cat.jpg</code> → <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">cat.txt</code> saved in the same directory.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Inputs:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">string</code>: The caption text to write (required, must be connected)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">image_path</code>: Full path to the source image (required, must be connected — e.g. from ImageBatchPath)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">overwrite</code>: If true, overwrites any existing .txt file. If false, appends a counter to avoid overwriting (e.g. <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">cat_01.txt</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">cat_02.txt</code>)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">This node has no outputs — it is a terminal/output node.</div></div>

By yushan777·Created about a year ago·Updated 23 days ago· 7
Y7 Caption Saver
      string
      image_path
      overwritetrue
      CategoryY7Nodes/CaptionTools

      Inputs (3)

      NameTypeDefaultDescription
      stringSTRING
      image_pathSTRING
      overwriteBOOLEANtrueIf false, appends a number to avoid overwriting existing files

      Outputs (0)

      No outputs