Nodes/ComfyUI-ControlOrder-FreeMemory/πŸ“ Filename Selector
ComfyUI Node

πŸ“ Filename Selector

The tiny filename helper that lets Control Order chain into loader nodes

By mkim87404Β·Created 5 months agoΒ·Updated 5 months agoΒ· 23
πŸ“ Filename Selector
    • STRING
    β—„stringβ–Ί

    πŸ“ Filename Selector is a one-trick node, and the trick is oddly necessary. When you use the πŸ”· Control Order & Free Memory node to chain a loader - Load Model, Load VAE, Load CLIP - into your sequence, you'll hit a wall: most loaders have no real input slot except the "filename" combo box where you pick a model from a dropdown. You can't select a file in a dropdown you're feeding programmatically. This node gives you a filename as a plain, editable string that you can route through the Control Order node into that combo field.

    It's exactly as boring as it sounds, which is the point. You drop it in, click Select Filename, pick a file from your native OS file picker, and the file's name lands in the text box, ready to be tweaked or fed downstream.

    How it works

    Under the hood there's not much to it. A small JavaScript extension adds a Select Filename button widget to the node. Clicking it creates a hidden <input type="file"> element and opens your OS file dialog; when you pick something, the browser hands back the file's name and the JS writes it into the string widget. The Python side just returns that string untouched. Importantly, it grabs the filename only - browsers won't hand over a full filesystem path for security, and loaders only match against filenames in your models folder anyway.

    That "Select Filename" button is frontend-only and deliberately not serialized into the workflow JSON, so if you're running ComfyUI headless or via API you'll just type the string manually. Also worth knowing: like most custom nodes, this one extends the frontend via JS hooks, and it's the same mechanism the README flags as fragile against future ComfyUI updates - but a broken button is a non-disaster, since the string widget still works by hand.

    The only inputs and outputs

    • string (STRING, default "", not multiline) - pick a file and/or edit the name here. This is what you actually set.
    • STRING (output) - the final string for downstream use, wired into the Control Order node's persist_any_N input that corresponds to the loader's filename field.

    That's the whole thing. No options, no models, no hidden gotchas beyond making sure the filename - extension included - matches exactly what's in your ComfyUI models directory, because loaders match literally.

    Installing it

    There's no separate install. Filename Selector ships inside the same pack as the Control Order & Free Memory node, so search Manager for "Control Order & Free Memory", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mkim87404/ComfyUI-ControlOrder-FreeMemory.git
    

    Restart ComfyUI and search for "Filename Selector". No dependencies, no model downloads. If you ever find yourself hand-typing model filenames into a chain of Control Order nodes, this is the node that keeps you from fat-fingering them - small, but the kind of helper you don't miss until it's gone.

    CategoryControl Order & Free Memory

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRINGSelect a filename and further edit the string here.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGFinal string for downstream use