Nodes/Kandinsky 2.2 ComfyUI Plugin/Kandinsky2.2 Positive Text Encoder
ComfyUI Node

Kandinsky2.2 Positive Text Encoder

This \"Text Encoder\" Runs a Whole Diffusion Pass — Kandinsky 2.2's Prior, Positive-Only

By vsevolod-oparin·Created 3 years ago·Updated about a year ago· 9
Kandinsky2.2 Positive Text Encoder
  • text_encoder
  • image_embeds
num_inference_steps20
guidance_scale8.0
seed0
prompt

If you clicked this expecting a CLIP loader, stop. The name is doing some heavy lifting: in Kandinsky 2.2 the "text encoder" is the entire prior stage - a separate diffusion model that runs for num_inference_steps before the decoder ever sees your prompt. This node is that prior, wired for the positive prompt only.

Kandinsky 2.2 (Sber/ai-forever, mid-2023) is a two-stage architecture, in the lineage of DALL·E 2's unCLIP: a prior turns text into image embeddings, and a decoder turns those embeddings plus noise into pixels. ComfyUI's normal CLIP conditioning won't work here at all, which is why this pack exists. This node produces a PRIOR_LATENT (the image_embeds output) - not a conditioning you can plug into an SD sampler.

The "positive" part is the whole point

This is the slimmed version of the pack's comfy-kandinsky22-text-encoder node. The full one has a negative_prior field; this one drops it, so there's no negative prompt to steer away from inside the prior. That sounds like a downgrade, but it's how the author builds his shipped workflows: run a second Positive Text Encoder with a negative-ish phrase like low quality, bad quality as its positive prompt, and plug that output into the Unet Decoder's negative_image_embeds port. The "negative prompt" you type becomes a second positive prompt. Works fine, it just means the blank-prompt optimization never kicks in.

The inputs that matter

  • text_encoder - from the Prior Loader's TEXT_ENCODER output.
  • prompt - multiline, the one you care about.
  • num_inference_steps (default 20) - diffusion steps inside the prior. More steps = more stable embeddings, slower.
  • guidance_scale (default 8) - classifier-free guidance for the prior pass. This is separate from the decoder's CFG; Kandinsky runs two CFG values per generation.
  • seed - reproducibility for the embedding pass.

Output: image_embeds (PRIOR_LATENT), which feeds the Unet Decoder's image_embeds port - or the negative_image_embeds port if you're doing the two-node negative trick.

Installing it

The README notes this repo isn't in ComfyUI Manager's list, so install manually:

cd ComfyUI/custom_nodes
git clone https://github.com/vsevolod-oparin/comfyui-kandinsky22
cd comfyui-kandinsky22
python -s -m pip install -r requirements.txt

Then grab the models into ComfyUI/models/checkpoints:

git clone --depth 1 https://huggingface.co/kandinsky-community/kandinsky-2-2-prior
git clone --depth 1 https://huggingface.co/kandinsky-community/kandinsky-2-2-decoder
git clone --depth 1 https://huggingface.co/kandinsky-community/kandinsky-2-2-controlnet-depth

Two gotchas: requirements.txt pins an old diffusers commit and accelerate==0.27.2, which can shift shared packages and break other custom nodes. And git clone shows almost no progress on these multi-GB repos, so it looks frozen when it's actually chugging.

Where people get burned

  • Wrong model folder. Both loader dropdowns filter models/checkpoints for anything named "kandinsky", so all three model folders appear in both loaders. The Prior Loader must point at kandinsky-2-2-prior, or from_pretrained just errors.
  • It's slow, and that's normal. Two diffusion passes per image, plus a big fp16 model shuffle on and off GPU between stages. A 20-step prior + 80-step decoder at 768×768 takes a while.
  • It's a 2023 model. Community chatter about Kandinsky 2.2 basically ended in mid-2024. This is a curiosity - a genuinely different look and a fun weekend - not a daily driver next to Flux or SDXL.

If you want the version with a real negative prompt field, use comfy-kandinsky22-text-encoder instead. This one is the lighter tool for the simpler graphs.

Categoryconditioning

Inputs (5)

NameTypeDefaultDescription
text_encoderTEXT_ENCODER
num_inference_stepsINT201–10000
guidance_scaleFLOAT8.00–100
seedINT00–18446744073709550000
promptSTRING

Outputs (1)

NameTypeDescription
image_embedsPRIOR_LATENT