ComfyUI Node

ZEGR_LF

A Model Picker That Hands You a File Path, Not a Tensor

By Positliver·Created 2 years ago·Updated 2 years ago· 1
ZEGR_LF
    • file_path
    file_typeloras
    custom_file_type
    checkpoint_name
    unet_name
    lora_name

    Load Checkpoint and Load LoRA already give you dropdowns for everything in a model folder. ZEGR_LF gives you the same dropdowns and then does something those loaders don't: it outputs the absolute path to the chosen file as a plain string, without loading anything into VRAM. That's the entire node, and it's exactly what it's for.

    Its main job in this pack is feeding ZEGR_ALI_UF, the uploader. That node wants a file_path, and ZEGR_LF hands you one from the same file lists you already recognize. It's also handy whenever some other tool in your graph wants "a path to a model on disk" - a converter, an export node, a custom script - where loading the actual tensors would be a waste.

    The inputs, and the one trap

    • file_type - an enum: loras, checkpoints, or unet. This picks which ComfyUI model folder the node looks in.
    • custom_file_type - a free-text override. If it's non-empty, it wins over file_type, and it can name any folder ComfyUI knows about (vae, clip, diffusion_models, embeddings...).
    • checkpoint_name, unet_name, lora_name - the dropdowns, one per model type.

    Here's the trap: all three dropdowns are required inputs, but only one of them is used. The active one is the one matching your file_type (or custom_file_type). Set file_type to checkpoints and only checkpoint_name matters; the other two dropdowns sit there ignored because ComfyUI demands every required widget exist. A lot of first-time confusion comes from staring at three model pickers and wondering which to touch. Answer: the one whose label matches.

    Output and mechanism

    Output is file_path, a STRING holding the absolute path. Under the hood it's a one-liner: folder_paths.get_full_path_or_raise(folder, filename), which resolves the file against your ComfyUI model directory and raises if it's missing.

    Two compatibility notes. First, get_full_path_or_raise is a newer helper in ComfyUI's folder_paths module - it landed in 2024, so this node wants a ComfyUI from roughly the last year or two; on an ancient install you'd get an AttributeError instead of a path. Second, custom_file_type only works for folders ComfyUI actually knows about. Ask for something it doesn't recognize and you'll get Model in folder 'x' with filename 'y' not found.

    Install

    Same pack, same steps as ZEGR_ALI_UF: ComfyUI Manager → search comfyui-zegr → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Positliver/comfyui-zegr
    

    Then restart ComfyUI. It shows up under File Operations, takes no model files, and its only real dependency is having a reasonably current ComfyUI. If you just want to know where a model file lives on disk, this is the least ceremony you'll find.

    CategoryFile Operations

    Inputs (5)

    NameTypeDefaultDescription
    file_typeCOMBOloras3 options: loras, checkpoints, unet
    custom_file_typeSTRING
    checkpoint_nameCOMBOThe name of the Checkpoint.
    unet_nameCOMBOThe name of the unet.
    lora_nameCOMBOThe name of the lora.

    Outputs (1)

    NameTypeDescription
    file_pathSTRING