﻿# Kandinsky 2.2 prior outputs: image embeddings are not the image latent

Trace Kandinsky 2.2 positive and negative image embeddings from the prior to the decoder, and distinguish semantic conditioning from the generated spatial latent.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-kandinsky22-prior-embedding-decoder-boundary/
Language: en

## Identify the versioned architecture

The [official Kandinsky repository](https://github.com/ai-forever/Kandinsky-2) describes a family whose versions have different conditioning paths. This guide concerns Kandinsky 2.2. Its prior maps text toward an image-embedding representation used by a separate generation decoder. Do not transfer this interface automatically to another Kandinsky generation. A common family name does not establish whether a selected decoder consumes text directly, expects image embeddings, or uses a different text encoder and architecture.

## Distinguish embeddings from spatial latents

The [published prior artifact](https://huggingface.co/kandinsky-community/kandinsky-2-2-prior) demonstrates positive and negative image embeddings passed onward to image generation. These embeddings condition semantic content; they are not the decoder's final image and are not a spatial noisy latent ready for ordinary VAE decoding. A tensor's floating-point dtype is insufficient to identify its role. Label the artifact with its producer, field name, shape, and intended consumer rather than storing every intermediate under an ambiguous latent filename.

## Preserve both conditioning branches

The [library's Kandinsky guide](https://huggingface.co/docs/diffusers/main/en/using-diffusers/kandinsky) explains the prior's image_embeds and negative_image_embeds and the decoder interface. Changing a negative instruction requires changing the corresponding upstream conditioning, not merely attaching a new text field to a decoder call that does not accept it. Cache the paired conditions with the prior revision and actual prompt inputs. Reusing a positive result with an unrelated negative embedding silently creates a different guidance configuration.

## Diagnose an ineffective prompt change

Imagine retaining a cached embedding while changing the visible prompt from a wooden object to a metallic one. If the decoder receives the unchanged condition, the interface's new text may never affect the actual generation. Trace the prior invocation and cache key before adjusting decoder steps. The combined pipeline can hide these boundaries for convenience, but a custom split deployment must preserve them explicitly. Each stage's result should identify the conditioning that actually produced it.

## Measure the complete generation path

Record prior sampling configuration, embedding provenance, decoder revision, decoder sampling settings, and generated image. Time both stages when reporting end-to-end latency; a cached-prior result measures a different workload from a fresh request. Existing guides on [contrastive image-text spaces](/journal/clip-image-text-contrastive-space/) and [tensor-axis meaning](/journal/tensor-axes-batch-sequence-hidden/) provide background. Kandinsky 2.2's distinctive handoff is a versioned semantic image-embedding bundle, which must remain separate from spatial generation latents and final pixels.
