ComfyUI Node

basicIn_media

One wire in, many out, and none of the wires are real

By cardenluo·Created 2 years ago·Updated a day ago· 332
basicIn_media
  • media
  • media

basicIn_media looks like the laziest node in ComfyUI and is quietly one of the more interesting ones. It takes one media input - typed as the union IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY - and gives the same value back out of one media output. The Python function is pass_through. No processing, no conversion, no options.

So why does it exist? Because of what the frontend does with it.

The hub trick

The pack's web/media_relay.js redefines this node in the canvas as a media hub. Drag a wire from a Loader into its socket and the frontend records that source in the node's own properties, disconnects the visible wire, and draws a curve from the original node to the hub instead. Do it again with a second source and the hub now holds two. Drag out of the hub's output into five consumers and the frontend fans those out the same way.

The upshot: you attach your material once - a reference image, a driving video, a music bed - and then pull from a single tidy node anywhere in the graph. The hub relabels itself with a count (Media (3)) so you can see at a glance what's inside. Nodes that are themselves relays are ignored as sources, which is what stops you from nesting hubs into a loop.

This is the shared-media layer under the pack's AD (MiniMax H3) workflows, where a half-dozen nodes all want the same reference set. If you've used AD_Media_editor, you've used this mechanic already - that node is a hub plus a prompt editor bolted on top. basicIn_media is the bare version, and it's the one I'd reach for when I just want the tray.

Using it

The only input is media, and it's required, so an unwired hub is an error rather than a silent no-op. The only output is media, and it goes anywhere you'd put the original value. That single union type in the socket signature is doing real work here: it's why the same node can hold a video for one consumer and a string for another without a type complaint.

The honest caveat is that a union socket is a promise about the type, not about the value. Feed a LATENT into the hub and out the other side into something that wanted an image, and nothing in the graph will stop you - you'll get the error wherever it lands. Relays don't convert; they only move things.

Installing it

ComfyUI Manager → search ComfyUI-Apt_Preset, or from a terminal:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r ComfyUI-Apt_Preset/requirements.txt

Restart afterwards. You'll find it under Apt_Preset → IO_Port.

Where it bites

The hub is frontend state. The list of sources you attached lives in the node's properties, not in a Python object, which is why the connections survive a save/load and why deleting the node throws that list away - adding a fresh hub gives you an empty one, not the old wiring.

And if the tray ever looks wrong - a hub that shows no count, a source that isn't drawn - check whether the pack's web/ assets actually loaded (the pack declares WEB_DIRECTORY = "./web") before you go looking for a bug in the graph. On a stale browser cache or a half-applied update you get a plain pass-through node with a socket and no memory, which works, just without the point of it.

When you need the material back out, basicIn_media_unpack does the reverse - including pulling one specific source out of a bundle by type and index, which is where this design stops being a gimmick and starts being useful in a real workflow.

CategoryApt_Preset/IO_Port

Inputs (1)

NameTypeDefaultDescription
mediaIMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY

Outputs (1)

NameTypeDescription
mediaIMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY