# Dyfuzja w przestrzeni ukrytej (Stable Diffusion)

EN: **Latent diffusion (Stable Diffusion)** · id `latentdiffusion` · aliases: latent diffusion, LDM, Stable Diffusion, dyfuzja latentna

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Sieci i modele generatywne](https://aiatlasgraph.com/t/neural.md) › [Rodziny modeli generatywnych](https://aiatlasgraph.com/t/generative.md) › [Modele dyfuzyjne](https://aiatlasgraph.com/t/diffusion.md) › Dyfuzja w przestrzeni ukrytej (Stable Diffusion)

## Description

- PL: Dyfuzja prowadzona w skompresowanej przestrzeni autoenkodera zamiast bezpośrednio na pikselach, co zmniejsza koszt obliczeń; warunkowanie tekstem może być realizowane przez cross-attention. Tę konstrukcję wykorzystują modele z rodziny Latent Diffusion, w tym Stable Diffusion.
- EN: Diffusion performed in an autoencoder's compressed latent space rather than directly in pixel space, reducing computation; text conditioning can be implemented through cross-attention. This design is used by Latent Diffusion models, including Stable Diffusion.

## In one sentence

- PL: To tworzenie obrazu przez odszumianie jego mniejszego, ukrytego zapisu zamiast pełnego zestawu punktów zdjęcia.
- EN: This generates images by denoising a smaller latent representation rather than every image pixel.

## Problem it solves

- PL: Praca bezpośrednio na dużych obrazach wymaga wielu obliczeń i dużej ilości pamięci.
- EN: Working directly on large images requires substantial computation and memory.

## What it does

- PL: Kompresor skraca zapis obrazu, generator pracuje na tym skrócie, a dekoder zamienia wynik z powrotem w widoczne zdjęcie.
- EN: An encoder compresses an image, the generator works on that compact representation, and a decoder turns the result back into visible pixels.

## Everyday example

- PL: Generator plakatu wykonuje większość kroków na skompresowanym zapisie i dopiero na końcu odtwarza pełny obraz.
- EN: A poster generator performs most steps on a compressed representation and reconstructs the full image only at the end.

## This concerns you if you…

- PL: chcesz obniżyć koszt generowania obrazów
- PL: poznajesz ukryty zapis używany przez generator
- EN: want to reduce image-generation costs
- EN: study the latent representation used by a generator

## Keywords

Stable Diffusion · VAE latents · cross-attention conditioning · image autoencoders · latent-space denoising · pixel-space diffusion · reconstruction bottleneck

## How it works

- PL: Autoenkoder kompresuje dane do latentu, w którym model uczy i wykonuje odszumianie. Warunek tekstowy może wchodzić przez cross-attention, a dekoder odtwarza piksele po zakończeniu procesu generowania.
- EN: An autoencoder compresses data into a latent where the model learns and performs denoising. Text conditions can enter through cross-attention, and a decoder reconstructs pixels after generation finishes.

## Limits

- PL: Kompresja wyznacza granicę zachowanych szczegółów. Błędy autoenkodera przechodzą do wyniku, a generowanie nadal wymaga kolejnych kroków; edycje zależą od zgodności warunku i latentu.
- EN: Compression limits retained detail. Autoencoder errors propagate to outputs, and generation still needs successive steps; editing depends on compatibility between conditions and latents.

## Key terms

- PL: **latent obrazu**: Skompresowana reprezentacja obrazu używana zamiast bezpośrednich pikseli.
- PL: **dekoder obrazu**: Moduł odtwarzający przestrzeń pikseli z reprezentacji ukrytej.
- EN: **image latent**: A compressed image representation used instead of direct pixels.
- EN: **image decoder**: A module reconstructing pixel space from a latent representation.

## Know first

- [Autoenkodery wariacyjne (VAE) (Variational autoencoders (VAE))](https://aiatlasgraph.com/t/vae.md)
- [Mechanizm self-attention (zapytania, klucze, wartości) (Self-attention (queries, keys, values))](https://aiatlasgraph.com/t/selfattention.md)

## Examples

- PL: autoenkoder obrazu (VAE) · warunkowanie tekstem przez cross-attention · Stable Diffusion
- EN: image autoencoder (VAE) · text conditioning via cross-attention · Stable Diffusion

## Related topics

Untyped, symmetric "see also" links.

- [Autoenkodery wariacyjne (VAE) (Variational autoencoders (VAE))](https://aiatlasgraph.com/t/vae.md)
- [Dyfuzja w przestrzeni pikseli (Pixel-space diffusion)](https://aiatlasgraph.com/t/pixeldiffusion.md)
- [Generowanie muzyki i efektów dźwiękowych (Music and sound generation)](https://aiatlasgraph.com/t/audiogen.md)
- [Generowanie obrazu i wideo (Image and video generation)](https://aiatlasgraph.com/t/imagegen.md)
- [Generowanie obrazów z opisu tekstowego (Text-to-image generation)](https://aiatlasgraph.com/t/texttoimage.md)

## Sources

- [What are Diffusion Models?](<https://lilianweng.github.io/posts/2021-07-11-diffusion-models/>) `lilianweng-diffusion-2021` · by Lilian Weng
- [High-Resolution Image Synthesis with Latent Diffusion Models](<https://arxiv.org/abs/2112.10752>) `latent-diffusion-2021` · by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer
- [Hugging Face Diffusion Models Course — syllabus](<https://huggingface.co/learn/diffusion-course/unit0/1>) `hf-diffusion-course` · by Jonathan Whitaker, Lewis Tunstall (Hugging Face) · sponsored

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/latentdiffusion · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
