Nodes/VRGameDevGirl Video Enhancement Nodes/๐Ÿ“‚ VRGDG Get File name Prefix
ComfyUI Node

๐Ÿ“‚ VRGDG Get File name Prefix

Extract a clean filename prefix from a folder path without thinking

By vrgamegirl19ยทCreated about a year agoยทUpdated about 7 hours agoยท 718
๐Ÿ“‚ VRGDG Get File name Prefix
    • Filename_Prefix
    โ—„folder_pathโ€”โ–บ

    VRGDG_GetFilenamePrefix is a small helper that takes a folder path and hands you back a string you can use as a file prefix. If you're staring at it in the middle of a VRGDG music-video or training graph, it exists to keep naming consistent across the pack's other nodes - so your scene folders, LLM batch folders, and output LoRAs all share one name and you can actually find things afterwards.

    You feed it folder_path (a plain string, no multiline) and it outputs Filename_Prefix. That's the whole node. In the pack's workflows it's wired in front of nodes that build output names, so you type a folder once and everything downstream inherits a coherent prefix instead of you hand-typing the same string into six different boxes and getting one of them wrong.

    When it earns its keep

    This is a utility in the "never alone in a graph" sense. It's most useful in the LTX-2.3 and Z-Image training-chunk graphs, where run_name and output_name have to match your workspace folder or the workflow can't tell which logs, states, and LoRAs belong to which run. Letting this node derive the prefix from the folder path is the pack author's way of removing that failure mode. If you rename the folder, the prefix follows along instead of silently desyncing.

    It's also handy outside the pack: any time a workflow needs a filename stem that should match a directory, this beats a hard-coded string.

    Setup and caveats

    It installs with the rest of the pack - Manager search "vrgamedev", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
    

    Restart ComfyUI afterwards, and note the pack's requirements.txt (kornia, librosa, imageio) if Manager doesn't pull them in.

    The only real trap is the obvious one: it does string extraction, not validation. It won't tell you if the folder exists, and on the author's Windows-native workflows the paths are backslashed (A:/MUSUBI/... is an author default, not a rule). If you point it at a path that doesn't exist yet, it still returns a prefix - which is fine if a node is about to create that folder, and silently wrong if you mistyped. Given the whole point is to avoid hand-typed strings drifting, double-check the one path you actually type, and let the node do the rest.

    Categoryutils/files

    Inputs (1)

    NameTypeDefaultDescription
    folder_pathSTRINGโ€”

    Outputs (1)

    NameTypeDescription
    Filename_PrefixSTRINGโ€”