DynamicCFGScheduler<T>

Models & Types · AiDotNet.Diffusion.Guidance

Dynamic Classifier-Free Guidance that adjusts scale per timestep.

Implements: IGuidanceMethod<T>

For Beginners

Instead of using the same guidance strength for every step, this uses stronger guidance at the start (to get the big picture right) and lighter guidance at the end (to keep fine details natural).

How It Works

Applies a time-dependent guidance scale that starts high for structural coherence in early (noisy) steps and decreases toward the end for fine detail preservation. This reduces over-saturation artifacts common with high static CFG scales.

Constructors

Constructor Summary
DynamicCFGScheduler(double minScale, double maxScale) Initializes a new Dynamic CFG scheduler.

Properties

Property Summary
GuidanceType GuidanceType { get; }

Methods

Method Summary
Tensor<T> Apply(Tensor<T> unconditional, Tensor<T> conditional, double scale, double timestep)