ComfyUI Node

Load Image Full

The loader that also hands you the caption file

By nova452·Created 3 months ago·Updated a day ago· 524
Load Image Full
    • image
    • mask
    • filename
    • caption
    • metadata
    ◄image▾►

    Core Load Image gives you two wires: the image and a mask. That's usually enough, and then one day it isn't - you need to know which file went in, or you've got a folder of images with .txt captions sitting next to them and you'd rather use them than retype them.

    What it does

    Load Image Full is a single-image loader with five outputs. The first two you already know; the last three are the reason to switch:

    • image (IMAGE), mask (MASK) - same behaviour as core Load Image.
    • filename (STRING) - the name of the file you picked.
    • caption (STRING) - the contents of a sibling .txt with the same base name, or an empty string if there isn't one.
    • metadata (STRING) - the image's embedded info, dumped as key: value lines.

    The caption output is the interesting one. Same-name .txt next to the image is the universal convention for training datasets and for the captioning tools built around them, so this node is a two-second path from "folder of captioned images" to "prompt in the graph." Combined with the pack's Load Images (a whole directory, with the same five outputs as lists) and Load Image Newest (the most recent file by mtime, which is what you want when another tool is writing into that folder), you've got a small family of loaders that carry text alongside pixels.

    The filename output matters more than it sounds in a multi-reference editing workflow - Krea 2 and Ideogram 4 edit graphs pull in two or three images at once, and having the file name as a string means you can log it, branch on it, or build the prompt out of it.

    How it works

    The input is the standard ComfyUI image widget: a dropdown of files in ComfyUI/input/ plus the upload button, so you can drop a file straight onto the node. Behind it, the node mirrors core's pipeline - Pillow open, EXIF transpose, 16-bit I-mode images rescaled, converted to RGB float 0–1 - then walks outward for the extras. The mask is 1 - alpha when the image has an alpha channel (or palette transparency), and all zeros when it doesn't. That's the same inverted-alpha convention core uses, and the all-zero case catches people constantly: a JPG has no alpha, so your mask is black, and your inpainting produces nothing. It's not broken; there's nothing to read.

    caption is a straight read of image_name.txt in the same folder. metadata opens the file a second time and formats every entry in img.info as one line per key - PNG text chunks, including the workflow and prompt blocks ComfyUI itself writes, or whatever a JPEG carries. It is a dump, not parsed data. Wanting one field out of it means string surgery downstream, which is the node's one real limitation.

    It also hashes the file path and mtime for IS_CHANGED, so replacing the image on disk with the same file name does re-run the loader. That's not universal in this pack, and it's the correct behaviour.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/nova452/Rebalance-Pack.git
    # restart ComfyUI
    

    Or ComfyUI Manager → search Rebalance Pack (publisher nova452). The repo was renamed from ComfyUI-ConditioningKrea2Rebalance, so some links use the old name; GitHub redirects. Nothing to pip install, no model files, no requirements.txt - torch, numpy and Pillow are all already there.

    Where it bites

    The dropdown is a snapshot of ComfyUI/input/ taken when the node's inputs are built. Files you drop into that folder from outside ComfyUI while the server is running may not show up until you refresh the node definitions or restart. Same class of annoyance as core Load Image; upload through the node and it's instant.

    Only files directly in ComfyUI/input/ are listed - subfolders aren't walked. If you keep references organised in directories, use the pack's Load Images node pointed at an absolute path instead; it takes a directory_path string and will happily read anywhere.

    Caption requires an exact base-name match. portrait_01.png needs portrait_01.txt in the same folder. Anything else and you silently get an empty string - which then flows into your prompt as nothing, and you don't find out until you wonder why the subject changed.

    And remember the mask output is alpha, not content. If you want a mask derived from what's in the picture, that's a segmentation or depth node, not this.

    CategoryRebalance-Pack/foundational

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (5)

    NameTypeDescription
    imageIMAGE—
    maskMASK—
    filenameSTRING—
    captionSTRING—
    metadataSTRING—