Nodes/ComfyUI-InpaintCanvas/Inpaint Canvas Load Ref
ComfyUI Node

Inpaint Canvas Load Ref

The loader that reads ComfyUI's own file references

By DenRakEiw·Created 3 days ago·Updated about 20 hours ago· 10
Inpaint Canvas Load Ref
    • image
    ref

    Inpaint Canvas Load Ref exists because ComfyUI's built-in Load Image has a blind spot: its dropdown only lists files sitting in the top level of the input folder. Load an image from a subfolder - or from output, or from temp - and the standard loader can't see it.

    Inpaint Canvas stores its working files in subfolders on purpose: uploads go to input/inpaint_canvas/, results to output/inpaint_canvas/, helper results to temp/inpaint_canvas/. When the editor's helper prompts need to feed one of those files back into a model - say, the canvas's own flattened image into a segmentation or upsampling chain - they can't use Load Image. So this node takes the same {filename, subfolder, type} JSON reference that ComfyUI itself bakes into every saved workflow image, and turns it into an IMAGE.

    What you'll see

    One required input, one output. Nothing else.

    • ref - a STRING containing JSON: {"filename": "photo.png", "subfolder": "inpaint_canvas", "type": "input"}. type is input, output or temp, matching ComfyUI's directory layout.
    • image - the loaded image.

    In practice you will almost never type this by hand. The node appears inside the helper-prompt graphs the editor queues in front of the generation chain - the ones that run only the segmentation or vision-language-model nodes they need, never your sampler. If you're hand-building one of those chains, Load Ref is the piece that reads a freshly written helper file.

    The clever bit

    Load Image reads a file once at workflow build time and caches it. This node deliberately doesn't: its change detection checks the file's modification time, so if the canvas writes a new version of the same file, re-running the queue picks up the new pixels. That's exactly what a helper prompt needs when the result depends on the current state of the canvas, not the state from when you dragged the workflow in.

    Installing it

    It's part of the pack, so it comes with Inpaint Canvas:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DenRakEiw/ComfyUI-InpaintCanvas
    

    Restart ComfyUI. No extra dependencies, no models.

    Common issues

    • Malformed ref. The node parses the JSON on every run. A missing quote or a typo'd key throws immediately - check the string is exactly {filename, subfolder, type}.
    • File not in a ComfyUI directory. The reference only resolves against input, output and temp. Point it at an absolute path and it fails.
    • Using it when Load Image would do. If your file is at the top level of input, the built-in loader is simpler. Reach for Load Ref when the file lives in a subfolder or in output/temp, or when it changes between runs and you need the fresh copy.

    It's a helper node in the truest sense - small, invisible when things work, and the thing that makes the editor's text-segmentation and prompt-upsampling helpers possible at all.

    Categoryimage/inpaint

    Inputs (1)

    NameTypeDefaultDescription
    refSTRINGJSON {filename, subfolder, type} of a file in the ComfyUI input/output/temp directories.

    Outputs (1)

    NameTypeDescription
    imageIMAGE