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

Replicate ai-forever/kandinsky-2.2

Run Kandinsky 2.2 in ComfyUI

By replicate·Created 2 years ago·Updated 2 years ago· 206
Replicate ai-forever/kandinsky-2.2
    • IMAGE
    promptA moss covered astronaut with a black background
    negative_prompt
    width512
    height512
    num_inference_steps75
    num_inference_steps_prior25
    num_outputs1
    seed
    output_formatwebp
    force_rerunfalse

    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.

    CategoryReplicate

    Inputs (10)

    NameTypeDefaultDescription
    promptoptSTRINGA moss covered astronaut with a black background
    negative_promptoptSTRING
    widthoptCOMBO51213 options: 384, 512, 576, 640, 704, 768, +7
    heightoptCOMBO51213 options: 384, 512, 576, 640, 704, 768, +7
    num_inference_stepsoptINT751–500
    num_inference_steps_prioroptINT251–500
    num_outputsoptINT11–4
    seedoptINT
    output_formatoptCOMBOwebp3 options: webp, jpeg, png
    force_rerunoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE