Nodes/ComfyUI_Fill-Nodes/FL String To Lora Name
ComfyUI Node

FL String To Lora Name

Bridge a plain STRING into the LoRA-loader dropdown type

By filliptm·Created 3 years ago·Updated 2 days ago· 632
FL String To Lora Name
    • lora_name
    lora_name

    ComfyUI's built-in LoRA loader doesn't take a plain string for its filename - it uses a special combo type populated straight from your loras folder, so the node only ever offers you file names that actually exist on disk. That's great for a static dropdown you click through by hand. It's a wall the moment you want the LoRA name to be dynamic - generated by a random picker, extracted from a caption, pulled from a batch config - because a plain STRING output can't plug into a socket that expects that special combo type. FL_StringToLoraName, a small utility from the Fill-Nodes pack (filliptm), exists solely to cross that gap.

    How it works

    Under the hood it calls ComfyUI's own folder_paths.get_filename_list("loras") to build the same list your regular LoRA loader dropdown uses, and re-declares its output as that type instead of a plain STRING. Whatever value you feed it or type into it gets passed through as that typed value - so as long as it matches an actual filename in your loras folder, any downstream LoRA loader node will accept it exactly as if you'd picked it from the dropdown yourself.

    The inputs and outputs that matter

    • lora_name - a plain STRING, default empty. Wire it from wherever your dynamic LoRA name is coming from (a random selector, a string built upstream, an extracted value), or type one in directly for testing.

    The output, also named lora_name, is the pack's synthesized combo type - the whole point of the node - meant to plug straight into a standard LoRA loader's name input where a plain STRING socket wouldn't be accepted.

    How to install it

    ComfyUI Manager: search "Fill-Nodes", install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    No special dependency - it's a thin wrapper around a function ComfyUI core already provides. Restart after cloning so the node registers.

    Common issues & troubleshooting

    Downstream LoRA loader errors or shows a blank selection. The string you pass in has to be an exact match for a filename already present in your loras folder - same spelling, same extension, same case on case-sensitive filesystems. There's no fuzzy matching or fallback; if the upstream string has a typo or points at a file that doesn't exist, the bridge doesn't fail loudly at this node, it just fails to resolve to anything usable downstream.

    Testing with a name that doesn't exist yet. If you're building the graph before the actual LoRA file is in place, this node will happily pass through a string that resolves to nothing - the error only shows up wherever the LoRA actually gets loaded. Worth double-checking your loras directory has the file before assuming this node is broken.

    Renamed or moved a LoRA file after building the workflow. Since this re-reads the folder list from ComfyUI's own filename registry, a renamed file just means the old string no longer matches anything - update whatever's producing the string upstream, not the node itself.

    Category🏵️Fill Nodes/Utility

    Inputs (1)

    NameTypeDefaultDescription
    lora_nameSTRING

    Outputs (1)

    NameTypeDescription
    lora_name