Replicate cjwbw/supir
Restoration-grade upscaling without the VRAM bill
- image
- IMAGE
SUPIR is the restoration-grade upscaler - the one that reframed upscaling as restoration rather than just adding pixels. It runs an SDXL backbone with an LLaVA model captioning the image first, so it repairs compression, noise, and blur while it scales, which is genuinely different from what an ESRGAN pass does. For about eighteen months it was the answer to "how do I fix this degraded photo." This node runs it on Replicate's cloud via ComfyUI-Replicate.
And this is one of the most defensible uses of the whole pack. SUPIR is notoriously VRAM-hungry - the reduced config still wants roughly 12GB for the diffusion model plus 16GB for LLaVA, because the caption model and the diffusion model both have to be resident. Running it locally is painful on anything short of a beefy card. Offloading to Replicate sidesteps that entirely.
How it works
SUPIR captions your image with a multimodal LLM, then conditions an SDXL-based restoration pass on that caption - so it restores toward a semantically plausible version of what it thinks it's looking at. That's the whole idea, and also the source of its one big failure mode (more below). The node sends your image and settings to Replicate and returns the restored IMAGE.
Inputs and outputs that matter
Required input is an IMAGE. Output is an IMAGE.
upscale(1) - the scale factor. SUPIR's value is the restoration; the actual resize is secondary.model_name-SUPIR-v0Q(default, the general-quality model) orSUPIR-v0F(tuned for lighter degradation / more fidelity).edm_steps(50) - diffusion steps. More is cleaner and slower.use_llava(true) - the captioning stage. On by default; it's what makes SUPIR SUPIR.a_prompt/n_prompt- a positive "quality" prompt and a negative one, both pre-filled with sensible restoration defaults.s_cfg(7.5) andcolor_fix_type(Wavelet) - guidance strength and color correction. Wavelet color-fix is a good default for keeping tones from drifting.
seed fixes the result; force_rerun forces a fresh pass. The rest (s_churn, s_noise, the s_stage/linear_CFG family) are fine-tuning knobs you can leave alone at first.
How to install it
ComfyUI Manager: search ComfyUI-Replicate, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/replicate/comfyui-replicate
cd comfyui-replicate
pip install -r requirements.txt
Restart, and set your token first:
export REPLICATE_API_TOKEN="r8_************"; python main.py
Token: replicate.com/account/api-tokens.
Common issues
The one you must know before pointing it at a person: SUPIR invents facial identity. It doesn't know your subject, so it rebuilds their face into one that fits the caption. The single most-upvoted response in SUPIR's own breakout thread is someone asking "Why does it change the facial features so much?" - the answer being that the model fits an unknown face to what it does know. This is design, not a settings bug. If you're restoring a photo of a specific person, keep the face out of the SUPIR pass and inpaint it separately.
Two more: don't use SUPIR on already-clean images - its restoration behavior adds texture nobody asked for; that's an ESRGAN or SeedVR2 job. And note the license - SUPIR's weights are non-commercial without written permission from the author, so calling it through Replicate doesn't buy you commercial rights to the output. For anything you'll sell, use a permissively licensed upscaler.
Pack basics apply: a missing REPLICATE_API_TOKEN errors on the first run, and each run bills on Replicate.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_nameopt | COMBO | SUPIR-v0Q | 2 options: SUPIR-v0Q, SUPIR-v0F |
| upscaleopt | INT | 1 | — |
| min_sizeopt | FLOAT | 1024.00 | — |
| edm_stepsopt | INT | 501–500 | — |
| use_llavaopt | BOOLEAN | true | — |
| a_promptopt | STRING | Cinematic, High Contrast, highly detailed, taken using a Canon EOS R camera, hyper detailed photo - realistic maximum detail, 32k, Color Grading, ultra HD, extreme meticulous detailing, skin pore detailing, hyper sharpness, perfect without deformations. | — |
| n_promptopt | STRING | painting, oil painting, illustration, drawing, art, sketch, oil painting, cartoon, CG Style, 3D render, unreal engine, blurring, dirty, messy, worst quality, low quality, frames, watermark, signature, jpeg artifacts, deformed, lowres, over-smooth | — |
| color_fix_typeopt | COMBO | Wavelet | 3 options: None, AdaIn, Wavelet |
| s_stage1opt | INT | -1 | — |
| s_churnopt | FLOAT | 5.00 | — |
| s_noiseopt | FLOAT | 1.00 | — |
| s_cfgopt | FLOAT | 7.501–20 | — |
| s_stage2opt | FLOAT | 1.00 | — |
| linear_CFGopt | BOOLEAN | false | — |
| linear_s_stage2opt | BOOLEAN | false | — |
| spt_linear_CFGopt | FLOAT | 1.00 | — |
| spt_linear_s_stage2opt | FLOAT | 0.00 | — |
| seedopt | INT | — | |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |