> For the complete documentation index, see [llms.txt](https://docs.dreamerland.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dreamerland.ai/basic-terms/sampling-method.md).

# Sampling method

There are several sampling methods are available in Dreamerland including Euler A, Euler, DDIM, DPM++ 2M Karras, DMP++2M SDE Karras and UniPC

<figure><img src="https://2310956826-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftbrc6W2n35oVxftMovDQ%2Fuploads%2FIdmr1nYlDYUhleB1itzh%2FIMG_7752.jpg?alt=media&amp;token=687f8c7e-a394-4de7-8f7d-a19cc2bac56e" alt="" width="375"><figcaption></figcaption></figure>

In order to understand what sampling method is, we have to know how Stable Diffusion generate an image from scratch.

To generate an image, Stable Diffusion begins by generating a completely random image in the latent space. Then, the noise predictor estimates the noise within the image, which is subsequently subtracted. This iterative process is repeated multiple times, resulting in a final output of a clean image.&#x20;

The process to remove noise and generate new images at each step is referred to as **sampling**. The method used in sampling is called the sampler or sampling method. The sampling method remove noise and generate a cleaner image each step.&#x20;

<figure><img src="https://2310956826-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftbrc6W2n35oVxftMovDQ%2Fuploads%2FARKlpwl1unyYO4sO4o3S%2Fcat_euler_15.webp?alt=media&amp;token=f8ea4586-fdf6-48f5-9114-d06948243108" alt="" width="256"><figcaption><p>Sampling process step by step</p></figcaption></figure>

**What the difference between sampling methods?**

They are different mathematic method to predict noise. We will give you a big picture of each one but we won't go into technical here.

**Euler A and Euler**

A stands for Ancestral. Ancestral sampler will add noise to the image at each step. Therefore the result of Euler A will be more creative. However, Euler A would not converge because noise will be added at each step to introduce randomness.

<figure><img src="https://2310956826-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftbrc6W2n35oVxftMovDQ%2Fuploads%2FHrBLPQQ7jNhlWHJvgZsi%2Feuler-2-40.webp?alt=media&amp;token=3c6cbd65-617b-4f7a-9001-d0d6d70854c2" alt="" width="256"><figcaption><p>Euler</p></figcaption></figure>

<figure><img src="https://2310956826-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftbrc6W2n35oVxftMovDQ%2Fuploads%2FcRy8t8WHHhLIWxymCekh%2Feuler-a-2-40.webp?alt=media&amp;token=5b115561-d0ef-4dfb-8ab4-892990a4b5b9" alt="" width="256"><figcaption><p>Euler A</p></figcaption></figure>

**DDIM**

DDIM (Denoising Diffusion Implicit Model) is one of the first samplers designed for diffusion models. DDIM only takes eight steps to achieve incredible images

**DPM++**

DPM++ trades speed for quality. It normally take more steps than other sampling methods to get high quality images. It’s better suited for highly tuned prompts.

**UniPC**&#x20;

UniPC (Unified Predictor-Corrector) Framework for Fast Sampling of Diffusion Models is introduced in 2023 by Wenliang Zhao, Lujia Bai, Yongming Rao, Jie Zhou, Jiwen Lu. it can achieve high-quality image generation in **5-10 steps**.
