Replicate ai-forever/kandinsky-2.2
Run Kandinsky 2.2 in ComfyUI
- IMAGE
Kandinsky 2.2 is a text-to-image model from the AI-Forever / Sber group - a Stable-Diffusion-era model with its own distinct look and, architecturally, its own twist: it uses an image-prior stage before decoding. It never became a ComfyUI mainstay the way SD did, which makes it a nice fit for this pack: through ComfyUI-Replicate you can run Kandinsky on Replicate's cloud and pull its output into a graph without setting up a whole separate model stack for a checkpoint you might only want occasionally.
How it works
The thing that makes Kandinsky different from vanilla SD is the two-stage design. A "prior" model first maps your text into an image embedding (CLIP-style), and then a diffusion decoder turns that embedding into pixels. That's why this node has two step counts - one for the prior, one for the main diffusion. You don't have to think about the plumbing; the node sends your prompt and settings to Replicate and returns an IMAGE.
Inputs and outputs that matter
Output is an IMAGE.
prompt/negative_prompt- your text.width/height- chosen from a fixed list of sizes (384 up to 1536-ish), default 512. Kandinsky 2.2's comfort zone is lower than SDXL's, so don't expect clean 1024² the way you would from SDXL.num_inference_steps(75) - the main decoder steps. High by default; you can bring it down to trade a little quality for speed and cost.num_inference_steps_prior(25) - steps for the prior stage. Leave it unless you're experimenting.num_outputs(1) - batch up to 4.
seed fixes the roll, output_format picks webp/jpeg/png, and force_rerun forces a fresh generation.
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
Image output, cleanly supported - no pack output caveats.
Two model-specific things worth knowing. First, resolution: Kandinsky 2.2 is a 2023-era model and looks best at the sizes it was trained around. Push it to very large dimensions and coherence falls apart faster than a modern model would. Second, that default of 75 steps is generous and directly drives your cost per run - if you're just exploring, drop it substantially; you rarely need the full 75 to judge whether a prompt is working.
And the pack basics: a missing REPLICATE_API_TOKEN is the first-run error, and each generation bills on Replicate. Kandinsky has a recognizable aesthetic that some people specifically want - that's the reason to reach for this node over a more modern generator; if you just want the best general image quality, newer models will serve you better.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | A moss covered astronaut with a black background | — |
| negative_promptopt | STRING | — | |
| widthopt | COMBO | 512 | 13 options: 384, 512, 576, 640, 704, 768, +7 |
| heightopt | COMBO | 512 | 13 options: 384, 512, 576, 640, 704, 768, +7 |
| num_inference_stepsopt | INT | 751–500 | — |
| num_inference_steps_prioropt | INT | 251–500 | — |
| num_outputsopt | INT | 11–4 | — |
| seedopt | INT | — | |
| output_formatopt | COMBO | webp | 3 options: webp, jpeg, png |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |