ComfyUI Node

DP Load Image V2

The minimal loader, plus the source format as a string

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Load Image V2
    • image
    • mask
    • filename
    • dp_prompt
    • dp_negative_or_other
    • image_format
    image
    resize_imagetrue
    width1024
    height1024
    preserve_alphatrue

    This is functionally the same as the pack's DP Load Image Minimal - load, optional resize, optional alpha preservation, pull whatever generation metadata is embedded - with one extra output: image_format, a string reporting what format the source file actually was (PNG, JPEG, etc.). If you need to know or log the original format of whatever you loaded, this is the loader that tells you.

    How it works

    image picks a file the standard ComfyUI way, from your input folder's dropdown. resize_image with width/height gives you an optional resize on load. preserve_alpha keeps transparency intact instead of flattening it. As with the pack's other loaders, dp_prompt and dp_negative_or_other pull embedded generation metadata out of the file if it's there.

    The one thing this node adds over the Minimal version is image_format. That's useful in a couple of concrete ways: routing save logic based on the source format (re-save a PNG as PNG, convert everything else to something else), or just logging it for your own record-keeping when a workflow processes a mixed batch of file types.

    Inputs and outputs

    Required:

    • image - enum dropdown, ComfyUI's input folder.
    • resize_image - boolean, default true.
    • width / height - 64 to 2048, default 1024 each.
    • preserve_alpha - boolean, default true.

    Outputs:

    • image - the loaded (and optionally resized) image.
    • mask - the alpha-derived mask, if present.
    • filename - source filename as a string.
    • dp_prompt / dp_negative_or_other - extracted generation metadata, if present.
    • image_format - the source file's format, as a string.

    How to install it

    Search ComfyUI-Desert-Pixel-Nodes in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
    

    Restart, find it under DP/image. No models, no dependencies - a plain image loader with one extra metadata output.

    Common issues & troubleshooting

    Transparency missing. Same as the Minimal loader - check preserve_alpha is on. Off, and the alpha channel gets flattened away rather than passed through as a usable mask.

    dp_prompt/dp_negative_or_other are empty. Only populated when the source file actually has embedded generation metadata. A plain photo or a re-compressed JPEG typically has nothing to extract, and that's expected rather than a bug.

    Resize distorts proportions. resize_image is a hard resize, not aspect-preserving - a source with different proportions than your target width/height will stretch. Turn it off if you want the native aspect ratio kept.

    Not sure whether to use this or Minimal. If you don't need image_format, either works identically otherwise - use whichever one's output list better matches what you're wiring downstream, so you're not leaving an unused port dangling. If you already have Minimal wired up and just realized you need the format string, swapping to V2 is a drop-in change; the rest of the inputs and outputs line up one for one.

    CategoryDP/image

    Inputs (5)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    resize_imageBOOLEANtrue
    widthINT102464–2048
    heightINT102464–2048
    preserve_alphaBOOLEANtrue

    Outputs (6)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    dp_promptSTRING
    dp_negative_or_otherSTRING
    image_formatSTRING