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

Kandinsky2.2 Text Encoder

The Full Kandinsky 2.2 Prior Encoder — With a Real Negative Prompt

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

Most people never use this node - the pack's own example workflows reach for the slimmed comfy-kandinsky22-positive-text-encoder instead. But this is the complete version of Kandinsky 2.2's prior: it takes both a prompt and a negative_prior, and gives you back clean image_embeds and negative_image_embeds outputs.

As with its positive-only sibling, "text encoder" is a fib. This node runs the prior - a small diffusion model that denoises in image-embedding space - for num_inference_steps before it hands anything to the decoder. That's the DALL·E-2-style two-stage design that made Kandinsky 2.2 interesting in 2023: the text gets "imagined" into an embedding first, and only then does the UNet decode pixels.

The inputs

  • text_encoder - from the Prior Loader's TEXT_ENCODER output.
  • prompt - multiline, your positive.
  • negative_prior - multiline, your negative. Unlike the positive-only node, this one actually feeds the classifier-free guidance inside the prior, so negative text steers the embedding, not just the pixels.
  • num_inference_steps (default 20) - diffusion steps in the prior.
  • guidance_scale (default 8) - CFG for the prior pass. 0 disables CFG entirely.
  • seed - the prior's noise seed.

Outputs: image_embeds and negative_image_embeds, both PRIOR_LATENT. Wire image_embeds into the Unet Decoder's image_embeds port and negative_image_embeds into its negative_image_embeds port, and you've got a proper two-port conditioning setup - the only reason you need the two-positive-encoder hack from the simple workflow is that this node didn't get used there.

Installing it

Same pack install as everything else here - manual clone, since the README says the repo isn't in ComfyUI Manager's list:

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

Models go 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

Gotchas

  • Wrong folder, wrong loader. The ckpt dropdowns on both loaders list every folder in models/checkpoints whose name contains "kandinsky" - all three of them. The Prior Loader must point at kandinsky-2-2-prior. Choose the decoder folder and loading blows up.
  • Slow, then slow. A prior diffusion pass plus a decoder pass plus fp16 model shuffling between GPU and CPU. Budget for it.
  • Dependency pin. requirements.txt locks diffusers to an old commit and accelerate==0.27.2, so installing this pack can break other nodes that want newer versions. It's the first thing to suspect when unrelated things start failing after install.
  • It's a relic, honestly. Kandinsky 2.2 is a 2023 model that the community stopped talking about around mid-2024. It has a distinctive painterly style and genuinely good prompt adherence for its era - fun to run, not your daily driver.

If you don't need a negative inside the prior, the positive-only node is lighter and matches the author's example graphs. Reach for this one when you want real negative conditioning in the embedding pass.

Categoryconditioning

Inputs (6)

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

Outputs (2)

NameTypeDescription
image_embedsPRIOR_LATENT
negative_image_embedsPRIOR_LATENT