AIHub Expose Image
The node that hands your workflow an image from an external editor
- IMAGE
- MASK
- POS_X
- POS_Y
- LAYER_ID
- WIDTH
- HEIGHT
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*_intersectionvariants. The TL;DR:current_layergives you just the layer the user is working on (with its position in the canvas),merged_imagegives you everything flattened to canvas size, and the intersection variants give you one cropped to the other. For most workflows,uploadorcurrent_layeris 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
trueso 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| id | STRING | exposed_image | A unique custom ID for this workflow. |
| label | STRING | Image | This is the label that will appear in the field. |
| tooltip | STRING | An optional tooltip | |
| type | COMBO | upload | The source of the image |
| index | INT | 0 | This value is used for sorting the input fields when displaying; lower values will appear first. |
| optional | BOOLEAN | false | If set to true, it will not raise an error if the image is not found |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| POS_X | INT | — |
| POS_Y | INT | — |
| LAYER_ID | STRING | — |
| WIDTH | INT | — |
| HEIGHT | INT | — |