Nodes/ComfyUI-SingleLinePicker/SLP Directory Contents
ComfyUI Node

SLP Directory Contents

Turn any folder into a clickable list — including your loras

By hetima·Created 7 months ago·Updated 6 months ago· 5
SLP Directory Contents
    • STRING
    path
    is_full_pathtrue
    SLP_formatfalse
    prefix

    SLP List View is great at picking from a list - but somebody has to build that list. SLP Directory Contents is the pack's answer: point it at a folder and it outputs the folder's contents as newline-separated text, which you feed straight into SLP List View's text input. Result: your loras folder (or prompt folder, or checkpoint folder) becomes a live, clickable menu with zero manual typing. It's the newest node in the pack, added in 1.3.1, and it closes the loop on "Get Lora List" by doing the same thing for any directory, on the backend, without a context-menu click.

    How it works

    Under the hood it's plain Python pathlib: it lists the target directory, sorts the entries, and joins them into one string. The important detail is IS_CHANGED, which always returns NaN - that tells ComfyUI the node's output never counts as "cached", so it re-reads the folder on every execution. Add a LoRA to the folder, re-run, and it shows up. No refresh button, no stale list.

    The inputs you'll actually touch:

    • path (required STRING) - the folder to read. Absolute paths are the safe choice; relative paths resolve against wherever ComfyUI was launched.
    • is_full_path (BOOLEAN, default True) - full absolute path per line, or just the filename. Flip to False when you want clean names.
    • SLP_format (BOOLEAN, default False) - when on, output becomes #dict-formatted (name:path per line), so the filename shows and the fuller value is what gets emitted.
    • prefix (STRING) - prepended to every line, handy for rebuilding subfolder paths.

    The README's example is the practical one: path = ComfyUI_models/loras/myLora, is_full_path = False, SLP_format = True, prefix = myLora/, and you get output ready for the SLP Lora Loader - relative folder/name paths, exactly what the loader expects.

    The single STRING output carries the whole list; SLP List View renders it one line per entry.

    Where people get tripped up

    • Empty output, no error. If path isn't a real directory the node silently returns an empty string. There's no red badge telling you the folder name was wrong - double-check the path spelling and that it actually exists before assuming the node is broken.
    • Absolute vs relative. With is_full_path on you get machine-specific absolute paths (C:\... or /home/...), which is great for your own machine but litters workflow JSON with paths that won't exist for whoever downloads it. For shareable workflows, keep full paths off.
    • It's for directories. Point it at a file and you get the empty string treatment again. Folders only.

    Install

    Same as the rest of the pack, one install, all five nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hetima/ComfyUI-SingleLinePicker
    

    or search ComfyUI-SingleLinePicker in ComfyUI Manager, then restart. No pip dependencies.

    The natural workflow is: Directory Contents → SLP List View → SLP Lora Loader, with SLP Filename Prefix catching the stem for your output names. It's a small pipeline, but it replaces the fiddly dance of retyping LoRA names in dropdowns every time you swap models.

    CategorySingleLinePicker

    Inputs (4)

    NameTypeDefaultDescription
    pathSTRINGPath to directory
    is_full_pathBOOLEANtrueOutputs as full path
    SLP_formatBOOLEANfalseOutputs for SLP List View
    prefixSTRINGPrefix for each output path

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGdirectory contents