Nodes/AI-HIVE 图片与视频生成/AI-HIVE 上传参考图
ComfyUI Node

AI-HIVE 上传参考图

Upload a Reference Image to AI-HIVE Once, Then Reuse the Media ID

By wubin1836·Created 2 months ago·Updated 2 months ago· 1
AI-HIVE 上传参考图
  • image
  • media_ids_json

Here's the counterintuitive thing about this pack: you usually don't need AI-HIVE 上传参考图 (class AIHiveUploadImage). The image and video generation nodes all accept a reference_image IMAGE socket and upload it for you automatically, behind your back. So why does this node exist? Because sometimes you want the upload to be a deliberate, separate step - so you get the media ID back and can reuse it.

The mechanism is exactly what the name says. You feed it one IMAGE (a batch, actually - any tensor), it converts each frame to an RGB PNG, requests an upload token, PUTs the bytes to AI-HIVE's storage, confirms, and hands back media_ids_json: a JSON array of media ID strings like ["media_xxx"].

When the separate step actually pays off

  1. The video nodes want strings, not images. image_media_ids_json, video_media_ids_json, audio_media_ids_json, first_frame_media_id, and last_frame_media_id are all STRING fields. You can't drag an image wire into them. Upload once with this node and feed the resulting media_ids_json straight into those fields - that's the designed path for multi-image video prompts and first/last-frame pinning.
  2. Reuse the same asset across runs. Once a file is on AI-HIVE's servers you can reference it by ID forever, so a workflow that uploads once and then submits many jobs avoids re-uploading the same PNG every time. For batch-heavy ecommerce work that's a real (small) win.
  3. Combine several references in one array before handing them off.

Inputs and outputs

Input: image (IMAGE). Output: media_ids_json (STRING). That's the whole node. It's not an output node, so it won't force execution by itself.

Installing

ComfyUI Manager: search AI-HIVE, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/wubin1836/comfyui-ai-hive.git
pip install -r comfyui-ai-hive/requirements.txt

Dependencies are just requests and Pillow. It needs the AI_HIVE_API_KEY (or ~/.ai-hive/config.json) like every node in the pack, even though all it does is move a file.

Where people get tripped up

The output is a JSON array, and the video nodes validate that shape strictly. Don't hand-typo a bare media id into first_frame_media_id from the middle of the array - you'll get a parse error. Wire the output in, or paste the whole ["..."] string. And remember this node is doing an actual network round-trip; if your key is wrong or the service is down, the error surfaces here, not at the generation node downstream.

CategoryAI-HIVE

Inputs (1)

NameTypeDefaultDescription
imageIMAGE—

Outputs (1)

NameTypeDescription
media_ids_jsonSTRING—