[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112728":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},112728,"ComfyUI-ReCaVSR","PedroMarinhoDev\u002FComfyUI-ReCaVSR","PedroMarinhoDev","ReCaVSR one-step streaming video super-resolution natively in ComfyUI: 4x on Wan2.2, block by block with its FlashDecoder. bf16 and int8 ConvRot, RTX 3090\u002F4090 benchmarks, runs from 8 GB.",null,"Python",97,9,59,3,0,17,32,5,54.7,"GNU General Public License v3.0",false,"main",true,[],"2026-11-10 21:03:08","2026-11-22 02:30:44","\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets\u002Fbanner-dark.png\">\n  \u003Cimg alt=\"ComfyUI-ReCaVSR: one-step streaming video super-resolution on Wan2.2, natively in ComfyUI\" src=\"assets\u002Fbanner-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#requirements\">\u003Cimg alt=\"ComfyUI v0.44+\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FComfyUI-v0.44%2B-64B5F6?style=flat-square&labelColor=555\">\u003C\u002Fa>\n  \u003Ca href=\"#smaller-cards-and-other-setups\">\u003Cimg alt=\"VRAM: 8 GB at 1440p, 24 GB at 4K\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVRAM-8%20GB%20at%201440p%20%C2%B7%2024%20GB%20at%204K-64B5F6?style=flat-square&labelColor=555\">\u003C\u002Fa>\n  \u003Ca href=\"#quick-start\">\u003Cimg alt=\"pip install: triton, opencv\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpip%20install-triton%20%C2%B7%20opencv-64B5F6?style=flat-square&labelColor=555\">\u003C\u002Fa>\n  \u003Ca href=\"#license-and-credits\">\u003Cimg alt=\"Code GPL-3.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-GPL--3.0-64B5F6?style=flat-square&labelColor=555\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#quick-start\">\u003Cimg alt=\"Get started\" src=\"assets\u002Fbutton-start.svg\" height=\"40\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FPedroMarinhoDev\u002FReCaVSR-ComfyUI\">\u003Cimg alt=\"Weights on Hugging Face\" src=\"assets\u002Fbutton-weights.svg\" height=\"40\">\u003C\u002Fa>\n  \u003Ca href=\"example_workflows\">\u003Cimg alt=\"Workflow\" src=\"assets\u002Fbutton-workflow.svg\" height=\"40\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fkopperx\u002FReCaVSR\">\u003Cimg alt=\"ReCaVSR by USTC\" src=\"assets\u002Fbutton-recavsr.svg\" height=\"40\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nRun **[ReCaVSR](https:\u002F\u002Fgithub.com\u002Fkopperx\u002FReCaVSR)** (USTC) **natively in ComfyUI**. ReCaVSR is a one-step streaming\ndiffusion video super-resolution model built on Wan2.2 TI2V-5B. It upscales a clip in blocks, 21 frames and then 8 at a\ntime, each in a single denoising step, reusing the previous block's latents and a cache of past keys and values. Its\nown small decoder, FlashDecoder, turns each block into frames as soon as it is done, conditioned on the input. Here it\nruns on ComfyUI's model and memory management; with the exact kernels it gives the reference's output bit for bit.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"People with umbrellas on a rainy night street at 4x: a 960 by 480 crop of the input, bicubic, above the same crop from ReCaVSR\" src=\"assets\u002Fhero-street.webp\" width=\"100%\">\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"A portrait at 4x: a 480 by 960 crop of the input, bicubic, beside the same crop from ReCaVSR\" src=\"assets\u002Fhero-portrait.webp\" width=\"100%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\u003Csub>Crops at 1:1 of the 4x output, the input scaled bicubic for comparison · left: a rainy street, 960×480 → 3840×1920,\ninput on top · right: a portrait, 360×360 → 1440×1440, input on the left · clips from ReCaVSR's real-world demo set · bf16, fast kernels, FlashDecoder, seed 42, no colour fix · first 72 frames\u003C\u002Fsub>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fstream.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>Streaming, one step per block\u003C\u002Fb>\u003Cbr>21 frames, then 8 at a time, each decoded and encoded into the output as soon as it is generated. A longer clip costs time and disk, not memory.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fscale.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>4x to 3840×1920 on 24 GB\u003C\u002Fb>\u003Cbr>149 frames of 960×480 in 36 s on an RTX 4090 and 67 s on an RTX 3090, with the int8 file.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fspeed.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>int8 ConvRot\u003C\u002Fb>\u003Cbr>6.3 GB instead of 10.6, and the transformer 1.8× faster, on both cards and both sizes.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fdecoder.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>FlashDecoder\u003C\u002Fb>\u003Cbr>The model's own, streaming decoder: 25 to 40× faster than the Wan 2.2 VAE and it fits at 4K. The VAE option draws finer texture when time allows.\u003C\u002Ftd>\n    \u003Ctd valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fcheck.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>The reference, bit for bit\u003C\u002Fb>\u003Cbr>\u003Ccode>exact\u003C\u002Fcode> kernels reproduce ReCaVSR's own runtime on the same GPU; the faster default sits about 49 dB from it.\u003C\u002Ftd>\n    \u003Ctd valign=\"top\">\u003Cimg src=\"assets\u002Ficons\u002Fnative.svg\" width=\"24\" alt=\"\">\u003Cbr>\u003Cb>ComfyUI's memory management\u003C\u002Fb>\u003Cbr>Weights stream when they don't fit, and outputs too big for the card are fitted automatically: 5376×3072 runs on a 24 GB card.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Quick start\n\n1. **Install the nodes** and restart ComfyUI. Search for **ReCaVSR video super-resolution** in ComfyUI-Manager, or\n   install it from the [Comfy Registry](https:\u002F\u002Fregistry.comfy.org\u002Fnodes\u002Fcomfyui-recavsr) with\n   `comfy node install comfyui-recavsr`. Or clone this repository into `custom_nodes` and install its two packages\n   (Triton for the attention kernels, OpenCV for the reference's frame resize; both have fallbacks, see\n   [Requirements](#requirements)).\n\n   ```bash\n   cd ComfyUI\u002Fcustom_nodes\n   git clone https:\u002F\u002Fgithub.com\u002FPedroMarinhoDev\u002FComfyUI-ReCaVSR\n   pip install -r ComfyUI-ReCaVSR\u002Frequirements.txt\n   ```\n\n2. **Download the files** into `ComfyUI\u002Fmodels\u002Frecavsr`: one transformer, plus the prompt and the FlashDecoder.\n\n   | File | Size | From |\n   |---|---|---|\n   | [transformer.safetensors](https:\u002F\u002Fhuggingface.co\u002Fkopper\u002FReCaVSR\u002Fblob\u002Fmain\u002Ftransformer.safetensors) (bf16) | 10.6 GB | [kopper\u002FReCaVSR](https:\u002F\u002Fhuggingface.co\u002Fkopper\u002FReCaVSR), as released |\n   | **or** [transformer_int8_convrot.safetensors](https:\u002F\u002Fhuggingface.co\u002FPedroMarinhoDev\u002FReCaVSR-ComfyUI\u002Fblob\u002Fmain\u002Frecavsr\u002Ftransformer_int8_convrot.safetensors) | 6.27 GB | [this project's Hugging Face page](https:\u002F\u002Fhuggingface.co\u002FPedroMarinhoDev\u002FReCaVSR-ComfyUI) |\n   | [prompt.safetensors](https:\u002F\u002Fhuggingface.co\u002Fkopper\u002FReCaVSR\u002Fblob\u002Fmain\u002Fprompt.safetensors) | 4.2 MB | kopper\u002FReCaVSR |\n   | [flashdecoder.safetensors](https:\u002F\u002Fhuggingface.co\u002Fkopper\u002FReCaVSR\u002Fblob\u002Fmain\u002Fflashdecoder.safetensors) | 229 MB | kopper\u002FReCaVSR |\n\n   ```bash\n   cd ComfyUI\u002Fmodels\n   hf download kopper\u002FReCaVSR prompt.safetensors flashdecoder.safetensors --local-dir recavsr\n   # then the bf16 transformer\n   hf download kopper\u002FReCaVSR transformer.safetensors --local-dir recavsr\n   # or the int8 one\n   hf download PedroMarinhoDev\u002FReCaVSR-ComfyUI recavsr\u002Ftransformer_int8_convrot.safetensors --local-dir .\n   ```\n\n   The folder can also be set with `recavsr:` in `extra_model_paths.yaml`. The `vae` decoder option uses ComfyUI's\n   own [wan2.2_vae.safetensors](https:\u002F\u002Fhuggingface.co\u002FComfy-Org\u002FWan_2.2_ComfyUI_Repackaged\u002Fblob\u002Fmain\u002Fsplit_files\u002Fvae\u002Fwan2.2_vae.safetensors)\n   in `models\u002Fvae`, not the `vae.safetensors` of kopper\u002FReCaVSR.\n\n3. **Open the workflow and run.** In ComfyUI, **Templates → ComfyUI-ReCaVSR → recavsr_video_4x** (or drag\n   [`example_workflows\u002Frecavsr_video_4x.json`](example_workflows\u002Frecavsr_video_4x.json) in), load your clip in **Load\n   Video** and queue. **Load Video → ReCaVSR Upscale Video → Save Video**: the node reads the clip a block at a time and\n   encodes the upscaled video as it goes, with the input's audio and frame rate, so Save Video only stores it.\n\n**Scale 4 is what the model was trained for**; the reference also documents 2 and 1.5. Any size runs: sizes that are\nnot a multiple of 32 are padded for the model and cropped back.\n\n## Speed\n\nTwo clips from ReCaVSR's real-world demo set at 4x, through a ComfyUI server per card: ComfyUI 0.44.0, PyTorch 2.14.1 with CUDA 13.2, sage attention,\ndynamic VRAM, Linux. The time is the **ReCaVSR Upscale Video** node's: moving the models onto the GPU, every block, and\ndecoding and copying the frames out. Each setting ran after a 29-frame warm-up at the same size, so Triton's kernel\nbuilds and reading the file from disk are not in it; writing the mp4 adds 5 to 15 s. PSNR is against bf16 + exact +\nFlashDecoder on the same card, over every frame of the node's uint8 output. These runs used the node's earlier\nimage output; the streaming VIDEO output is faster still (see [Long and large videos](#long-and-large-videos)).\n\n**Rainy street**, 149 frames, 960×480 → 3840×1920\n\n| Transformer | Kernels | Decoder | RTX 3090 | RTX 4090 | Peak VRAM 3090 \u002F 4090 | PSNR |\n|---|---|---|---|---|---|---|\n| bf16 | exact | FlashDecoder | 114 s (1.3 fps) | 59 s (2.5 fps) | 23.2 \u002F 22.6 GB | reference |\n| bf16 | fast | FlashDecoder | 111 s (1.3 fps) | 49 s (3.0 fps) | 23.5 \u002F 23.5 GB | 49.9 dB |\n| int8 ConvRot | exact | FlashDecoder | 82 s (1.8 fps) | 47 s (3.2 fps) | 20.4 \u002F 20.9 GB | 47.9 dB |\n| int8 ConvRot | fast | FlashDecoder | 67 s (2.2 fps) | 36 s (4.2 fps) | 18.6 \u002F 21.2 GB | 48.0 dB |\n| bf16 | fast | Wan 2.2 VAE | 823 s (0.2 fps) | 417 s (0.4 fps) | 23.5 \u002F 23.5 GB | 34.4 dB |\n\n**Portrait**, 180 frames, 360×360 → 1440×1440\n\n| Transformer | Kernels | Decoder | RTX 3090 | RTX 4090 | Peak VRAM 3090 \u002F 4090 | PSNR |\n|---|---|---|---|---|---|---|\n| bf16 | exact | FlashDecoder | 40 s (4.5 fps) | 20 s (9.2 fps) | 15.6 \u002F 16.1 GB | reference |\n| bf16 | fast | FlashDecoder | 33 s (5.4 fps) | 17 s (10.6 fps) | 15.7 \u002F 15.9 GB | 48.9 dB |\n| int8 ConvRot | exact | FlashDecoder | 29 s (6.2 fps) | 16 s (11.1 fps) | 11.5 \u002F 11.7 GB | 47.3 dB |\n| int8 ConvRot | fast | FlashDecoder | 23 s (7.9 fps) | 15 s (12.0 fps) | 11.7 \u002F 11.6 GB | 47.2 dB |\n| bf16 | fast | Wan 2.2 VAE | 273 s (0.7 fps) | 119 s (1.5 fps) | 23.5 \u002F 23.5 GB | 38.8 dB |\n\n- Both cards ran at the same time on one machine and shared its CPU, which cost up to about 10%: alone, the RTX 3090\n  ran the rainy street with bf16 and fast kernels in 101 s against the table's 111 s. Other repeats came within 1%\n  (the RTX 3090 on the portrait) and 3% (the RTX 4090 on the rainy street), and one within 15% (the RTX 4090 on the\n  portrait, right after the VAE runs had moved the weights out of VRAM).\n- Peak VRAM is what nvidia-smi showed. Dynamic VRAM keeps as much of the weights on the card as fits, so it shows use,\n  not the minimum. At 3840×1920 the activations alone are about 18 GB: the bf16 transformer then streams part of its\n  weights every block, which is why `fast` gains little there on the RTX 3090.\n- The VAE row is bf16 with fast kernels: its time hardly depends on the transformer settings (all four on the portrait: 116 to\n  119 s on the RTX 4090). At 1440×1440 on the RTX 3090 the plain VAE decode sits at the edge of 24 GB, and one run fell\n  back to tiling (455 s); at 3840×1920 it always tiles.\n\n## Comparisons\n\nEach pair is the same crop at 1:1 from the two settings, the first 72 frames; the decoder pair is a 2x zoom (nearest\nneighbour) of half that crop, since its difference is finer than the webp's own compression at 1:1. The captions give the node's time on each\ncard and the PSNR against bf16 + exact + FlashDecoder.\n\n### bf16 or int8\n\nThe int8 ConvRot file is 6.27 GB instead of 10.6 and needs about 4 GB less VRAM. With the fast kernels it runs the\ntransformer 1.75 to 1.8 times as fast on both cards and both sizes. The whole node gains less, because decoding and\ncopying the frames out don't change: 1.7× on the RTX 3090 and 1.4× on the RTX 4090 at 3840×1920, 1.5× and 1.1× at\n1440×1440. It lands 47 to 48 dB from bf16, as sharp, with differences only in the finest texture.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"bf16 above int8 on the rainy street, a 960 by 480 crop at 1:1\" src=\"assets\u002Fcompare-precision-street.webp\" width=\"100%\">\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"bf16 beside int8 on the portrait, a 480 by 960 crop at 1:1\" src=\"assets\u002Fcompare-precision-portrait.webp\" width=\"100%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### FlashDecoder or the Wan 2.2 VAE\n\nFlashDecoder is ReCaVSR's own decoder: a small transformer, conditioned on the input frames, that decodes each block as\nsoon as it is generated. `decoder` `vae` instead decodes every latent at the end with ComfyUI's stock Wan 2.2 VAE.\n**The VAE draws finer texture**: hair strands, the jacket's weave and skin come out crisper, with 23% more edge\nenergy (mean Laplacian of the luma) than FlashDecoder on the portrait, and 8% on the rainy street, where it ranges from\nnone on the large signs to 26% on the people under the umbrellas. The two are 38.8 dB (portrait) and 34.4 dB (rainy\nstreet) apart. The softness is the decoder's own:\nthese nodes reproduce ReCaVSR's FlashDecoder bit for bit (see [Checked against the reference](#requirements)).\n\nThe VAE takes 25 to 40 times as long to decode and needs the whole video at once. On the RTX 4090 at 1440×1440 the node\ntakes 119 s against 17 s (decoding alone 105 s against 4 s). At 3840×1920 the VAE doesn't fit in 24 GB and falls back to\nComfyUI's tiled decode: 417 s against 49 s (378 s against 12 s). FlashDecoder is the one for speed and streaming; the\nVAE is for when the last bit of texture is worth minutes per clip.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"FlashDecoder above the Wan 2.2 VAE on the rainy street, a 960 by 480 crop at 1:1\" src=\"assets\u002Fcompare-decoder-street.webp\" width=\"100%\">\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"FlashDecoder beside the Wan 2.2 VAE on the portrait, a 480 by 960 crop at 1:1\" src=\"assets\u002Fcompare-decoder-portrait.webp\" width=\"100%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Fast or exact kernels\n\n`kernels` `fast`, the default, runs comfy-kitchen's fused norm, RoPE and residual kernels and retuned attention tiles;\n`exact` is the reference's sequence of operations, bit for bit its output. `fast` lands at 49 to 50 dB against `exact`,\nbelow anything visible, and takes 7 to 24% off the node's time. The exception is bf16 at 3840×1920 on the RTX 3090\n(3%), where streaming the weights takes the time.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"exact above fast kernels on the rainy street, a 960 by 480 crop at 1:1\" src=\"assets\u002Fcompare-kernels-street.webp\" width=\"100%\">\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg alt=\"exact beside fast kernels on the portrait, a 480 by 960 crop at 1:1\" src=\"assets\u002Fcompare-kernels-portrait.webp\" width=\"100%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Long and large videos\n\n**Length costs disk, not memory.** With a VIDEO connected, the node reads the clip a block at a time and writes the\nupscaled video as it goes: each decoded block becomes 8-bit on the GPU, is copied to pinned memory on a side stream and\nencoded on a thread while the next block computes, then **Save Video** stores the file without re-encoding. Nothing\ngrows with the clip's length. (Connected as images, the frames still sit in memory as ComfyUI images, float32: 88 MB\nper 3840×1920 frame.) On the RTX 4090 the portrait at 4x, 180 frames, now runs as one 17.8 s prompt including saving;\ndecoding and copying took 2.2 s of it instead of 4.2 s.\n\n**Size is fitted to the card.** At large outputs the first block's input projection, which turns 21 frames at the full\noutput size into tokens, is the peak: 16.5 GiB at 5376×3072. Its convolutions are causal in time, so the node can feed\nit 4 frames at a time instead (6.2 GiB, the same tokens up to one bf16 rounding step). The node picks the cheapest\nsetting that fits and logs it:\n\n1. whole blocks, as measured above (bit for bit the reference with `exact` kernels);\n2. the input projection 4 frames at a time;\n3. also the attention history in RAM (`kv_offload`);\n4. otherwise a clear error naming the largest `scale` that fits.\n\nA 73-frame 1344×768 clip at 4x, 5376×3072, ran this way on the RTX 4090 in 80 s.\n\n**Encoding** defaults to `auto`: HEVC on NVENC, then H.264 on NVENC (up to 4096 pixels a side), then x264, the first\nthat opens at the output size. NVENC is a separate unit on NVIDIA GPUs, so it costs neither CUDA cores nor CPU.\n\n**Scene cuts.** ReCaVSR treats a clip as one shot: after a cut, the first blocks still draw on the previous shot through\nthe recycled latents and the attention history, which shows as shimmer for a moment. Until the node resets at cuts,\nupscale each shot as its own clip when that matters.\n\n## Smaller cards and other setups\n\n**Smaller cards.** The node tells ComfyUI how much room its activations need, about 2.6 MB per 32×32 tile of the output\n(5 GB at 1440×1440, 18 GB at 3840×1920), and dynamic VRAM streams the weights that don't fit beside them. On the RTX\n3090 with 12 or 16 GiB held by another process, so that ComfyUI had a 12 GB or an 8 GB card, the portrait at 4x\n(1440×1440, 180 frames, fast kernels, FlashDecoder) took:\n\n| | 24 GB | 12 GB | 8 GB |\n|---|---|---|---|\n| int8 | 23 s | 23 s | 27 s |\n| int8 + `kv_offload` | | 27 s | 29 s |\n| bf16 | 33 s | 35 s | 39 s |\n| bf16 + `kv_offload` | | 38 s | 41 s |\n\n**`kv_offload`** keeps the attention history (66 latent planes over the 30 blocks, about 0.8 MB per output token: 1.6 GB\nat 1440×1440, 5.8 GB at 3840×1920) in RAM between blocks and uploads it for each one. The output is the same, bit for\nbit. At 1440×1440 it wasn't needed and cost 7 to 16%; it is for outputs whose activations don't fit on the card at all,\nsuch as 3840×1920 on a 16 GB card (18 GB of activations, about 12.5 GB with it; not measured).\n\n**Without Triton** (common on Windows installs), both attention kernels fall back to PyTorch: 64 queries at a time\nagainst every visible key, with the window as a mask, through ComfyUI's attention. On the RTX 3090 it matches the\nkernels to within 1e-3 on values around 0.02; it is many times slower (not timed end to end).\n\n**Without OpenCV**, the frames are resized with PyTorch's bilinear filter instead of the reference's OpenCV one: at most\none grey level off, 0.08 on average.\n\ncomfy-kitchen's kernels (`adaln`, `apply_rope1`, `window_attention`, the int8 GEMM) all have eager versions, so the fast\nkernels and the int8 file load on any GPU; where ComfyUI has no int8 GEMM it dequantizes the weights. The CPU runs the\ncode paths but is not a target.\n\n## The nodes\n\n| Node | What it does |\n|---|---|\n| **ReCaVSR Model Loader** | `transformer` picks the DiT file in `models\u002Frecavsr`, bf16 or int8; `prompt.safetensors` and `flashdecoder.safetensors` are read from the same folder. The weights wait in RAM until a run. |\n| **ReCaVSR Upscale Video** | A VIDEO or IMAGE frames in, a VIDEO out, encoded to a file block by block as it is made: a clip's length costs disk, not memory. Save Video stores it without re-encoding; Get Video Components turns it into IMAGE frames when another node needs them. The terminal shows each stage, a progress bar with every block's transformer and decode time, and a summary with the frame rate. |\n\n**ReCaVSR Upscale Video**'s inputs:\n\n| Input | |\n|---|---|\n| `scale` | Output size = input size × scale, each side rounded half up. 4 is what the model was trained for. |\n| `color_fix` | `none`, `adain` (each frame's mean and variance matched to the input) or `wavelet` (the input's low frequencies under the output's detail), StableSR's corrections. |\n| `seed` | The one-step noise. |\n| `decoder` | `flashdecoder`, the model's own, streaming; or `vae`, the Wan 2.2 VAE connected to the optional `vae` input, decoded at the end. |\n| `kernels` | `fast` (default) or `exact`, above. |\n| `kv_offload` | Keeps the attention history in RAM between blocks instead of VRAM. The node turns it on by itself when the output wouldn't fit otherwise (see [Long and large videos](#long-and-large-videos)). |\n| `video` \u002F `images` | The input: connect one. A video is read a block at a time and keeps its audio and frame rate; images are held in memory as ComfyUI images are (float32, 88 MB per 3840×1920 frame), and the output gets `fps` and no audio. |\n| `encoder` | `auto` (default) tries `hevc nvenc`, then `h264 nvenc`, then `h264`, and takes the first that runs at the output size. The NVENC ones use NVIDIA's video encoder, a separate unit beside the CUDA cores (constant quality 19 \u002F 17; H.264 up to 4096 pixels a side, HEVC up to 8192); `h264` is x264 on the CPU (CRF 14) and plays everywhere. A specific choice falls back down the same order. Frames become 8-bit on the GPU and are copied and encoded while the next block computes. |\n\n## Requirements\n\n| | Tested |\n|---|---|\n| ComfyUI | 0.44.0 |\n| GPU | RTX 3090 and RTX 4090, 24 GB each. Attention: sage |\n| PyTorch | 2.14.1 with CUDA 13.2, Linux |\n| Python packages | `triton` for the two attention kernels and `opencv-python-headless` for the reference's frame resize (`requirements.txt`). Both are optional, see [Smaller cards and other setups](#smaller-cards-and-other-setups) |\n\n- **int8** runs comfy-kitchen's int8 GEMM, which needs an NVIDIA GPU of compute capability 7.5 or newer (RTX 20 series\n  up). Elsewhere ComfyUI dequantizes the weights, which saves memory but not time.\n- **`kernels` fast** uses comfy-kitchen's `adaln` and `apply_rope1`, and for the decoder its `window_attention`, which\n  needs compute capability 8.0 (RTX 30 series up). All of them have eager versions, so fast mode loads anywhere.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Checked against the reference\u003C\u002Fb>\u003C\u002Fsummary>\n\n`tests\u002Fparity.py` replays a capture of ReCaVSR's own runtime (its input blocks, noise and latents) through the nodes. On\nthe same GPU (RTX 3090, PyTorch 2.14) with `exact` kernels, every latent, every decoded frame and the final uint8 and\nwavelet-corrected frames are identical, bit for bit, for:\n\n- 31 frames at 2x (976×1660, padded to 992×1664): the Triton windowed-attention path;\n- 101 frames at 1x (488×830): the full-grid attention path, the rolling RoPE window and the anchor cache.\n\nTwo things move the result off bit-exactness: ComfyUI's attention backend for the 512-token cross-attention (xformers\nand sage differ from PyTorch SDPA by one bf16 ulp; the final frames then differ by half a grey level on average), and\na different GPU architecture. The reference's speed without `torch.compile` is what `exact` runs at.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Where the time goes, and what was tried\u003C\u002Fb>\u003C\u002Fsummary>\n\nProfile of one bf16 exact body step at 2x (1.1 s of GPU time on the RTX 3090): bf16 GEMMs 52% (feed-forward 29%,\nattention projections 23%), the FlashDecoder 16% (half of it its own attention kernel), the Triton self-attention 12%,\nthe two LQ convolutions 8%, and about 16% in unfused float32 casts, norms, modulation and residual adds. After int8 and\nthe fast kernels (0.57 s): self-attention 21%, FlashDecoder 24%, LQ convolutions 16%, int8 GEMMs 16% plus 3% activation\nquantization.\n\nWhat `fast` does (each measured on its own; each differs from exact by one bf16 rounding step):\n\n- the transformer's three norm + modulation steps per block and the head through comfy-kitchen's `adaln` (8× faster\n  per call; the modulation is bf16 instead of float32);\n- the spatial RoPE through `apply_rope1` (10×), in the transformer and for the decoder's queries (the decoder's\n  cached keys stay float32: rounding them first cost 1.3 dB);\n- the gated residual adds in the output projections' epilogues (`addcmul`, or the int8 GEMM's fused residual);\n- the self-attention kernel with 8×8×2 query tiles and 8 warps instead of 4×8×2 and 4 (−18%);\n- the decoder's refinement kernel with 4×8 query tiles instead of 4×16 (−48%), and its backbone attention through\n  comfy-kitchen's `window_attention` (−44%).\n\nMeasured and not used:\n\n- torch.compile: on the exact math, compiling every block was slower than the fused kernels, took 30 s per process and\n  graph-broke on ComfyUI's op internals; on the fused kernels it fails on the `adaln` custom op; with int8 weights it\n  cannot trace the GEMM.\n- comfy-kitchen's `na3d` for the self-attention: 20% faster for the first block, which has no history, 3× slower for\n  every later one, because it computes queries for the history planes too.\n- an int8 FlashDecoder: 11% faster decoder, 3.7 dB lost.\n- `fp16_conv3d`, cuDNN's benchmark and channels-last modes, and an unfold + GEMM formulation for the LQ convolutions:\n  all slower than cuDNN's bf16 implicit GEMM.\n- fp8 weights: ConvRot int8 is both faster (4× the bf16 rate on the RTX 4090, 2.9× on the RTX 3090) and more accurate\n  (0.96% weight error) than per-tensor fp8.\n- TensorRT, assessed and not built: the time is in GEMMs that already run cuBLAS\u002Fcutlass kernels and in two custom\n  Triton kernels that an engine would need as plugins, and the streaming history makes every block a different shape.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Building the int8 file yourself\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\npython custom_nodes\u002FComfyUI-ReCaVSR\u002Ftools\u002Fconvert_int8.py ComfyUI\u002Fmodels\u002Frecavsr\u002Ftransformer.safetensors\n```\n\nIt writes `transformer_int8_convrot.safetensors` in about a minute on a GPU: the 30 blocks' self-attention,\ncross-attention query and output, and feed-forward weights as int8 with a scale per output row and a 256-wide block\nHadamard rotation (ComfyUI's int8 ConvRot format, run by comfy-kitchen's int8 GEMM with per-token activation\nquantization and the feed-forward's GELU fused into the second GEMM's input). The patch embedding, LQ projection,\nconditioning, cross-attention keys and values (computed once per video), norms and head stay bf16. Mean relative weight\nerror 0.96%.\n\u003C\u002Fdetails>\n\n## Troubleshooting\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Out of memory at large output sizes\u003C\u002Fb>\u003C\u002Fsummary>\n\nThe node fits the output to the card by itself (see [Long and large videos](#long-and-large-videos)); when even the\nfitted activations don't fit, it stops before loading anything and names the largest `scale` that would. Lower `scale`\nor upscale a smaller input. Through the `images` input, long clips also fill RAM; connect a VIDEO instead.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>\u003Ccode>decoder\u003C\u002Fcode> \u003Ccode>vae\u003C\u002Fcode> is very slow\u003C\u002Fb>\u003C\u002Fsummary>\n\nThat is the Wan 2.2 VAE decoding the whole video at the end, minutes at these sizes, tiled when it doesn't fit (see\n[the comparison](#flashdecoder-or-the-wan-22-vae)). FlashDecoder decodes 25 to 40 times faster, a little softer.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>The first run is slow\u003C\u002Fb>\u003C\u002Fsummary>\n\nTriton builds the attention kernels for each output size on first use, 10 to 30 s; they are cached on disk after that.\nReading the 10.6 GB transformer from disk the first time depends on the drive.\n\u003C\u002Fdetails>\n\n## License and credits\n\nThe code of this pack: GPL-3.0 (`LICENSE`), like ComfyUI. The model code ported from ReCaVSR's runtime\n(`recavsr\u002Fattention.py`, `cache.py`, `dit.py`, `flashdecoder.py` and `session.py`, with ReCaVSR's two Triton attention\nkernels) stays under Apache-2.0 (`LICENSE-APACHE`); `NOTICE` lists it. ReCaVSR is by Xijun Wang, Xin Li, Suhang Yao,\nZirui Lang, Bingchen Li and Zhibo Chen, University of Science and Technology of China\n([code](https:\u002F\u002Fgithub.com\u002Fkopperx\u002FReCaVSR), [project page](https:\u002F\u002Fkopperx.github.io\u002FReCaVSR\u002F),\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.37831)). Its transformer is Wan2.2 TI2V-5B (Alibaba Wan team, Apache-2.0) with\nReCaVSR's adapters merged in. [kopper\u002FReCaVSR](https:\u002F\u002Fhuggingface.co\u002Fkopper\u002FReCaVSR) states no licence for the weights;\nthe int8 file on Hugging Face is converted from them and follows their terms. The two sample clips are inputs 021 and\n009 of ReCaVSR's real-world demo set ([anonyaa\u002FReCaVSR](https:\u002F\u002Fhuggingface.co\u002Fanonyaa\u002FReCaVSR)). Colour correction\nfollows [StableSR](https:\u002F\u002Fgithub.com\u002FIceClear\u002FStableSR).\n\n```bibtex\n@misc{wang2026recavsronestepstreamingdiffusion,\n  title={ReCaVSR: One-Step Streaming Diffusion Video Super-Resolution with Recycled Latents and Learned Cache Routing},\n  author={Xijun Wang and Xin Li and Suhang Yao and Zirui Lang and Bingchen Li and Zhibo Chen},\n  year={2026},\n  eprint={2609.37831},\n  archivePrefix={arXiv},\n  primaryClass={cs.CV},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.37831}\n}\n```\n","ComfyUI-ReCaVSR 是一个将 ReCaVSR 视频超分辨率模型原生集成至 ComfyUI 工作流的插件，支持单步流式视频超分（4×），基于 Wan2.2 TI2V-5B 架构。核心特性包括块级并行处理（21帧+8帧分块）、FlashDecoder 实时解码、bf16\u002Fint8 ConvRot 优化核，可在 RTX 3090\u002F4090（最低8GB显存）上高效运行。适用于实时或近线性延迟的高清视频修复、老片增强、监控视频清晰化等对吞吐与显存敏感的生产场景。",2,"2026-11-24 04:43:57","CREATED_QUERY"]