ComfyUI Node

basicIn_media

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

By cardenluo·Created 2 years ago·Updated about 15 hours ago· 344
basicIn_media
    • media
    • cached_media_2
    • cached_media_3
    • cached_media_4
    • cached_media_5
    • cached_media_6
    • cached_media_7
    • cached_media_8
    • cached_media_9
    • cached_media_10
    • cached_media_11
    • cached_media_12
    • cached_media_13
    • cached_media_14
    • cached_media_15
    • cached_media_16
    • cached_media_17
    • cached_media_18
    • cached_media_19
    • cached_media_20
    • cached_media_21
    • cached_media_22
    • cached_media_23
    • cached_media_24
    • cached_media_25
    • cached_media_26
    • cached_media_27
    • cached_media_28
    • cached_media_29
    • cached_media_30
    • cached_media_31
    • cached_media_32
    • cached_media_33
    • cached_media_34
    • cached_media_35
    • cached_media_36
    • cached_media_37
    • cached_media_38
    • cached_media_39
    • cached_media_40
    • cached_media_41
    • cached_media_42
    • cached_media_43
    • cached_media_44
    • cached_media_45
    • cached_media_46
    • cached_media_47
    • cached_media_48
    • cached_media_49
    • cached_media_50
    • cached_media_51
    • cached_media_52
    • cached_media_53
    • cached_media_54
    • cached_media_55
    • cached_media_56
    • cached_media_57
    • cached_media_58
    • cached_media_59
    • cached_media_60
    • cached_media_61
    • cached_media_62
    • cached_media_63
    • cached_media_64
    ◄cached_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
    cached_mediaSTRING[]—

    Outputs (64)

    NameTypeDescription
    mediaIMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_2IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_3IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_4IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_5IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_6IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_7IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_8IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_9IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_10IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_11IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_12IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_13IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_14IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_15IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_16IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_17IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_18IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_19IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_20IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_21IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_22IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_23IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_24IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_25IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_26IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_27IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_28IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_29IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_30IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_31IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_32IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_33IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_34IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_35IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_36IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_37IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_38IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_39IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_40IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_41IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_42IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_43IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_44IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_45IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_46IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_47IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_48IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_49IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_50IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_51IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_52IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_53IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_54IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_55IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_56IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_57IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_58IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_59IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_60IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_61IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_62IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_63IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—
    cached_media_64IMAGE,VIDEO,AUDIO,LATENT,STRING,ARRAY—