HunyuanVideo Sr Latents PrePare
Seeding the noise for HunyuanVideo 1.5's upscale pass
- hyvid_cfg
- vae
- transformer_latent
- reference_image
- latents_dict
- height
- width
- n_tokens
The super-resolution branch of HunyuanVideo 1.5 doesn't upscale pixels - it runs a second, distilled diffusion pass that regenerates detail at a higher resolution. And like every diffusion pass, it needs its own starting noise shaped for the target size. HyVideoSrLatentsPrepare is the node that makes that noise: the SR-branch cousin of HyVideo15LatentsPrepare, working out the upscaled latent dimensions and generating fresh latents the SR transformer can refine.
What it does
Given hyvid_cfg (which carries both the base transformer_config and the SR sr_transformer_config - so it knows both the source and target resolutions), the vae (for compression ratios), and an aspect_ratio, it:
- Takes the low-quality latents from the base pass (
transformer_latent, optional input) and maps their resolution up to the SR target using a bucket map from the official pipeline (e.g. 480p → 720p). - Computes the SR latent size - note it uses 32 channels for the SR noise, double the base model's channel count, because the SR transformer conditions on more than plain noise.
- Generates the noise with the CFG node's seed and the flow scheduler's noise scaling.
Outputs are latents_dict, height, width, and n_tokens - the same shape as the base HyVideo15LatentsPrepare, feeding HyVideoSrTransformer.
Where it sits
The SR branch wiring: HyVidelSrTransformerUpsamplerLoader → HyVideoSrLatentsPrepare → HyVideoSrVaeEncode → HyVideoSrTransformer → HyVidelSrVaeDecoder → back into HyVideo15VaeDecode's sr_out. If you're only generating through the simplified HyVideo15I2VSampler / HyVideo15T2VSampler with create_sr_pipeline on, this entire branch is built for you internally - these SR nodes exist for the hand-built workflow.
Installing it
Part of comfyui_hunyuanvideo_1.5_plugin. ComfyUI Manager → "HunyuanVideo-1.5 nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/yuanyuan-spec/comfyui_hunyuanvideo_1.5_plugin
cd comfyui_hunyuanvideo_1.5_plugin
pip install -r requirements.txt
Restart. Needs the VAE present and a hyvid_cfg with sr_transformer_config wired from the SR loader's config output - without it, this node has no idea what resolution to target.
Common issues
The aspect_ratio input here has no default and is required, which trips people who expect to inherit the base pass's ratio - set it explicitly to match. The bigger one: because this node reads sr_transformer_config to pick the target resolution, an unwired config produces a confusing failure or a silently wrong output size. And worth knowing for VRAM planning: this node allocates the SR noise at 32 channels at the upscaled resolution, so on a 12GB card the SR branch's memory peak can approach the base pass's. If you're tight, that's a legitimate reason to run without SR and upscale in post instead.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| hyvid_cfg | HYVID15CFG | — | |
| vae | HYVID15VAE | — | |
| aspect_ratio | STRING | — | |
| target_dtype | COMBO | bfloat16 | 9 options: float32, float64, float16, bfloat16, uint8, int8, +3 |
| transformer_latentopt | HYVID15TRANSFORMERLATENT | — | |
| reference_imageopt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| latents_dict | HYVID15LATENTSDICT | — |
| height | INT | — |
| width | INT | — |
| n_tokens | INT | — |