AI-HIVE 上传参考图
Upload a Reference Image to AI-HIVE Once, Then Reuse the Media ID
- 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
- The video nodes want strings, not images.
image_media_ids_json,video_media_ids_json,audio_media_ids_json,first_frame_media_id, andlast_frame_media_idare all STRING fields. You can't drag an image wire into them. Upload once with this node and feed the resultingmedia_ids_jsonstraight into those fields - that's the designed path for multi-image video prompts and first/last-frame pinning. - 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.
- 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.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| media_ids_json | STRING | — |