Class SDXLRefiner<T>
SDXL Refiner model for enhancing generated images.
public class SDXLRefiner<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
SDXLRefiner<T>
- Inherited Members
Remarks
The SDXL refiner is a specialized model trained to enhance the fine details of images generated by the SDXL base model. It operates in the latent space and is designed to work with partially denoised latents.
For Beginners: Think of the refiner as a "finishing touch" step:
Without refiner: Base image (good structure, okay details)
With refiner: Refined image (same structure, enhanced details like texture, sharpness)
The refiner uses lower noise levels (typically 0.2-0.4 denoising strength) to preserve the overall composition while enhancing fine details.
Constructors
SDXLRefiner(UNetNoisePredictor<T>, IVAEModel<T>, INoiseScheduler<T>, IConditioningModule<T>?, int?)
Initializes a new SDXL refiner.
public SDXLRefiner(UNetNoisePredictor<T> refinerUNet, IVAEModel<T> vae, INoiseScheduler<T> scheduler, IConditioningModule<T>? conditioner = null, int? seed = null)
Parameters
refinerUNetUNetNoisePredictor<T>The refiner U-Net.
vaeIVAEModel<T>The VAE (shared with base model).
schedulerINoiseScheduler<T>The scheduler.
conditionerIConditioningModule<T>Optional conditioning module.
seedint?Optional random seed.
Fields
NumOps
Provides numeric operations for the specific type T.
protected static readonly INumericOperations<T> NumOps
Field Value
- INumericOperations<T>
Methods
Refine(Tensor<T>, string, string?, int, double, int?)
Refines an image by enhancing details.
public Tensor<T> Refine(Tensor<T> image, string prompt, string? negativePrompt = null, int numInferenceSteps = 25, double denoiseStrength = 0.3, int? seed = null)
Parameters
imageTensor<T>The input image to refine.
promptstringText prompt describing the image.
negativePromptstringOptional negative prompt.
numInferenceStepsintNumber of refiner steps.
denoiseStrengthdoubleDenoising strength (0.0-1.0).
seedint?Optional random seed.
Returns
- Tensor<T>
Refined image tensor.