ComfyUI Node

Rename File

Rename File

By huyl3-cpu·Created 9 months ago·Updated 4 months ago· 1
Rename File
    • output_file_path
    input_file_path
    new_file_name

    Does what it says: pick a file, give it a new name, get the new path back. The one thing worth understanding before you drop it in a graph is how the file-picking input actually behaves, because it's not the plain text field you might expect.

    How the picker works. input_file_path is a dropdown rather than a free-text field, and its options are populated dynamically rather than being a fixed list baked into the node - this is a standard ComfyUI "combo" widget pattern, where the actual choices get generated by the node's Python at graph-load time rather than declared statically. In practice, that means the dropdown will show you whatever files ComfyUI can currently see, not something you can predict from the schema alone - you genuinely need to open it in the UI and look, rather than trust a description of what should be in there.

    Inputs and outputs. Required: input_file_path (the dynamic dropdown described above) and new_file_name (a plain string). The output is output_file_path - and it's worth noting this is typed as a list (is_list: true) even though you're renaming what sounds like a single file. That's a sign this node is meant to be dropped into a pipeline that already deals in lists of paths, rather than one file at a time - likely so it chains cleanly after something like Folder File Scanner without needing a type conversion in between.

    This node's category, HuyL3/File, is worth a passing note too - it's the author's own name (or handle) rather than a generic category like the comfyui-sortlist bucket most of this pack's other nodes sit under, which is a small but consistent signal, alongside the underscore-prefixed loop nodes and the Vietnamese-labeled config panels, that this whole collection was assembled piece by piece for personal use rather than designed top-down as a public release.

    Installing it. Search comfyui-huyl2-nodes in ComfyUI Manager, or clone directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/huyl3-cpu/comfyui-sortlist
    

    Restart ComfyUI.

    Troubleshooting. If the input_file_path dropdown looks empty or stale, that's almost always a refresh issue rather than a bug - dynamic combo widgets in ComfyUI populate from whatever the node's Python reports at the moment the graph loads, so a file you created after loading the workflow simply won't show up until you reload the page or re-add the node. If output_file_path comes back empty after a run, check whether new_file_name collides with something that already exists in the same folder - there's nothing in the schema indicating an overwrite policy one way or the other, so don't assume it's safe to rename onto an existing filename without checking first.

    CategoryHuyL3/File

    Inputs (2)

    NameTypeDefaultDescription
    input_file_pathCOMBO2 options: *, [object Object]
    new_file_nameSTRING

    Outputs (1)

    NameTypeDescription
    output_file_pathSTRING