ComfyUI Node

AIHub Expose Image

The node that hands your workflow an image from an external editor

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Expose Image
    • IMAGE
    • MASK
    • POS_X
    • POS_Y
    • LAYER_ID
    • WIDTH
    • HEIGHT
    idexposed_image
    labelImage
    tooltip
    typeupload
    index0
    optionalfalse

    AIHub Expose Image is the front door of this whole pack. It's the node that takes an image living in some other application - a GIMP layer, a Photoshop canvas, a video editor's frame, whatever - and drops it into your ComfyUI workflow as a proper IMAGE tensor you can feed into a sampler, a ControlNet, an img2img pass, anything.

    Here's the thing you need to understand before you even install it: this node does nothing by itself. AIHub (the "AIHub Workflow Exposer" pack, from the Otava-opisto educational org) isn't about typing in the ComfyUI web UI. It's a protocol for plugging ComfyUI into external editors so AI can be taught to people who'll never see a node graph. The AIHubExpose* nodes are the sockets the external app fills in. When a client - an image editor plugin built on the AIHub protocol - connects over the AIHub websocket (port 8111 by default) and runs your workflow, it uploads the image and the server injects the file path into this node's hidden inputs. Run the workflow bare in the web UI and you'll get a cheerful You must specify the local_file for this node to function error. That's not a bug; there's just no client behind you.

    What you actually set

    The inputs that matter are few:

    • type - the source of the image, and the interesting one. upload (the default) means the client sends a brand-new image with no canvas context. The other six are layer-aware: current_layer, merged_image, merged_image_without_current_layer, and the three *_intersection variants. The TL;DR: current_layer gives you just the layer the user is working on (with its position in the canvas), merged_image gives you everything flattened to canvas size, and the intersection variants give you one cropped to the other. For most workflows, upload or current_layer is all you'll ever want.
    • id - a unique string identifying this field in the workflow protocol. Keep it alphanumeric plus _ and -.
    • optional - if the client might not send an image, set this to true so the run doesn't hard-error when it's missing.

    Outputs

    Besides IMAGE and MASK, you get the geometry: POS_X, POS_Y (where the layer sits in the client's canvas), LAYER_ID, and WIDTH/HEIGHT. That's the useful bit if you're compositing results back into the editor - you can run img2img on a layer and pipe the output back with the same coordinates instead of it landing top-left. One gotcha: the mask comes out inverted from ComfyUI's own loader, and the pack flips it back (1.0 - mask), so treat MASK as normal.

    Install

    ComfyUI Manager → Custom Nodes Manager → search ComfyUI-aihub-workflow-exposer → Install, then restart. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    Then restart ComfyUI. There's no requirements.txt - the pack deliberately uses only what ComfyUI already bundles, so no pip install, no model downloads. You do need the AIHub folders created (ComfyUI/aihub/{loras,models,workflows} plus locale/), and your workflow should have an AIHubWorkflowController node with a unique id before any client will touch it.

    Where people get burned: they install, drop this node in, hit Queue, and get the local_file error. It's not broken - it's a server-side protocol node. Test it with a client (or set optional to true) before you blame the pack.

    Categoryaihub/expose

    Inputs (6)

    NameTypeDefaultDescription
    idSTRINGexposed_imageA unique custom ID for this workflow.
    labelSTRINGImageThis is the label that will appear in the field.
    tooltipSTRINGAn optional tooltip
    typeCOMBOuploadThe source of the image
    indexINT0This value is used for sorting the input fields when displaying; lower values will appear first.
    optionalBOOLEANfalseIf set to true, it will not raise an error if the image is not found

    Outputs (7)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    POS_XINT
    POS_YINT
    LAYER_IDSTRING
    WIDTHINT
    HEIGHTINT