Refiner: Two-stage generation for enhanced detail

A two-stage SDXL generation process that enhances fine details, textures, and overall image quality.

Introduction

SDXL refiner models implement a two-stage generation process that can enhance image quality. The base model creates the initial image with overall composition and content, then a refiner model takes over to improve details and textures in the final denoising steps.

Refiner models are exclusive to the SDXL architecture. Newer architectures like FLUX and HiDream, as well as third-party models like Recraft and Ideogram, do not use or support refiners. If you're working with these models, you can achieve comparable quality improvements through higher step counts, creative upscaling via image-to-image , or dedicated upscaling models.

Our refiner model implementation uses the Ensemble of Expert Denoisers method, where image generation begins with the base model and concludes with the refiner model. This is a continuous process with no intermediate image generated. The base model processes the latent tensor for a specified number of steps, then hands it off to the refiner model to complete the remaining steps.

0

How it works

The process works as follows:

  1. The SDXL base model begins denoising the random latent tensor.
  2. At a specified transition point (controlled by startStep or startStepPercentage), the refiner model takes over and continues denoising from this exact point, enhancing details, textures, and overall coherence.
  3. The final image is generated only after the refiner completes its processing.

Request structure

The refiner parameter is an object that contains several sub-parameters:

[
  {
    // other parameters...
    "refiner": {
      "model": "civitai:101055@128080",
      "startStepPercentage": 90
    }
  }
]

The refiner model is trained to excel at detail enhancement in the final denoising stages, not for the entire generation process. Starting the refiner too early can produce poor results, as these models lack the capability to form basic compositions and structures. For optimal results, limit the refiner to the final 5-15% of steps.

Tips

  1. Start at 85-90%. This gives the refiner 4-6 steps out of a typical 30-40 step run, which is enough to enhance textures and fine detail without disrupting the base model's composition.
  2. Increase total steps when using a refiner. A refiner at 90% on 20 steps only gets 2 refiner steps. Use 30-40 total steps to give both stages enough room to work.
  3. Compare with and without. The refiner's effect is subtle. Generate the same seed with and without the refiner to decide if the quality difference justifies the extra compute for your use case.