Tencent COS Uploader
Tencent COS Uploader
- images
- uploaded_urls
You've just generated something good and you want it off your machine - into a Discord bot, onto a website, out to a teammate, or into whatever downstream pipeline needs a link instead of a file on your SSD. The stock SaveImage node drops the PNG in ComfyUI/output/, which is fine until the thing consuming your images isn't sitting next to you. Tencent COS Uploader is the node that fixes exactly that: it takes your rendered IMAGE tensor, encodes it, and pushes it to Tencent Cloud Object Storage, handing you back a public URL for every frame.
If you've seen S3-style "upload my output" nodes for AWS, this is the Tencent version, and it's aimed squarely at the Tencent ecosystem. The entire pack is one node - there's nothing else to learn.
How it works
Under the hood it's embarrassingly simple, which is a good thing. The node reads a config.json sitting next to it in the pack folder for your Tencent secret_id and secret_key - no API call, no key entry in the UI, those live in a file. Then for each image in the batch it:
- Converts the
[batch, height, width, channels]tensor back into a PIL image. - Encodes it - JPEG at your
compress_level(default 90) ifconvert_to_jpgis on, otherwise PNG. - Names it
{filename_prefix}{timestamp}_{4 random digits}.{ext}, so you get things likecomfy_20260823_181530_4821.jpg. - Uploads it with the official
cos-python-sdk-v5client (put_object, storage class STANDARD). - Builds the URL -
https://{bucket}.cos.{region}.myqcloud.com/{key}- and returns it.
The output is a single uploaded_urls string socket. Because the node is an output node, the URLs also land in the node's UI and ComfyUI's history, so you can click them straight from the canvas. Wire the socket into anything that takes a STRING, or just read it off the node.
The inputs you actually set
There are eight required inputs, but only a few you'll touch:
- bucket - the only one that's really mandatory. It defaults to empty, and with nothing in it the upload dies before it starts. Tencent bucket names include the appid suffix (
my-bucket-1250000000). - region - defaults to
ap-guangzhou. Change it to the region your bucket actually lives in, or the SDK throws a region mismatch at you. - cos_path - the "folder" in the bucket, defaults to
comfyui_output/. A trailing slash is added for you if you forget it. - compress_level / convert_to_jpg - the quality knob and the format toggle.
Two real warnings about convert_to_jpg, which defaults to true. First, JPEG strips the embedded workflow metadata that makes a ComfyUI PNG a shareable project file - drag a .jpg back onto the canvas and you get nothing. If your images are meant to be reusable workflows, keep PNG. Second, JPEG also loses alpha: the node silently flattens RGBA to RGB, so transparent generations get a black background. Set it to false if you need transparency.
use_accelerate (default off) is a niche one: it switches the upload to Tencent's global-acceleration domain (*.cos.accelerate.myqcloud.com), which only works if you've actually enabled that feature on the bucket. Leave it off unless you know you enabled it.
Installing it
There's no README to speak of, so the standard route: ComfyUI Manager → search "comfyui-cos-uploader" → install. Or, manually:
cd ComfyUI/custom_nodes
git clone https://github.com/terrellhu/comfyui-cos-uploader
cd comfyui-cos-uploader
pip install -r requirements.txt
Then restart ComfyUI. Dependencies are light - cos-python-sdk-v5 is the only thing you don't already have; Pillow and numpy ship with ComfyUI.
Where people get burned
The number one failure is the config file. The code prints config.json not found to the console and quietly returns an empty URL list - no crash, no red node, just nothing. Copy config.json.template to config.json in the pack folder and drop in your secret_id and secret_key before you do anything else. And keep that file out of git if you ever commit the pack - those are your cloud credentials sitting in plaintext.
The second trap: Tencent COS buckets are private by default. The node happily returns a URL, and that URL happily 403s for anyone who isn't you. Either set the bucket to public-read (or bind a CDN domain) before you share links around, or the whole exercise is pointless.
For a tiny, unmaintained-looking pack, it does one job cleanly. If you need Tencent COS links out of ComfyUI, there's not much else to choose from - and honestly, you don't need more.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| region | STRING | ap-guangzhou | — |
| bucket | STRING | — | |
| cos_path | STRING | comfyui_output/ | — |
| filename_prefix | STRING | comfy_ | — |
| compress_level | INT | 901–100 | — |
| convert_to_jpg | BOOLEAN | true | — |
| use_accelerate | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| uploaded_urls | STRING | — |