Nodes/ViewComfy Utils/ViewComfy - Load Image
ComfyUI Node

ViewComfy - Load Image

Load Image That Doesn't Explode When Nothing Is Selected

By ViewComfy·Created 11 months ago·Updated 8 months ago· 8
ViewComfy - Load Image
    • IMAGE
    • MASK
    imageNone

    The stock ComfyUI Load Image node has one personality flaw: if you haven't picked an image, it errors out, and it takes the whole workflow down with it. The ViewComfy Load Image is the same node with that flaw filed off. Its dropdown always includes a "None" option, and when that's selected - or the file you named is missing - it quietly returns None instead of throwing. That one change is what makes a workflow runnable as an app or an API where the image input is optional.

    The inputs and outputs look almost identical to the core node, which is deliberate. One image dropdown listing the files in your input folder plus None, and two outputs: IMAGE (the standard BATCH-style tensor) and MASK. The differences are all in the edge cases. Select "None" and it returns None - no error, no crash - so anything downstream with an optional input just skips it. The source also handles animated images (multi-frame GIFs become a batch), transposes EXIF orientation, and converts an alpha channel into a mask the same way core ComfyUI does.

    Why this exists: the ViewComfy team built these utilities to power their app platform, where a workflow gets wrapped in a web UI and the user may or may not upload an image. A core Load Image would hard-fail the moment the upload slot was left empty. This node turns "no image" into a legitimate state the rest of the graph can branch on - wire its IMAGE output into a Conditional Select or Compare, and you've got proper optional-input handling. That's a real need even outside the platform: any workflow you plan to share, template, or script benefits from not bricking on an empty field.

    A couple of things worth knowing from the code. It uses the file's hash to detect changes, so re-saving a file under the same name actually triggers a re-run (the core node can be lazy about this). And there's a VALIDATE_INPUTS that accepts None as a legitimate value, which is exactly the safety valve the stock node lacks. If you're expecting it to behave differently from Load Image beyond the None handling, you'll be pleasantly surprised - it's a faithful clone plus the one feature.

    The trap to watch: returning None means the IMAGE output can be a genuine Python None at runtime. If you pipe that straight into a node with a required IMAGE input, that node will fail instead. The None return only works when the destination treats the input as optional or you gate it with a logic node. Plan the branch before you wire it, and you're fine.

    Installation is standard for the pack - ComfyUI Manager → search "ViewComfy-Utils" → install, or clone by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ViewComfy/ViewComfy-Utils
    

    Restart ComfyUI after. No extra dependencies beyond stock ComfyUI, no model downloads, MIT licensed. If you build workflows that get shared or wrapped in a UI, this is one of those quiet nodes that saves you a specific, annoying failure mode every single time.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBONone2 options: example.png, None

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK