ComfyUI Node

EzFlex-MediaOut

Turn a Media Card Into Real Wires

By blackbossokok·Created 20 days ago·Updated about 15 hours ago· 1
EzFlex-MediaOut
  • card
    config{}

    EzFlex-MediaLoader is where you collect files. EzFlex-MediaOut is where they become something the rest of ComfyUI understands.

    Its input is one dark-red EZFLEX_MEDIA_CARD socket - the card object MediaLoader hands out, which by design refuses to connect to anything else - and its outputs are ordinary IMAGE / VIDEO / AUDIO / FILE_3D / STRING ports. Those are the same types the built-in loaders produce, so a LoadImage-shaped graph works fine downstream of here.

    Modes: the decision that determines your port layout

    Four buttons at the top of the panel:

    • split - one output port per file. Predictable, verbose, and what you want when files differ in type or size.
    • card - one file per card, merged into a single port per card.
    • card group - one port per group of cards.
    • group - one port for everything in the group.

    In split mode, a file you're not using will get an actual port. Think about that as the port count follows the card.

    How merging actually behaves

    When a single port carries several files, the node has to produce something a downstream node can legally read, and it does the obvious things:

    • Multiple images → a batched tensor [B,H,W,C], which feeds any IMAGE input. Want them separate again? ImageFromBatch / RebatchImages are the core nodes for that.
    • Multiple audio clips → joined in time into one track. Sample rates must match; mono gets upmixed.
    • Multiple texts → joined with newlines.
    • Mixed types, or audio with mismatched sample rates → an explicit error telling you to use split mode. The port degrades to * and its hover label shows ×N files so you can at least see what happened.

    Mismatched image sizes are handled by a rule you choose in the batch settings: target size "first image" or a custom size, fit "crop" / "pad" / "stretch", "max images" (0 = all), "start at" (0-based). The pack deliberately mirrors the KJNodes Load Images From Folder vocabulary, so there's nothing new to learn - stretch squashes, crop scales and center-crops, pad scales to fit and fills with the edge colour, and channel mismatches are padded to the max with alpha 1.0. The console prints which rule it used, which is the line to read when a batch looks wrong.

    The disable switches, and the sneaky part

    Every file has an on/off toggle. In split mode, a disabled file keeps its port and emits None - so re-enabling doesn't mean re-wiring. In the merge modes, disabling simply drops the file from the group.

    Then there's a behavior worth knowing before it confuses you: if a file is disabled but still connected on the canvas, at submit time the input is removed from the submitted prompt. Downstream then sees "not connected" - optional inputs quietly take their default, required inputs fail validation with a clear error. Your canvas wiring and your saved workflow are untouched; only the prompt that gets queued is different. If you normally drive ComfyUI through the HTTP API instead of the UI, that pruning doesn't happen and you get None instead. Two different runtimes, two different behaviors - worth remembering when a workflow behaves one way interactively and another way from a script.

    Inputs and outputs

    Required: card (EZFLEX_MEDIA_CARD, forceInput) and config (multiline STRING, default "{}" - "Media Out panel config (ids of locally disabled files)"). Outputs are dynamic and generated from the card's contents and the mode; names come from the filenames, types from the actual file kinds. Config is panel-written, so you set all of this by clicking, not typing.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/blackbossokok/Comfyui-EzFlex-Presets
    pip install -r requirements.txt   # mutagen, for audio/video container tags
    

    Manager users: search EzFlex, install, restart. Easiest path in: use MediaLoader's "Load output" button, which creates and wires this node for you. No models, no API keys. Pack metadata asks for ComfyUI 0.3.13+ because the panels use the official i18n endpoint.

    Common issues

    You can't connect anything to card. Correct behavior. The custom type only accepts a MediaLoader card port, and the built-in loaders won't produce one.

    "Use split mode" error. You merged mixed media types, or audio at different sample rates. The node won't fake a batch out of that, and it's right not to.

    The batch came out cropped / padded unexpectedly. That's the fit setting, default crop against the first image. Set target size explicitly and pick pad or stretch if you'd rather not lose the edges.

    A downstream node says the input is missing. You disabled a connected file - the runtime pruning described above. Toggle it back on, or delete the wire.

    Only the first N images came through. "Max images" is set. 0 means all.

    Multiple audio clips landed in a weird timeline. Check sample rates; mono is upmixed, but a 44.1k clip and a 48k clip won't join and will error instead.

    CategoryEzFlex

    Inputs (2)

    NameTypeDefaultDescription
    cardEZFLEX_MEDIA_CARDA media-card output from EzFlex-MediaLoader (dark red input).
    configSTRING{}Media Out panel config (ids of locally disabled files).

    Outputs (0)

    No outputs