Nodes/ComfyUI-DragAnything/VHS_FILENAMES_STRING
ComfyUI Node

VHS_FILENAMES_STRING

Grab the filename VideoHelperSuite just saved, as plain text

By chaojie·Created 2 years ago·Updated 2 years ago· 72
VHS_FILENAMES_STRING
  • filenames
  • STRING

This is a one-job adapter node, and the job matters more than it looks: it turns the VHS_FILENAMES output that VideoHelperSuite's save node gives you into a plain STRING holding the filename of the video you just wrote. That's the missing link in the infinite-video loop the author builds the whole cyclist workflow around.

Why does a filename matter? DragAnything generates a short clip. To keep generating forever, you save the clip, take its last frame, and feed that frame back in as the new starting image. To do that you need the path of the file you just saved, as text you can pass to the next node. VideoHelperSuite hands you a structured tuple; this node unwraps the last entry and hands you a string. It's a ten-line bridge, and it's the one that lets the loop close.

How it works

VHS's VHS_FILENAMES is really two things in one wire: a list of full paths and a list of filenames. The node's run method grabs the filename list and returns its last element - the file that was saved most recently, which is exactly the one you want in a loop that appends clip after clip.

The only input is filenames (type VHS_FILENAMES), and the single output is STRING. Nothing to tune, nothing to misconfigure. The one thing to know: you can't produce a VHS_FILENAMES wire without having VideoHelperSuite installed - this node consumes that type, it doesn't create it.

Wiring it up

Drag a VHS_VideoCombine (the save node from VideoHelperSuite) into your graph and connect its filenames output here. Take the STRING output and feed it wherever your loop needs the filename - in the cyclist workflows that's typically into a text/file step that tracks state between iterations.

Install

The node ships inside the ComfyUI-DragAnything pack, so you're installing the whole drag pipeline:

cd ComfyUI/custom_nodes
git clone https://github.com/chaojie/ComfyUI-DragAnything.git
cd ComfyUI-DragAnything
pip install -r requirements.txt

then restart ComfyUI. Or use ComfyUI Manager and search for "ComfyUI-DragAnything". See the DragAnythingPipelineRun article for the full run-down, including the three git-lfs model downloads and the pinned diffusers==0.19.3 requirement - those matter even if you only ever touch this tiny node, because the pack won't import cleanly without them.

Issues

The most common way to hit trouble here is purely a wiring gap: the node shows up red with a missing-input error because you haven't got VideoHelperSuite, so there's no VHS_FILENAMES source to connect. Install VideoHelperSuite and the wire type resolves. If the node is missing entirely after install, the pack's Python deps didn't land - pip install -r requirements.txt and restart, and don't skip the diffusers pin.

That's the whole node. Unspectacular, but it's the difference between a loop that runs forever and a script that stops after one clip.

CategoryDragAnything

Inputs (1)

NameTypeDefaultDescription
filenamesVHS_FILENAMES

Outputs (1)

NameTypeDescription
STRINGSTRING