Sign In

**Updated** Released Karras Exponential_v3 - MultiSchedule Blend Support

10

Mar 12, 2025

(Updated: 4 days ago)

news
**Updated** Released Karras Exponential_v3 - MultiSchedule Blend Support

Changelog 7/3/2025

Released "_v3" (Version 1.3) folders to A1111 and Forge folders on my Github.

These are the only platforms I support presently, and they do require a modified install. In addition to placing the folders into the modules folder, there is 1 file you'll need to replace or manually add the entries to your existing version. Whatever works for you.

I do not currently know how to successfully add a scheduler as a plugin. If anyone has a version of this file with plugin functionality, please contribute on github so I can patch that in. Until then - please follow the installation instructions on github.


Current Features Implemented

Whats powerful about this version is the use of combining schedulers with weighted settings to do a custom blend of available schedulers. You can force weights for when you only have 2 schedulers, and you can optionally use "default" for the scheduler options.

  1. **NEW** Added a user facing user_config file. This allows users to overwrite default_config files, hotswapping settings just like you would when editing the default_config. The config file needs to be named "user_config.yaml".

  2. **NEW** Modular schedulers for future expansion. The setup is limitless and modular to allowing custom or more traditional schedulers to be added later so you can use them in config.

  3. **NEW** Tails and Decays per scheduler. A Tail is a characteristic of how you want the last "n" steps to act. A Decay is how you can set a particular scheduler

  4. Settings can be randomized within defined constraints. Using the default_config for reference, you can update the user_config to change randomization on/off within user defined settings. Default_config has recommended constraints, and has some comments added

New Feature: TAILS

In A1111, keep tail steps to 1 to be in compliance with A1111.

Standard Karras/Exponential sigma schedules already append 0, so instead of appending 0, you would append a different drop off, instead of going directly to 0, you would use something like, "harmonic" and get a gradual reduction. See below for more examples for decay_patterns.

A tail is an optional sequence of sigma steps appended after the main schedule. It acts like a soft landing zone or post-processing extension to stabilize or smooth out the final noise levels.

Purpose:

  • Reduce final-step harshness

  • Refine detail without destabilizing the image

  • Smooth out convergence (especially helpful if earlier steps fluctuate too much)

Example Use:
If your schedule has 30 steps, a tail of 5 might be added after to further denoise gently using decreasing sigma values, often fading to near-zero.

New Feature: Decays

Definition: A decay is a multiplicative modifier applied across the sigma sequence, usually toward the end, to gradually taper the intensity of the noise or model updates.

Purpose:

  • Soften transitions between steps

  • Apply an exponential or linear drop-off

  • Prevent over-processing or over-smoothing at the tail end

Example Use:
A decay pattern like exponential might scale sigmas by a factor (e.g., 0.9, 0.8, 0.7...) at each step near the end to avoid abrupt drops.

New Feature: Decay Modes

These are higher-level strategies that wrap specific decay patterns.

Types:

Append = Adds new sigma values to the end of the schedule (extends total step count) DO NOT USE FOR A1111 if total N steps exceed 1

Blend = Smoothly adjusts the last N steps using decay math (in-place modification)

Replace = Removes the last N steps and replaces them with a decayed tail

Example use:

  • Use append + geometric or harmonic to softly extend schedules.

  • Use blend + exponential when you want more fluid transitions but fixed length.

  • Use replace + logarithmic to overwrite unstable ends with safer values.

  • Use zero when you need a hard stop (e.g., for normalization layers or stylization).

New Feature: Decay Patterns

Feature Expanded from v1.2

These control the shape and behavior of the decay during tail generation (used inside all tail modes). Each one creates a different "tail shape" depending on how sharply or smoothly you want to end the denoising sequence, and it influences how fast or slow the sigmas fall at the end.

zero = Default pattern, equal to the append_zero function in standard karras/exponential sigma schedules

 if decay_pattern == 'zero':
        return append_zero(sigmas)  

geometric = Multiplies by a decay factor each step (exponential-like but data-aware)

if decay_pattern == 'geometric':
        dynamic_decay_rate = max(1 - (avg_delta / (last_sigma + 1e-5)), 0.85)
        next_sigma = max(last_sigma * dynamic_decay_rate, 1e-5)

harmonic = Subtracts decreasing amounts over each step (1/n scaling)

 elif decay_pattern == 'harmonic':
        next_sigma = max(last_sigma - avg_delta, 1e-5)

logarithmic = Uses log-scaled subtraction; very gradual taper

 elif decay_pattern == 'logarithmic':
        next_sigma = max(last_sigma - (avg_delta / math.log(len(sigmas) + 2)), 1e-5)

extrapolate = Estimates next sigma using the previous delta

elif decay_pattern == 'extrapolate':
        if len(sigmas) >= 2:
            last_delta = sigmas[-2] - sigmas[-1]
        else:
            last_delta = avg_delta
        next_sigma = max(last_sigma - last_delta, 1e-5)

fractional = Drops to 10% of current sigma

 elif decay_pattern == 'fractional':
        next_sigma = max(last_sigma * 0.1, 1e-5)

exponential = Multiplies sigma by exp(-Δ); very fast falloff

 elif decay_pattern == 'exponential':
        next_sigma = max(last_sigma * math.exp(-avg_delta), 1e-5)

linear = Subtracts fixed amounts each step

    elif decay_pattern == 'linear':
        next_sigma = max(last_sigma - (avg_delta * 0.5), 1e-5)

Example graph using 6 steps of theoretical values (from excel) with a starting sigma of 0.5 and a delta of 0.04. In the code, it will use real data and constantly be calculating the deltas instead of using static deltas. This example graph is only to show the behavior of each, not to give real data points. From the graph, append 0 behaves like 0. Fractional also behaves a lot like 0. From the graphs, harmonic may be the only one that shows atypical behavior whereas the rest show a steady progression, harmonic sharply drops off at the last step.

In image tests, fractional and zero were nearly identical.

Example Scheduler Blend Configuration

In your user_config.yaml , set up your desired settings. You don't have to use all schedules. In fact, if you set the weights to 0.0, you can keep them in the config, they will be ignored during schedule blending. Use decay_mode "blend" or "replace". Keep tail_steps at 1 if using "blend" or "append". If you want to modify the regular schedule produced by the scheduler, you can increase the tail_steps to your desired length, use "replace" and choose a decay_pattern.

Essentially you are creating a new scheduler on the fly.

blend_methods:
  euler:
    weight: 0.3
    decay_pattern: 'geometric'
    decay_mode: 'blend'
    tail_steps: 1

  euler_advanced:
    weight: 0.3
    decay_pattern: 'harmonic'
    decay_mode: 'blend'
    tail_steps: 1

  geometric:
    weight: 0.15
    decay_pattern: 'geometric'
    decay_mode: 'blend'
    tail_steps: 1

  harmonic:
    weight: 0.0
    decay_pattern: 'logarithmic'
    decay_mode: 'blend'
    tail_steps: 1

  logarithmic:
    weight: 0.0
    decay_pattern: 'fractional'
    decay_mode: 'blend'
    tail_steps: 1

  karras:
    weight: 0.0
    decay_pattern: 'exponential'
    decay_mode: 'blend'
    tail_steps: 1

  exponential:
    weight: 0.0
    decay_pattern: 'logarithmic'
    decay_mode: 'blend'
    tail_steps: 1

blending_style: 'softmax'
blending_mode: 'weights'

To Do List

COMPLETED 7/5/2025: Added a user friendly facing config

Planned: Add documentation for all config settings

Some Features built are gated or disabled:

  • Saving processed schedules via Torch.save / Torch.load: Disabled.

    Reason: A1111 automatically disables unsafe methods to load. This feature could be enabled in the future if the program suppoorts a pre-calculated sigma schedule. This code has been commented out as I have not been able to test its functions if the program doesn't allow saving/loading. I have verified that they save to file correctly, but haven't been able to test the actual loading part.

  • Adding steps for smoother transitions for a full sigma schedule down to 0: Gated with code. Reason: Code will block if steps exceed requested amount. There is also an added configuration option to enable/disable. If a future developer wants to include this as an option for users, they should comment or remove the second code block.

    def run_auto_stabilization(self):
            #This function works as intended, but is blocked by default if programs don't let schedulers create a sigma schedule longer than requested steps.
            if not self.allow_step_expansion:
                self.log("[Auto Mode] Step expansion is disabled by configuration. Skipping auto stabilization.")
                return self.sigs
            if self.allow_step_expansion:            
                unstable = self.detect_sequence_instability()
     else:
                # Run Auto Mode stabilization sequence
                if len(self.sigs) > self.steps:
                    self.auto_stabilization_sequence = []
                    self.log(f"[Auto Mode] Sigma sequence length {len(self.sigs)} exceeds requested steps {self.steps}. Disabling auto stabilization.")
                    self.auto_mode_enabled = False
                    self.sigs = self.sigs[:self.steps]  # Force truncate to requested step count
                    return self.sigs
                self.run_auto_stabilization(self.sigs)

More Version 1.3 Image/Articles

Scheduler-Aware Prompt Creation Strategies | Civitai = This article uses v3 scheduler and highlights the importance of designing a prompt tuned to your scheduler. Now that we've added support to on the fly change your config settings, you may want to create copies of configs that you use often. Maybe i'll add a config option in a future version which can pull from a favorites config setting name and pull all the settings instead. Future versions :)

Crafting a Hires Tuned Prompt from Scratch | Civitai = This article discusses the importance of crafting a prompt designed for hires image creation. I would recommend this read, especially if you like hires image, and you will probably learn a thing or two about crafting a prompt even if you intend to produce lores images.

Karras Exponential - V1.2 & V 1.3 - Experimental Build | Civitai = This article goes into more depth about some of the key differences for V1.2 and V1.3. On github these are the v2 and v3 folders. For install you would rename the folder to the base name, and install as usual.

I plan on adding a documentation folder which will contain more detail on the configuration options. At this point this "simple_kes" is no longer "simple" and I may in the future rebrand the name to something else. But - I'll plan on refining the config files and add more documentation on the configs, and maybe I'll add in an optimized config file if you just wanted to get started without all the bells and whistles. But the bells and whistles are ready if you wanted.


Changelog 6/27/2025

Version _2 (or 1.2)

Major changes in this update!!!

I decided based on everythiing to call this version 1.2 due to the changes to everything.

NEW FEATURE: a two pass system to reduce the number of steps based off of converging sigma values. When it detects that enough noise has been removed it will recalculate the optimal number of steps and generate a new sigma schedule

NEW CONFIG OPTIONS

KNOWN LIMITATIONS:

If using this scheduler for hires images, use it as either the first pass or the second pass scheduler. When used for both it has the potential to not perform very good. I think it has something to do with the hires steps not being passed properly but when used as the second hires scheduler it performs just fine. Here are some picture examples to show you what I'm talking about:

Pass 1: Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras

Pass 2: Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras Exponential

a woman wearing a dress, {city | park}_background

Negative prompt: {painted-nails, pointy fingertips}, asian-skin, child, magazine, {door, window, corner}, fireplace, lamp, blurry, {jewelry, earrings, purse}, bokeh, city, different eye_color,cleavage, sleeves, conservative, nude, sash,, {misformed fingers, incomplete fingers}, {painted-nails, pointy fingertips}, {making fists, crossed arms}, {jewelry, earrings, purse}, asian-skin, male humans, {door, tiled, accent wall}, {landscape, buildings }, {brick wall, half-wall}, {window, window-curtain}, blurry, bokeh, {parking-lot, street, city, roof}, {vehicles, outerspace, animals}, child,

Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras, CFG scale: 7, Seed: 65868677330, Size: 640x960, Model hash: 8c1af921af, Model: Animore_v1, Denoising strength: 0.5, Clip skip: 2, Hypertile U-Net: True, Hires upscale: 2, Hires steps: 40, Hires upscaler: remacri_original, Version: v1.10.1, Hashes: {"model": "8c1af921af"}

First Pass: Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras Exponential

Second Pass: Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras

a woman wearing a dress, {city | park}_background

Negative prompt: {painted-nails, pointy fingertips}, asian-skin, child, magazine, {door, window, corner}, fireplace, lamp, blurry, {jewelry, earrings, purse}, bokeh, city, different eye_color,cleavage, sleeves, conservative, nude, sash,, {misformed fingers, incomplete fingers}, {painted-nails, pointy fingertips}, {making fists, crossed arms}, {jewelry, earrings, purse}, asian-skin, male humans, {door, tiled, accent wall}, {landscape, buildings }, {brick wall, half-wall}, {window, window-curtain}, blurry, bokeh, {parking-lot, street, city, roof}, {vehicles, outerspace, animals}, child,

Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 65868677330, Size: 640x960, Model hash: 8c1af921af, Model: Animore_v1, Denoising strength: 0.5, Clip skip: 2, Hypertile U-Net: True, Hires schedule type: Karras, Hires upscale: 2, Hires steps: 40, Hires upscaler: remacri_original, Version: v1.10.1, Hashes: {"model": "8c1af921af"}

As you can see - the same exact prompts and settings (except we switched the schedulers from first pass to second pass).

And here is the current issue when using this scheduler for both passes. The second image is blurry and too smooth. This isn't a very good example of a bad double pass, because the steps were lower than my safety_minimum_stop_step. Let's give this another go, this time ensuring that the safety minimum is lower than the step count passed.


Changelog 6/24/2025

This update includes more advanced configuration options. I reworked how randomization works and added in some cool new features.

Under the surface, I was performing symmetric randomization. I was multiplying the minimum by 0.8 and the maximum by 1.2 giving some wiggle room for randomization. Now, I've exposed that piece of code for configuration meaning you now control both the range as well as the type of randomization (assymetric vs symmetric)

So let's break that down.

If you set one of the settings to a value of 10, with 0.5 randomization percent (50%) then your range would spread between 5 to 15. Even spread on both sides.

Asymetric base is set up to give a higher ceiling, and you'd get a spread from 5 to 20.

Formulas:

Symmetric = base * (1 - percent)base (1 + percent) = [5.0, 15.0]

Asymmetric = base * (1 - percent)base (1 + percent * 2) = [5.0, 20.0]

I also included a sigma_auto_mode (boolean true or false). It has two modes: sigma_min and sigma_max. If you set it to auto_mode true and sigma_min then it will take either the randomization value for sigma_max (if randomization is on) or the sigma_max and find the new sigma_min value based on the sigma_scale_factor. For Karras based scheduling, sigma_min is usually about 1000 times smaller than whatever the sigma_max is set. But because I like to tinker, it's now a configuration option so you can tinker around too. The sigma_max setting works exactly the same except opposite. Instead of setting the sigma_min it now sets the sigma_max based on the scale_factor and will multiply the sigma_min by the scale_factor to determine the new sigma_max.

I also added a new file which validates the config to ensure that the scheduler works even without all the new settings. Just incase. I have it set by default to set all the boolean values to false, and to take whatever setting you have for the base_value to make all the percents 0.2 and to flex the min/max values 20% above/below the value. Essentially as long as you have the base values it will fill in the rest. Of course you woudn't have as much control, but at least the scheduler will still work. You could also adjus tthe randomization percent to 0.0 and it would effectively take the base value and not create that 20% above/below value. It would still randomize, just function the same as the "off".

I am quite impressed with this scheduler as is and hope you guys enjoy the new. In my opinion, this scheduler blows everyone else away in terms of the configuration options available and the performance factor especially vs the base karras or exponential.

Just wanted to start out this changelog with a few pictures which I had previously uploaded here on civitAI before I go with comparing some random images with other schedulers.

This is an image using the new simple_kes (Karras Exponential) scheduler. Same seed, same resolution, same prompts same everything.

Original post here: https://civitai.com/images/66223796

This dock has I think finer reflection details, as well as the dock itself doesn't look as raggedy. Very slight changes but if you're looking for them it makes a difference.

You'll want to tinker around and this scheduler is made for people who want to get just the right settings. I'm pretty happy with the way this image turned out.


Changelog 6/20/2025

Edits (6/22/2025):

Everytime I add a changelog here I say it's going to be the final version. Final Version? No such thing. Github updated again with version support for A1111. A1111 expected a function not a class so I had to rewire it up. After it was wired into A1111, some more bugs were found (print statements didn't have self.{whatever setting it was}! Also found out the config values for sigma min/max in the config settings were so low they created tan colored images. So min/max has been updated in the config for A1111, as well as for the regular file.

I think I can also support Forge with an update so I will add that folder to github as well when I get to it. If any other SD programs support python installation updates I think I can patch them. If they are online wiith no support via local files, then I won't be able to patch them. Only the creator/author/company will be able to help you out.

With all that said ~ this uploaded file could be modified to work with other platforms or integrated with them.


Restructured the project as a class.

Tested with a scheduler tester which forced me to correct all the bugs. Tested it on random settings with output to console. Verified that it programmatically works but have not had time to integrate it with A1111 or your favorite A1111 compatible open source project. If you feel so inclined, feel free to contribute on github with a fork and a pull request/update request.

This scheduler does not have built in default values and must be paired with a configuration file.

Other than that - it's the same good scheduler but verified to work 100% and all the features are the same otherwise. Added one other option, "rho" which pertains to the Karras side of things. This scheduler leans about 60% towards karras and our custom settings do influence rho and perhaps negates it to some extent, but its possible changing this will change the final picture. Also, the configuration values are not golden eggs. They are not optimized for the "best picture". But feel free to tinker around. If you find a preferred configuration that works better, it would be nice if you shared, but it's completely optional.

Added internal logic for adaptive blending between Karras and Exponential schedules using progress-based interpolation. This allows smoother transitions between the two methods as the generation progresses. Also improved handling of edge cases where sigma_min >= sigma_max — scheduler now auto-adjusts intelligently to prevent log errors or silent failure.

The randomization logic now supports both per-parameter control and global toggling. You can fine-tune or let it all ride — your call. Parameters like step_size_factor, noise_scale_factor, and smooth_blend_factor now play a much stronger role in avoiding oversmoothing and helping preserve detail in the final image.

The scheduler now includes a helper for programmatically retrieving valid sigma sequences via compute_sigmas() even outside of a diffusion loop. This makes it easier to plug into test harnesses or preview logic without needing a full sampler setup.

Full Details can be found on my github readme

As always, if you like what I do, feel free to give a follow or a contribution via Ko-Fi. Inspire me to greater heights and show your appreciation. I really do appreciate all the likes and follows if that's all you can do ;)

Yes the sigmas are really low here, and thats because I set the values via config = verified works! Even with low values.

Edit (6/22/2015): By "works" I mean it creates a numerical value. In testing today (6/22/2015), this low value produced a tan colored image. Which means simply that the settings were too low. If your settings show less than 1.0 for either sigma_min or sigma_max it will produce a tan colored image. But never fear! Adjust your config values to a higher min/max and that should correct the issue. I have just added an update on github to support A1111 with adjusted config values.


Changelog 3/12/2025

I think this is going to be the final version release.

  • Bugfixes for randomization.

  • Bugfixes for sigmas.

New file has been added to github and is available for download.

This version is made for A1111.


Changelog 1/28/2025

I'm working on seperating this into a scheduler and a sampler, and after I verify that each part works seamlessly, I'll be working on registering them as extensions instead of modifying the code base as part of its install. So some reading up on extensions is required and no timeframe for the next update. I'll be posting the original non-class back to my github so the way to install the older version remains the same.

No new updates at this time.

Previews

Version 1 (original)woman::{blonde_hair, midriff}_;, {red, microskirt::plaid;}, bra_and_wrap, high_heels::black_and_white;, full body, {lipstick}

Negative prompt: sleeves, wearing jewelry, bracelet, plaid_shirt, watermark, lettering, purse, sweater,

Steps: 35, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 94979616261, Size: 640x1160, Model hash: 989b125599, Model: Qasar_anireal, Clip skip: 2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "989b125599"}

Version 2 (updated version)

woman::{blonde_hair, midriff}_;, {red, microskirt::plaid;}, bra_and_wrap, high_heels::black_and_white;, full body, {lipstick}

Negative prompt: sleeves, wearing jewelry, bracelet, plaid_shirt, watermark, lettering, purse, sweater,

Steps: 35, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 94979616261, Size: 640x1160, Model hash: 989b125599, Model: Qasar_anireal, Clip skip: 2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "989b125599"}

Introduction

The Karras Exponential Scheduler is a method used in machine learning models, particularly diffusion models like Stable Diffusion, to control the noise levels and smooth transitions between different noise stages during the image generation process. It combines two mathematical approaches—Karras and Exponential—to dynamically adjust the noise over time, blending between them in a smooth and controlled way.

Unique Approach to Schedulers

  • Blending of Karras and Exponential methods for a smoother and more creative image generation process.

  • Dynamic adaptation of noise control, based on the stage of the generation, allowing for better detail retention and flexibility.

  • Customization and randomization options, enabling users to experiment and explore new creative outputs.

  • Smooth transitions between noise reduction techniques, avoiding abrupt or harsh changes in the image quality.

  • Focus on preventing oversmoothing, ensuring high-detail results even when blending two different methods.

  • User-friendly configurability, empowering users to tweak parameters for both stability and variety in the generated images.

These unique aspects make the Karras Exponential Scheduler highly versatile and powerful for diffusion-based image generation, appealing to both casual users and experts who want more control and creativity in their image synthesis.

Blending Two Methods (Karras and Exponential)

By blending these two methods, the Karras Exponential Scheduler creates a balance that gives both the smooth, high-quality results of Karras and the flexibility of the Exponential method. This dynamic blend is adaptively controlled based on the stage of the image generation process, making it unique in its ability to fine-tune how noise is removed at each step.

Dynamic and Adaptive Noise Control

The Karras Exponential Scheduler doesn't follow a fixed approach for the entire image generation process. It dynamically adjusts the noise reduction and blending parameters (like step size, blend factor, and noise scale) based on progress.

This adaptive nature allows the scheduler to handle different scenarios more flexibly than most other schedulers, which typically follow a fixed pattern.

Customization and Randomization Options

Unlike traditional schedulers that operate with fixed or predefined parameters, this scheduler includes customization and even randomization options. Users can tweak parameters like sigma_min, sigma_max, step size, and noise scale factor, or allow the system to randomize these within a set range.

This randomness adds an extra layer of uniqueness, giving users the ability to introduce variety in the generated images. It’s particularly useful for creating more diverse outputs with the same prompts or model, allowing for more exploratory creativity.

Smooth Transition Between Noise Reduction Techniques

One of the key features that sets this scheduler apart is how it handles smooth transitions between the Karras and Exponential methods. Most schedulers stick with one noise schedule (e.g., linear, exponential), but this scheduler can shift gradually between the two techniques during the image generation.

This makes the Karras Exponential Scheduler particularly well-suited for balancing stability (by following Karras for predictable results) and creativity (by adding variety through Exponential blending).

Avoiding Oversmoothing and Retaining Details

A common issue with many schedulers is that they can cause oversmoothing of the generated images, which can lead to a loss of detail and sharpness. The step size factor and noise scale factor used in this scheduler are designed to dynamically prevent oversmoothing, allowing the generated images to retain more detail and texture.

This is particularly useful for creating images that are both high-quality and rich in detail, without falling into the trap of being too "soft" or overly polished.

User-Friendly and Configurable

This scheduler is designed with user customization in mind, allowing for fine-tuning through a YAML configuration file. Users can adjust the ranges for each parameter (e.g., noise levels, blending factors) or even turn on full randomization to let the system generate a wide variety of outputs. The configuration file is a yaml file, and each configuration option has detailed tips on suggested settings.

I've focused on creating a scheduler which is very user friendly and customizable. You can tweak the settings manually or enjoy using the randomizer, and you never have to modify code, just tweak the configuration file.

The ability to configure the scheduler to such an extent is not as common with other schedulers, making the Karras Exponential Scheduler particularly appealing to advanced users who want more control over their image generation process.

Advanced Features for Exploratory Creativity

With its ability to blend noise reduction techniques, customize parameters, and randomize behavior, this scheduler is ideal for users who want to experiment with their models. The randomness and adaptability allow for creative exploration, giving users the opportunity to see unexpected and novel results that they might not get with more rigid, deterministic schedulers.

Overview

Schedulers

A scheduler is like a "controller" that decides how much noise should be added or removed in each step during image creation. Think of it as the rhythm or pace of the noise removal process.

Karras Method:

The Karras method follows a specific pattern to remove noise step by step, ensuring a smooth reduction of noise over time. It is well-suited for generating detailed images as it is designed to avoid sudden jumps in noise levels.

Exponential Method:

The Exponential method reduces noise more aggressively, removing larger chunks of noise at the start and then gradually slowing down. It’s more flexible but can lead to sharper or more varied image transitions compared to Karras.

Blending the Two Methods:

The Karras Exponential Scheduler combines these two methods. It starts off by following the Karras method (smooth and gradual) but incorporates elements of the Exponential method to add more variety or sharp transitions when needed.

The key idea is to blend between these two approaches, adapting the noise removal based on the current stage of image generation.

Key Functions:

  1. Sigma Values (Noise Levels):

    • Sigma represents the amount of noise applied to the image at each step. The scheduler controls these sigma values, blending between smooth (Karras) and aggressive (Exponential) noise removal as the image is generated.

  2. Dynamic Blending:

    • The scheduler adjusts the blend between Karras and Exponential based on a factor called the blend factor. At the start, it uses more of the Karras method (for smoothness), and as the generation progresses, it introduces more of the Exponential method (for variation and detail).

  3. Adaptive Parameters:

    • The scheduler also includes adaptive parameters like "step size" (which is different from steps used to create an image) and "noise scale" to fine-tune the generation. These adjust how large the steps are when removing noise and how much variation to introduce, making the image generation more flexible and tailored to the user's settings.

Imagine you're baking a cake, and you have two ways to bake it. One method (Karras) is slow and steady, baking the cake evenly over time. The other method (Exponential) cranks up the heat at the start but slows down as the cake gets closer to being done.

The Karras Exponential Scheduler is like a smart oven that mixes both methods. It starts baking slowly (like Karras) to ensure things go smoothly, but then uses bursts of heat (like Exponential) to speed things up and add some interesting textures.

In the world of image generation, this method controls how noise is added or removed from the image, helping to produce more creative and varied results while still keeping things smooth and controlled.

Why Is This Important?

  • Flexibility: It gives more control over how images are generated, allowing users to experiment with different effects.

  • Smooth Results: It avoids jarring transitions between noisy and clear stages, creating images that are visually appealing.

  • Creativity: By blending these two approaches, it allows for both predictable, smooth results and more surprising, varied images.

Sneak Peak

Here is a sneak peak at the process, viewed through a log file which can be generated when the config option for debug is true. I am looking into how to modify the A1111 code to generate the scheduler specific parameters along with the other generation data. Once that is complete, I plan on finishing up the documentation and then releasing it on github. Once the settings for randomized images can be created alongside each picture (the way infotext works in A1111), it will make generating the same image easier, as well as finding the best settings without manual testing.

With randomizer turned on, here are 4 images with the same settings, which show subtle variation between each picture. I did not have the log turned on for this image batch, so I will not be able to recreate any of these images exactly. Until the logs feature is added, I don't feel comfortable releasing this on github.

Prompt used was taken from an older version of Karras Exponential, with exact seed, size, and image parameters. The only difference being that the randomizer is turned on.

Reference Picture:

Image posted by KittensX

New Picture #1

beautiful young lady, upper body, wall-background, photo studio, bodycon dress, camoflauge,, (photographic realism, high-definition detail, lifelike textures, camera-like clarity, photo-like appearance),

Negative prompt: jewelry, crown, frame, painting, hairbow, tiara, child,, (((pixiv))),

Steps: 20, Sampler: DPM++ 2M Karras, Schedule type: Karras Exponential, CFG scale: 7, Seed: 3511977580, Size: 640x960, Model hash: 4a766596ae, Model: FusionX-Realistic_v2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "4a766596ae"}

New Picture #2

beautiful young lady, upper body, wall-background, photo studio, bodycon dress, camoflauge,, (photographic realism, high-definition detail, lifelike textures, camera-like clarity, photo-like appearance),

Negative prompt: jewelry, crown, frame, painting, hairbow, tiara, child,, (((pixiv))),

Steps: 20, Sampler: DPM++ 2M Karras, Schedule type: Karras Exponential, CFG scale: 7, Seed: 3511977580, Size: 640x960, Model hash: 4a766596ae, Model: FusionX-Realistic_v2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "4a766596ae"}

New Picture #3

beautiful young lady, upper body, wall-background, photo studio, bodycon dress, camoflauge,, (photographic realism, high-definition detail, lifelike textures, camera-like clarity, photo-like appearance),

Negative prompt: jewelry, crown, frame, painting, hairbow, tiara, child,, (((pixiv))),

Steps: 20, Sampler: DPM++ 2M Karras, Schedule type: Karras Exponential, CFG scale: 7, Seed: 3511977580, Size: 640x960, Model hash: 4a766596ae, Model: FusionX-Realistic_v2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "4a766596ae"}

New Picture #4

beautiful young lady, upper body, wall-background, photo studio, bodycon dress, camoflauge,, (photographic realism, high-definition detail, lifelike textures, camera-like clarity, photo-like appearance),

Negative prompt: jewelry, crown, frame, painting, hairbow, tiara, child,, (((pixiv))),

Steps: 20, Sampler: DPM++ 2M Karras, Schedule type: Karras Exponential, CFG scale: 7, Seed: 3511977580, Size: 640x960, Model hash: 4a766596ae, Model: FusionX-Realistic_v2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "4a766596ae"}

2024-10-22 01:37:07,498 - modules.simple_karras_exponential_scheduler - DEBUG - Using device: cpu
2024-10-22 01:37:07,506 - modules.simple_karras_exponential_scheduler - DEBUG - Generated sigma sequences. Karras: tensor([27.7349, 21.9697, 17.2637, 13.4497, 10.3820,  7.9347,  5.9995,  4.4838,
         3.3090,  2.4085,  1.7268,  1.2177,  0.8430,  0.5719,  0.3792,  0.2451,
         0.1539,  0.0934,  0.0546,  0.0305,  0.0000]), Exponential: tensor([27.7349, 19.3788, 13.5402,  9.4607,  6.6103,  4.6187,  3.2272,  2.2549,
         1.5755,  1.1008,  0.7692,  0.5374,  0.3755,  0.2624,  0.1833,  0.1281,
         0.0895,  0.0625,  0.0437,  0.0305,  0.0000])
2024-10-22 01:37:07,507 - modules.simple_karras_exponential_scheduler - DEBUG - Progress created tensor([0.0000, 0.0500, 0.1000, 0.1500, 0.2000, 0.2500, 0.3000, 0.3500, 0.4000,
        0.4500, 0.5000, 0.5500, 0.6000, 0.6500, 0.7000, 0.7500, 0.8000, 0.8500,
        0.9000, 0.9500, 1.0000])
2024-10-22 01:37:07,507 - modules.simple_karras_exponential_scheduler - DEBUG - Progress Using device: cpu
2024-10-22 01:37:07,507 - modules.simple_karras_exponential_scheduler - DEBUG - Sigs created tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
2024-10-22 01:37:07,507 - modules.simple_karras_exponential_scheduler - DEBUG - Sigs Using device: cpu
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.7832680940628052
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.19977597892284393
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.3898767232894897
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.060515791177749634
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 27.73488426208496
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.7516498565673828
2024-10-22 01:37:07,508 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.21512919664382935
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.3508144617080688
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.06899817287921906
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 21.790895462036133
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.7200316190719604
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.23048241436481476
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.3117523193359375
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.07857006043195724
2024-10-22 01:37:07,509 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 16.971189498901367
2024-10-22 01:37:07,510 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.6884134411811829
2024-10-22 01:37:07,510 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.24583563208580017
2024-10-22 01:37:07,510 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.2726901769638062
2024-10-22 01:37:07,510 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.08934243768453598
2024-10-22 01:37:07,510 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 13.093320846557617
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.6567952036857605
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.2611888647079468
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.2336279153823853
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.10142917931079865
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 9.99942398071289
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.6251769065856934
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.276542067527771
2024-10-22 01:37:07,511 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.1945656538009644
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.114944688975811
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 7.553524017333984
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.5935586094856262
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.2918952703475952
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.1555033922195435
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.13000056147575378
2024-10-22 01:37:07,512 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 5.639090061187744
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.5619403719902039
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.3072485029697418
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.116441249847412
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.14670167863368988
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 4.156833648681641
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.5303221940994263
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.3226017355918884
2024-10-22 01:37:07,513 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.0773789882659912
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.16514110565185547
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 3.0227019786834717
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.4987039268016815
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.33795493841171265
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 1.0383167266845703
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.18539462983608246
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 2.166069984436035
2024-10-22 01:37:07,514 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.46708571910858154
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.35330817103385925
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.999254584312439
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.20751474797725677
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 1.528085708618164
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.4354674816131592
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.3686613440513611
2024-10-22 01:37:07,515 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.9601923823356628
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.23152391612529755
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 1.0601764917373657
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.40384921431541443
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.3840146064758301
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.9211300611495972
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.2574087977409363
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.7226848006248474
2024-10-22 01:37:07,516 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.37223100662231445
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.3993678092956543
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.8820679187774658
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.2851138114929199
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.4836310148239136
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.3406127691268921
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.4147210419178009
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.8430057764053345
2024-10-22 01:37:07,517 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.31453776359558105
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.31758636236190796
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.3089945316314697
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.4300742447376251
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.8039435148239136
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.34553053975105286
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.20465229451656342
2024-10-22 01:37:07,518 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.277376264333725
2024-10-22 01:37:07,519 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.44542747735977173
2024-10-22 01:37:07,519 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.7648812532424927
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.3778936564922333
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.12953639030456543
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.2457580268383026
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.46078068017959595
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.7258190512657166
2024-10-22 01:37:07,521 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.4113825559616089
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.08072526752948761
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.21413981914520264
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.47613391280174255
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.6867568492889404
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.44571301341056824
2024-10-22 01:37:07,522 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.04974747449159622
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.18252156674861908
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.49148714542388916
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.6476945877075195
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.48056939244270325
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.03052930347621441
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - Step_size created 0.15090332925319672
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - Dynamic_blend_factor created 0.5068403482437134
2024-10-22 01:37:07,523 - modules.simple_karras_exponential_scheduler - DEBUG - noise_scale created 0.6086323857307434
2024-10-22 01:37:07,524 - modules.simple_karras_exponential_scheduler - DEBUG - smooth_blend created 0.5156158804893494
2024-10-22 01:37:07,524 - modules.simple_karras_exponential_scheduler - DEBUG - blended_sigma created 0.0
2024-10-22 01:37:07,524 - modules.simple_karras_exponential_scheduler - DEBUG - sharpen_mask created tensor([1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
        1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 0.9445, 0.9445,
        0.9445, 0.9445, 0.9445]) with device cpu

10

Comments