π€ RH Upload Latent
Ship a latent tensor to the cloud without a JPEG in sight
- config
- latent
- RH_PARAM
RH Upload Latent is the geeky one, and it's the most interesting node in the pack. Most cloud bridges round-trip images as PNGs - you decode to pixels, send pixels, and the cloud re-encodes. This node instead takes a raw ComfyUI LATENT tensor, saves it to a temporary .safetensors file, uploads that to RunningHub, and hands the filename to a cloud workflow as a parameter. The latent - the compressed diffusion representation - crosses the wire intact. No decode, no re-encode, no generation drift.
This matters for the same reason latent-space workflows exist locally: if you're doing img2img-style work where the latent is the input (inpainting with an existing mask, multi-stage sampling, an upscale pass that continues from a latent rather than an image), sending pixels loses precision and forces the cloud workflow to VAE-encode again with whatever settings it has. Sending the latent means the cloud continues from your exact tensor. The pack's own latent_transport.json example demonstrates the round trip: upload a latent, process on RunningHub, and get a .safetensors latent back out of RH Execute.
Inputs
All four required:
config- from RH Config.latent- anyLATENTtensor, e.g. from a VAE Encode or KSampler output.node_id- target node inside the RunningHub workflow.field_name- the input name on that remote node that expects the latent file. This one's a plain text field, not a dropdown, because the remote field is whatever the workflow author called it.
How it works
It writes the latent dict to a temp file via safetensors.torch.save_file, uploads it to /task/openapi/upload with fileType: latent, deletes the temp file in a finally block (so no litter), and returns a single-element param list - {nodeId, fieldName, fieldValue: <server filename>} - to feed into RH Execute. There's a matching .safetensors reader on the download side, which is why a full latent round trip works at all.
Gotchas
The whole trick depends on the remote workflow having a node that accepts a latent/safetensors input. Most public RunningHub workflows are image-in/image-out; if yours expects an image, this node's output won't plug in and you want RH Upload Image instead. This is a "build the workflow around the latent" tool, not a drop-in. And it's all-or-nothing: every field is required, so you can't use it as a bare file drop like the image uploader.
Install: ComfyUI Manager (search ComfyUI_RH_API) or git clone https://github.com/xuchenxu168/ComfyUI_RH_API.git into custom_nodes + pip install -r requirements.txt, restart.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| config | RH_CONFIG | β | |
| latent | LATENT | β | |
| node_id | STRING | β | |
| field_name | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| RH_PARAM | RH_PARAM | β |