StrengthBasedScheduling<T>
Models & Types · AiDotNet.Diffusion.Schedulers
Strength-based scheduling for img2img and inpainting denoising control.
For Beginners
In image editing with diffusion models, “strength” controls how much the AI changes the original image. Low strength (0.2) makes small tweaks, high strength (0.9) almost completely regenerates. This class handles the math of converting that simple 0-1 slider into the right technical settings for the diffusion process.
How It Works
Controls how much of the original image is preserved vs. regenerated in img2img and inpainting pipelines. Maps a user-facing “strength” parameter (0.0-1.0) to the appropriate starting timestep in the noise schedule, determining how many denoising steps to run and at what noise level to begin.
Constructors
| Constructor | Summary |
|---|---|
StrengthBasedScheduling(int totalTimesteps, double defaultStrength) |
Initializes strength-based scheduling. |
Properties
| Property | Summary |
|---|---|
double DefaultStrength { get; } |
Gets the default denoising strength. |
int TotalTimesteps { get; } |
Gets the total number of timesteps in the full schedule. |
Methods
| Method | Summary |
|---|---|
T GetStartNoiseLevel(double strength) |
Gets the noise level (alpha_bar) at the starting timestep. |
T[] TruncateSchedule(T[] fullSchedule, double strength) |
Truncates a full timestep schedule to start from the strength-determined point. |
int GetEffectiveSteps(double strength, int numInferenceSteps) |
Gets the number of denoising steps to perform for a given strength. |
int GetStartTimestep(double strength) |
Gets the starting timestep for a given strength. |