ComfyUI Node

XImageGet

The node that pulls images (and masks) out of XDataHub

By Xz3r0-M·Created 8 months ago·Updated about 6 hours ago· 13
XImageGet
    • image
    • mask
    media_ref
    x_mask_ref
    x_paint_ref
    x_transform_state
    output_placeholderfalse

    ComfyUI's built-in Load Image requires a file that already exists on disk, and if you're iterating on a source image, you're saving and re-loading constantly. XImageGet is the XDataHub approach: images arrive from the pack's web panel and the node picks up the latest one, no file dialog, no path typing. And because it's built for an inpainting-friendly workflow, it also carries masks and paint layers from the pack's X Mask Editor - so a single node can hand you both the image and its mask, which is a surprisingly rare combination in ComfyUI.

    How it works

    The main input, media_ref, is a hidden string field filled in by the XDataHub panel - the same opaque-ref pattern as XAudioGet. An empty ref means no output. When it's set, the node resolves it to a file, loads the image, and emits an IMAGE. The bridge that connects panel to node (xz3r0_utils/xdatahub_bridge.py) keeps the latest snapshot in memory with a revision counter, so re-running the workflow picks up what was last sent.

    The interesting part is what comes with it. x_mask_ref and x_paint_ref are separate references to files written by the X Mask Editor - the mask is its own grayscale file and the paint layer is its own RGBA file, deliberately kept separate from the base image so the image's alpha channel stays clean. x_transform_state carries rotation and flip state from the editor. The author's design comment is worth quoting in spirit: the mask source is always the separate mask file, never a merged alpha, so you never get alpha pollution in the base image. That's a real correctness choice, not cosmetic.

    Inputs and outputs

    • media_ref - the XDataHub image ref. Managed by the panel; empty = no output.
    • x_mask_ref / x_paint_ref - X Mask Editor output refs (optional, in the same annotated-path format).
    • x_transform_state - editor transform state (rotation + flip).
    • output_placeholder (default false) - when true and no image is available, outputs a 1x1 black placeholder instead of nothing, which keeps downstream nodes from erroring on a missing image.

    Outputs: image (IMAGE) and mask (MASK, from the editor's separate mask file).

    Installing it

    XImageGet is in ComfyUI-Xz3r0-Nodes. Install the pack once - ComfyUI Manager (search ComfyUI-Xz3r0-Nodes) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Xz3r0-M/ComfyUI-Xz3r0-Nodes.git
    cd ComfyUI-Xz3r0-Nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. Like the other XDataHub get-nodes, it has no extra Python dependencies beyond the pack's ffmpeg-python.

    Gotchas

    The core one is the same as XAudioGet: this is not a file loader. No panel, no image. You feed it from XDataHub, so it's only useful if you're running that part of the pack. Second, output_placeholder is a real trap in both directions - with it on, a stale ref silently gives you a black 1x1 image that can ruin a batch without an obvious error; with it off, an empty ref gives you None, which downstream nodes may reject. Pick based on whether you want a visible failure or a silent one. And the mask only appears if you've actually used X Mask Editor; a plain image send gives you an image and an empty mask output.

    Category♾️ Xz3r0/XDataHub

    Inputs (5)

    NameTypeDefaultDescription
    media_refSTRINGXDataHub media ref (empty means no output)
    x_mask_refSTRINGX Mask Editor output ref (separate mask file, annotated path format)
    x_paint_refSTRINGX Mask Editor paint layer ref (separate RGBA paint file, annotated path format)
    x_transform_stateSTRINGX Mask Editor transform state (rotation + flip)
    output_placeholderBOOLEANfalseOutput a 1x1 black placeholder image when no image is available

    Outputs (2)

    NameTypeDescription
    imageIMAGELatest image received from XDataHub
    maskMASKMask from X Mask Editor (separate grayscale mask file)