Nodes/ComfyUI-Replicate/Replicate ai-forever/kandinsky-2
ComfyUI Node

Replicate ai-forever/kandinsky-2

The two-stage text-to-image model, via API

By replicate·Created 2 years ago·Updated 2 years ago· 206
Replicate ai-forever/kandinsky-2
    • IMAGE
    promptred cat, 4k photo
    num_inference_steps50
    guidance_scale4.00
    schedulerp_sampler
    prior_cf_scale4
    prior_steps5
    width512
    height512
    batch_size1
    seed
    output_formatwebp
    output_quality80
    force_rerunfalse

    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) and guidance_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) and prior_steps ("5") - the prior stage's guidance and steps. Leave these near defaults unless you're deliberately experimenting.
    • scheduler - p_sampler (default), ddim_sampler, or plms_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:
      cd ComfyUI/custom_nodes
      git clone https://github.com/replicate/comfyui-replicate
      cd comfyui-replicate
      pip install -r requirements.txt
      
      then restart.

    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.

    CategoryReplicate

    Inputs (13)

    NameTypeDefaultDescription
    promptoptSTRINGred cat, 4k photo
    num_inference_stepsoptINT501–500
    guidance_scaleoptFLOAT4.001–20
    scheduleroptCOMBOp_sampler3 options: ddim_sampler, p_sampler, plms_sampler
    prior_cf_scaleoptINT4
    prior_stepsoptSTRING5
    widthoptCOMBO5127 options: 256, 288, 432, 512, 576, 768, +1
    heightoptCOMBO5127 options: 256, 288, 432, 512, 576, 768, +1
    batch_sizeoptCOMBO14 options: 1, 2, 3, 4
    seedoptINT
    output_formatoptCOMBOwebp3 options: webp, jpg, png
    output_qualityoptINT800–100
    force_rerunoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE