Nodes/JSON Dynamic Loader/Preview to Load Image
ComfyUI Node

Preview to Load Image

Preview an image, then push it into LoadImage with one click

By ethanfel·Created 7 months ago·Updated 2 months ago· 2
Preview to Load Image
  • images
  • mask
    filenamepreview

    The classic ComfyUI loop: generate an image, look at it, decide it's the reference you want for the next step, then hunt for the file in output/, retype its name into a LoadImage node, and hope you got the right run. Preview to Load Image collapses that whole dance. It previews your image like the built-in PreviewImage node, quietly also saves a copy into ComfyUI's input/ folder, and then hands you a button that sets a LoadImage node's selector to that exact file.

    How it works

    It's the pack's bridge node, and it does two distinct jobs. On execution it writes the preview to ComfyUI's temp/ directory (same as PreviewImage - scratch, meant to be cleared) and saves a permanent copy as input/{filename}.png, where filename is the widget value (default preview, extension added for you). The saved copy gets the workflow's prompt/workflow metadata embedded, same as a normal save.

    Then the JS side adds the ergonomics: a load_image_node_id widget plus a Send to Load Image button. Run the workflow once (the node records which file it saved), type the target LoadImage node's ID into the widget, click the button, and the target's image dropdown updates immediately - no restart, no manual retyping.

    The mask trick worth knowing

    The optional mask input is what makes this more than a convenience. If you connect a mask, it's embedded as the saved PNG's alpha channel - with the polarity flipped so that when LoadImage reads the file back, its MASK output is exactly your mask again. So the full loop is: inpaint or segment something, get a mask, push image+mask through this node to a LoadImage, and the downstream pipeline receives both. That's a genuinely useful pattern for multi-stage workflows where a later stage needs to treat an earlier output as input.

    Inputs and gotchas

    • images (IMAGE, required) - what to preview/save.
    • filename (STRING, default preview) - the input/ name. Repeated runs overwrite the same file, which is fine for the handoff pattern but means it's not a history.

    The two places people get caught: the Send to Load Image button needs a completed run first (it only knows the filename after execution), and the target node ID is the numeric ID you see in the node's titlebar/context menu, not the node name. If you get "No filename available," run the workflow once; if "No node found," check the ID.

    There's also a Send to Channel button here - the sending half of the pack's channel system, pairing with Image Receiver (Channel) for cross-workflow handoffs.

    Install

    Part of ComfyUI-JSON-Dynamic. ComfyUI Manager → search JSON Dynamic Loader, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ethanfel/ComfyUI-JSON-Dynamic.git
    # restart ComfyUI
    

    No dependencies beyond the bundled JS.

    Verdict

    If you've ever cursed while retyping filenames into LoadImage, this is the node for you - and the mask round-trip makes it quietly more powerful than a pure UI convenience.

    CategoryJSON Dynamic/image

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGE
    filenameSTRINGpreview
    maskoptMASK

    Outputs (0)

    No outputs