Sign In

Karras Exponential - V1.2 & V 1.3 - Experimental Build

1

Karras Exponential - V1.2 &  V 1.3 - Experimental Build

Introduction

Over the past several months, I’ve been developing and refining a custom scheduler that pushes beyond the limitations of traditional diffusion noise schedules. What started as a simple blend between Karras and Exponential schedulers has now evolved into a fully customizable, multi-scheduler blending system with support for weighted combinations, decay patterns, dynamic tails, and optional configuration saving. This project is still in beta, but early results show real promise. I’ve been documenting my process, running side-by-side comparisons, and testing edge cases to see how far I can push scheduler design within (and sometimes beyond) the A1111 framework. This write-up is a mix of test results, feature explanations, and a bit of a development diary as I explore what’s possible with blended schedulers.

Loading/Saving Preferred Sigma Schedules

This feature is not fully implemented supported yet!

I am testing a save/load calculated sigma schedules. The trick is not to trip the A1111 alarms when it detects torch saves/loads. Essentially, we use the scheduler to calculate with a given number of steps/settings. We save those settings through torch, then load them if no randomization is detected.

Once the calculations are done, it's really just a 1 column text (if saved to a text file or a csv file) for human readability. If saved as a pt file it seems to be tripping some alarms even though the code is not harmful. So we'll have to tinker around to see how best to do it.

What's key to getting your configs saved, is you can't be using randomized sigma_min or sigma_max settings, or random rho settings. It would just take too much space if we saved it for every random setting you'll never use again. So if you like your random setting, save it in config as the default setting, then run it again with the options to save your configs turned on.

As long as you run the same steps it will take slightly less computational power to load without needing to recalculate, especially if you're running a large batch or just a lot of different pictures using the same steps, sigma_max, and rho. NOTES: rho ONLY affects sigma_karras blends. So if you're not using sigma_karras, just keep rho random turned off.

My recommendation is to find a good ratio between sigma_max and sigma_min. I've been testing at 900x, with sigma_min turned on with the auto setting true so that sigma_min is auto calculated using the blend_factor rating. I would recommend finding the setting that works for you and lock it in using auto sigma_min turned on. If you like random sigma_max, just know we won't be saving them as config saves/loads, so pay close attention to your images and if you find a good mix, lock it in.

Sometimes a complicated prompt takes more processing

Some Limitations: As the prompt is more complicated, the scheduler will take longer (or seems to on hires upsampling). If you're doing batch upscales you may want to test it first with a smaller run. Simple prompts will be computed faster than a longer prompt. Upscales also take a bit more time. You'll likely want to add hipass negative/positve prompts.

This version will be updated to github after I've added a few more things. So dock this as a coming soon, and by Sunday it should be on there. Just note this is a beta build and may have errors that won't be fixed anytime soon. It will also be uploaded to a new folder, keeping the current version 1.2 available.

It is in a beta stage right now, updated on github, and might be unstable at times. If instability is detected I will do my best to patch it right away.

Some other benefits: It does seem to be faster on simpler prompts. It will be different from Karras in a side by side comparison just simply because it is different.

Some pictures from an intermediate version of my current scheduler:

Karras Exponential - V2 - Experimental | Civitai = Side by side comparison with Karras

This is one of those mistakes | Civitai

The moment when you realize your new scheduler | Civitai

= An intermediate state picture showing a beta build scheduler which had undetermined seed production issues, stemming from the fact we compounded calculations in two different for loops. This issue has been deemed fixed in the current version.

Current production ready build:

Testing out a new Scheduler Blend | Civitai = Testing out blending different schedulers together with weights and blend settings

{age18 girl}, centered, thigh gap, plain background, midriff, submissive, blushing, mid-shoulder hair, hair-behind-back, red|blonde|brunette_hair, white_background,

Negative prompt: incomplete, black and white, textured lettering, magazine, different_eyes, finger-mashed, finger-jewelry,

Steps: 25, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 149786851559, Size: 640x960, Model hash: 5dc2d95ed5, Model: ACRBasev3_float16, Clip skip: 2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "5dc2d95ed5"}

Prompt Sets - Image Set 1

Image Set 1 - Karras vs Simple KES | Civitai

I'm not saying that I've figured out these prompts -- because I'm still working on that, but here are a few side by side images (scroll down) which show the key differences between Simple KES and other schedulers is I think it can denoise better - and you see that in better image quality for the prompts you requested. I did the following on all the same seed. All my Simple KES settings are set on solid non-random settings.

Below is my favorite from this set:

I picked this seed, then redrew it with the 7-schedule blend, just to see. Was a little surprised and pleasantly delighted to get a different image. Not the best image - one which certainly could be improved with different prompts, but the fact that it diverged this much from the first version -- and converged quickly-- I really like!

The picture from the original set:

While you may have thought I'd pick the dog wearing the dress, I picked this one because the dog looks like he's being held properly, and the woman's face is better defined than Karras.

Some more sample images using the new scheduler blend:

a woman and her dog, {portrait, dog}: {woman:::elegant dress!!},

Negative prompt: jewelry, sideways,

Steps: 25, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 127694138351, Size: 640x640, Model hash: 86758142da, Model: FusionX-Realistic_v3_float16, Clip skip: 2, Hypertile U-Net: True, Version: v1.10.1, Hashes: {"model": "86758142da"}

Seeds used:

127694138351, 127694138352, 127694138353, 127694138354

116627444267, 116627444268, 116627444269, 116627444270

29333578709, 29333578710, 29333578711, 29333578712

Prompt Set: Image Set 2:

Karras vs Karras Exponential (Simple KES) | Civitai

Simple prompt for these:

woman's face, portrait

1girls's face, portrait

man's face, portrait

1boy's face, portrait

Some Features can't be run in A1111

I've stopped trying to test early_stopping_threshold because it just doesn't seem to be working with A1111. So that section of code will be gated off (early_stopping_threshold) and related early stopping code.

The newer optimized tails and auto detect jagged drops code verified to work except that A1111 does not allow schedulers to determine the number of steps an image should take and has relagated that responsiblity to you the user. If you want 25 steps, you don't nor do samplers expect to receive a 84 step optimized schedule for smooth noise removal.

So in this respect, although the code wants to run an optimized schedule and can provide this schedule to the program, safeguards built into A1111 preven this from coming to fruition.

However, if you have a custom stable diffusion project, or wish to do some research using this scheduler, then you can certainly do so.

Fully Customized Scheduler

This scheduler has had every bell and whistle added as I've tried to include as much user control as possible. The config file which I usually keep up in another window, can be edited/saved while A1111 is active. As long as you make the change and press save, you can run with new settings for each new generation run.

While this scheduler is in beta -- and since despite my best efforts I haven't figured out the best way to inject my code into the schedulers map and run it like a plugin, I don't have a UI setup where you could edit all the settings in the A1111 window. So while that is a little disappointing, I do hope the config file will help you cope in these difficult times.

The config file is yaml, which means if you've been accustomed to json it may feel a little different. What's important to remember is if you're giving it a folder path to use proper slashes. also true/false statements should be lowercase not uppercase like it is in json or python. you can enclose strings without quotes, but it's recommended to use quotes single or double. Why I prefer yaml of json is the ability to make notes inside it without breaking the code. In json you simply can't add a comment. Other than that, while json files are faster to load than yaml, overall it won't make that much of a difference with only 226 lines in my commented yaml working-config file.

Image Set 3

Simple Kes and Karras | Civitai

So while the changes between the legacy Karras/Exponential blend vs the standard Karras only is minimal, the same prompt with the 7-scheduler blend shows promise, in that it has more color depth than both versions.

And comparing the first version with the current fully blended version (7 schedulers) the picture on the left looks similar to Karras but with more color/contrast. The hoodie picture on the right also has more color/contrast than both the picture on the left, and the karras picture. Not totally in love with how the pocket is kinda inside out, but thats how seeds go.

Final Notes

This started out as a kind of version 1.2 (which is uploaded on Github) and since adding the schedulers blending and saving configurations, this feels a lot more like a higher number....be that as it may, version 1.3! I want to keep this version seperate from the uploaded version 1.2 currently on Github. And because we did add several things that just aren't there in v1.2. Something along the lines of 600+ lines of code difference.

Experimental Build - because a lot of the features are still untested, but I wanted to get this version out anyways. I will also be away from my computer over the next few months, so won't really have time to get a polished product with any bugs fixed (if/when they are found, I won't be around to fix them).

If you like the new version (when it's been uploaded) feel free to let me know in comments/follows/likes and or donations on my ko-fi page.

beauty and the beast, a magical rose on a pedastal, underneath glass wilting away, wilted petals,

Negative prompt: magazine,

Steps: 25, Sampler: DPM++ 2M, Schedule type: Karras Exponential, CFG scale: 7, Seed: 13444219680, Size: 864x400, Model hash: 86758142da, Model: FusionX-Realistic_v3_float16, Denoising strength: 0.6, Clip skip: 2, Hypertile U-Net: True, Hires upscale: 2, Hires steps: 35, Hires upscaler: R-ESRGAN 4x+ Anime6B, Version: v1.10.1, Hashes: {"model": "86758142da"}

1

Comments