Replicate ai-forever/kandinsky-2
The two-stage text-to-image model, via API
- IMAGE
Kandinsky 2 is a text-to-image model with a distinctly dreamy, painterly aesthetic and an unusual architecture under the hood. It came out of the AI-Forever / Sber group and had its moment before SDXL and Flux took over. Today it's mostly a "different look" tool - you reach for it when you specifically want its style, not because it beats a modern model on sharpness or prompt adherence. This node runs it through Replicate's cloud, so there's nothing to download and no VRAM needed; you just need a Replicate account, a REPLICATE_API_TOKEN, and to accept that each run costs Replicate credits.
How it works
The interesting thing about Kandinsky is that it's a two-stage model. A "prior" first maps your text prompt into an image embedding (a CLIP-style latent), then a diffusion decoder turns that embedding into pixels. That's why you'll see two sets of controls: the prior_* ones tune the text-to-embedding stage, and the sampler ones tune the pixels stage. Most models fold this into one step; Kandinsky exposes both, which is unusual and occasionally useful.
The inputs and outputs that matter
prompt- what to generate. Kandinsky likes fairly direct descriptions.num_inference_steps(50) andguidance_scale(4) - the decoder's step count and prompt adherence. Note the default guidance is lower than SDXL's; that's tuned for this model, don't crank it blindly.width/height(512) - pick from the offered sizes (256 up to 1024). It's a 512-native-era model, so very large sizes aren't its strength.prior_cf_scale(4) andprior_steps("5") - the prior stage's guidance and steps. Leave these near defaults unless you're deliberately experimenting.scheduler-p_sampler(default),ddim_sampler, orplms_sampler.
Output is a single IMAGE (batch up to 4 via batch_size). output_format/output_quality set the file, seed fixes the result, and force_rerun bypasses Replicate's cache.
How to install it
One install brings every Replicate node.
- ComfyUI Manager: search ComfyUI-Replicate, install, restart.
- Manual:
then restart.cd ComfyUI/custom_nodes git clone https://github.com/replicate/comfyui-replicate cd comfyui-replicate pip install -r requirements.txt
No weights download - just the replicate pip package. Set your token first: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens).
Common issues & troubleshooting
It's not as sharp or prompt-accurate as SDXL/Flux. Right - it's an older model, and that's the honest baseline. Use Kandinsky when you want its particular painterly, slightly surreal look; if you want maximum fidelity and prompt adherence, this isn't the model, and no setting will close that gap. It's a stylistic choice, not a quality upgrade.
Big images look off. Kandinsky is happiest around its 512-era resolutions. Generate at a supported size near 512–768 and upscale afterward rather than asking for 1024 directly.
Changing guidance_scale made it worse. The default of 4 is deliberately lower than the CFG 7+ you'd use on SDXL. Kandinsky over-bakes if you push guidance too high - small adjustments only.
Same image on a re-run. Replicate returned the cached result for identical inputs. Change the seed or set force_rerun.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | red cat, 4k photo | — |
| num_inference_stepsopt | INT | 501–500 | — |
| guidance_scaleopt | FLOAT | 4.001–20 | — |
| scheduleropt | COMBO | p_sampler | 3 options: ddim_sampler, p_sampler, plms_sampler |
| prior_cf_scaleopt | INT | 4 | — |
| prior_stepsopt | STRING | 5 | — |
| widthopt | COMBO | 512 | 7 options: 256, 288, 432, 512, 576, 768, +1 |
| heightopt | COMBO | 512 | 7 options: 256, 288, 432, 512, 576, 768, +1 |
| batch_sizeopt | COMBO | 1 | 4 options: 1, 2, 3, 4 |
| seedopt | INT | — | |
| output_formatopt | COMBO | webp | 3 options: webp, jpg, png |
| output_qualityopt | INT | 800–100 | — |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |