OSS Upload 📤
Ship your generated images straight to Alibaba Cloud OSS — keys and all
- input_data
- file_url
- file_path
- upload_info
- file_size
- upload_success
- error_message
If your pipeline ends with "upload the result somewhere public so other systems can grab it," this node is the last step. It's an Alibaba Cloud OSS uploader that accepts just about any data type and figures out what to do with it: a single image becomes a PNG, a batch of images gets stitched into an MP4 video, audio becomes MP3, text becomes a UTF-8 file, and raw bytes go up as-is. You get back a public URL at the end. It's clearly built for Chinese cloud workflows (Aliyun is huge there), but the mechanics work for anyone with an OSS bucket.
How it works
It type-detects the input_data and converts on the fly. The video path is the interesting one: multiple images get encoded to MP4 with ffmpeg (with a fallback to OpenCV if ffmpeg is missing), and the node is careful about even dimensions and baseline profiles so the output actually plays. Uploads use the oss2 Python SDK and set the object ACL to public-read, so the resulting URL works in a browser. Filenames are auto-generated from timestamps and hashes, so collisions are a non-issue.
The security thing you need to hear
Your Aliyun Access Key and Secret Key are node inputs - plain text, sitting in the workflow JSON. And here's the part people forget: ComfyUI embeds the workflow JSON into every output image's metadata. So if you save a workflow with keys in it and share the image (or the workflow), you've shared your cloud credentials. That's not hypothetical - the KB's own history shows how custom-node workflows get shared with everything embedded. Rules: use a key with bucket-scoped permissions and nothing more, rotate it if it ever leaks, and strip or scrub the workflow before you share anything. This node makes uploading easy; it doesn't make leaking your keys fun.
Inputs that matter
- input_data - anything. Images, audio, video, text. This is the wildcard input the pack's type-utils make possible.
- access_key / secret_key / end_point / bucket_name - the four required credentials (end_point looks like
oss-cn-hangzhou.aliyuncs.com). The node validates all four before it'll even try. - domain - optional custom domain for the returned URL instead of the default endpoint.
- base_path - optional prefix for where files land in the bucket, e.g.
uploads. - video_fps - the frame rate used when it stitches multiple images into a video (default 16).
- content_type / enable_upload - optional MIME override, and a master switch so you can build the URL/path logic without actually uploading.
Outputs
file_url (the public URL), file_path (where it lives in the bucket), upload_info (a JSON detail blob with etag, content type, upload time), file_size (INT, bytes), upload_success (BOOLEAN), and error_message (STRING, empty on success). Wire file_url to a text display or a downstream API call.
Dependencies
This is the one node in the pack with real extras: oss2 (the SDK, in requirements.txt) and pydub for the audio→MP3 path. The ffmpeg/OpenCV video path wants ffmpeg on PATH or opencv-python available. If you get an ImportError about oss2, you skipped pip install -r requirements.txt.
Installing
ComfyUI Manager → search "ZMG" / "ComfyUI-ZMG-Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/vanche1212/ComfyUI-ZMG-Nodes
cd ComfyUI-ZMG-Nodes
pip install -r requirements.txt
Restart, find it under ZMGNodes/utils. Powerful, but treat those keys like keys.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| input_data | * | 接受任意类型数据:图片、音频、视频、文本等 | |
| access_key | STRING | 阿里云OSS Access Key(请输入您的密钥) | |
| secret_key | STRING | 阿里云OSS Secret Key(请输入您的密钥) | |
| end_point | STRING | OSS端点地址(如:oss-cn-hangzhou.aliyuncs.com) | |
| bucket_name | STRING | OSS存储桶名称(请输入您的bucket名称) | |
| domain | STRING | 自定义域名(可选,如:https://your-domain.com) | |
| base_path | STRING | 基础路径前缀(可选,如:uploads) | |
| video_fps | FLOAT | 16.01–120 | 视频帧率(当输入多张图片时用于合成视频) |
| content_typeopt | STRING | 文件MIME类型(留空自动检测) | |
| enable_uploadopt | BOOLEAN | true | 是否启用上传功能 |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| file_url | STRING | — |
| file_path | STRING | — |
| upload_info | STRING | — |
| file_size | INT | — |
| upload_success | BOOLEAN | — |
| error_message | STRING | — |