Nodes/ComfyUI MediaHub/MediaHub Generate Image
ComfyUI Node

MediaHub Generate Image

The node that turns a MediaHub request into an actual image

By vantang·Created 3 months ago·Updated 3 months ago· 3
MediaHub Generate Image
  • request
  • image
  • image_urls
  • raw_json
api_key

Here's the mental model that makes this whole pack click: MediaHub splits every workflow into a config half and an execution half. The provider config nodes (MiniMax CN T2I Config, Seed Volcengine T2I Config, and friends) just build a description of what you want. MediaHubGenerateImage is the node that actually spends money to make it happen.

It takes two inputs: your API key (from MediaHub API Key) and a request (a MEDIAHUB_IMAGE_REQUEST that any provider image config node outputs). In return you get an IMAGE tensor you can wire straight into ComfyUI's Preview Image, plus image_urls and raw_json as plain strings. That's the entire contract, and it's deliberately provider-neutral - the node has no idea whether the request came from Agnes or Seedream.

How it works

The request isn't a bag of loose widgets; it's a small structured object holding the provider name, the operation (image.generate), and the payload the config node validated. MediaHubGenerateImage looks up the right provider implementation, fires the HTTP call with your key, and gets back either URLs or base64-encoded images (whichever the config node's response_format chose).

Then it does a bit of ComfyUI plumbing: it downloads or decodes the bytes, converts them to a [B, H, W, C] float tensor, and hands that to you as a standard IMAGE. The image_urls output is a JSON list of the source URLs, and raw_json is the provider's full response pretty-printed - invaluable when you're debugging, because the error detail lives there.

One quirk worth knowing: the node sets IS_CHANGED to NaN, which is ComfyUI-speak for "never cache this, always execute." That's intentional. Each queue run is a fresh paid API call, so don't expect ComfyUI's caching to save you money. If you re-run a workflow with the same inputs, you'll get a new generation and a new bill.

The few settings that matter

There are only two inputs and both are effectively wired by other nodes:

  • api_key - the same key that also feeds the video nodes. Every provider is billed separately.
  • request - comes from any provider image config node. You don't build this by hand.

Outputs: image is the one you'll actually use; image_urls is handy if you want to reference the hosted copy or skip ComfyUI entirely; raw_json is your debugging window.

Installing it

Same as every node in this pack - you install MediaHub itself:

cd ComfyUI/custom_nodes
git clone https://github.com/vantang/ComfyUI-MediaHub.git
/path/to/ComfyUI/python -m pip install -r ComfyUI-MediaHub/requirements.txt

Then restart ComfyUI. The node shows up under MediaHub/Image. No model files, no weights, no VRAM pressure - the heaviest thing that happens locally is JPEG encoding of your input images.

Where people get stuck

The most common mistake is treating a config node as if it generated the image on its own. It doesn't - a config node alone produces nothing. You need the full chain: Provider Config -> MediaHubGenerateImage -> Preview Image, with the key feeding in alongside. If Preview Image shows an empty result or you get a type mismatch on the request socket, you've likely wired a video config into the image node or missed the config node entirely.

Errors during generation come back as exceptions from the provider, and the message usually tells you the real story: a bad prompt, a model you don't have access to, or an expired key. Read raw_json before you blame the node - most of the time the node is just the messenger for whatever MiniMax or the ARK API decided was wrong.

CategoryMediaHub/Image

Inputs (2)

NameTypeDefaultDescription
api_keySTRING
requestMEDIAHUB_IMAGE_REQUEST

Outputs (3)

NameTypeDescription
imageIMAGE
image_urlsSTRING
raw_jsonSTRING