Nodes/BrainDead Nodes/BD Load Image + Name
ComfyUI Node

BD Load Image + Name

Load an image and keep its name — so every export lands in a folder named after the source

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Load Image + Name
    • image
    • mask
    • scene_name
    image

    Same as Load Image, plus one thing - and that one thing is the whole point. BD_LoadImageWithName loads an image the ComfyUI way (picker dropdown over your input folder) and also emits a scene_name STRING with the file's name, no extension. Wire that into an export node's filename, and every output for that image lands in a folder named after the source file, automatically.

    Why is that worth a dedicated node? Because batch pipelines that process "scene after scene" need to organize their outputs per source, and hand-typing the scene name into a save node - or worse, editing the workflow between runs - is exactly the kind of manual step that produces "output_0427_final_v3_actual.png" sprawl. This node closes the loop: the name comes from the file, so it can't get out of sync with the input.

    It lives under 🧠BrainDead/Segmentation in the pack, right alongside the parts/export machinery - because its job is really "name the outputs for a parts or PBR export pass by the source image."

    How it works

    The image input is a COMBO dropdown listing images in ComfyUI's input folder (upload supported), same as the built-in Load Image. It returns:

    • image - the loaded IMAGE tensor.
    • mask - the alpha (or luminance) extracted as a MASK, same behavior as the pack's path-based BD Load Image.
    • scene_name - the filename without extension. hero_01.pnghero_01.

    That's the entire difference from the built-in loader: the extra STRING output. From there, wire scene_name into a BD FilenameTemplate or a save node's name/prefix field, and your exports self-organize.

    The obvious pattern

    BD Load Image With Name (hero_01.png)
      ├─ image        → segmentation / parts / PBR chain
      └─ scene_name   → BD FilenameTemplate %name%  → save node
    

    Every scene you switch to in the dropdown renames its own outputs. That's the batch-superpower: process 40 images without touching a single filename.

    Install

    Part of the BrainDead pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BizaNator/ComfyUI-BrainDead
    cd ComfyUI-BrainDead
    pip install -r requirements.txt
    

    Or search "BrainDead" in ComfyUI Manager and restart. No extra dependencies.

    Troubleshooting

    • scene_name is empty or unexpected - it's derived from the dropdown selection's filename; check which file is actually selected.
    • You need a path-based load, not a dropdown - if the file is chosen dynamically (e.g. from a cache path), use the pack's BD Load Image instead; this node is picker-first.
    • Folders still land in the wrong place - scene_name gives you the name, not the path; combine it with a template that includes a folder structure.
    Category🧠BrainDead/Segmentation

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    scene_nameSTRING