https://github.com/Extraltodeus/sigmas_tools_and_the_golden_scheduler
A few nodes to mix sigmas and a custom scheduler that uses phi
https://github.com/Extraltodeus/sigmas_tools_and_the_golden_scheduler
comfy comfyui
Last synced: 6 months ago
JSON representation
A few nodes to mix sigmas and a custom scheduler that uses phi
- Host: GitHub
- URL: https://github.com/Extraltodeus/sigmas_tools_and_the_golden_scheduler
- Owner: Extraltodeus
- Created: 2023-12-05T19:56:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-13T00:18:40.000Z (6 months ago)
- Last Synced: 2024-12-13T01:20:51.289Z (6 months ago)
- Topics: comfy, comfyui
- Language: Python
- Homepage:
- Size: 2.63 MB
- Stars: 68
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-comfyui - **sigmas_tools_and_the_golden_scheduler**
README
# sigmas_tools_and_the_golden_scheduler
A few nodes to mix sigmas and a custom scheduler that uses phi, then one using eval() to be able to schedule with custom formulas.# Nodes
**Merge sigmas by average**: takes sigmas_1 and sigmas_2 as an input and merge them with a custom weight.
**Merge sigmas gradually** : takes sigmas_1 and sigmas_2 as an input and merge them by starting with sigmas_1 times the weight and sigmas_2 times 1-the weight, like if you want to start with karras and end with simple.
**Multiply sigmas**: simply multiply the sigmas by what you want.
**Split and concatenate sigmas**: takes sigmas_1 and sigmas_2 as an input and merge them by starting with sigmas_1 until the chosen step, then the rest with sigmas_2
**Get sigmas as float**: Just get first - last step to be able to inject noise inside a latent with noise injection nodes.
**Graph sigmas**: make a graph of the sigmas.
**Aligned scheduler**: selects the steps from [align your steps](https://research.nvidia.com/labs/toronto-ai/AlignYourSteps/howto.html).
Differences:
- force_sigma_min: off / 10 steps: gives the same values as Comfy's implementation, which matches the aligned steps of the simple scheduler.
- force_sigma_min: on / 11 steps: the added step corresponds to the minimum sigmas of the model.
- The main difference is that it takes into account the min/max sigmas of the model rather than those from the linked page. This might be beneficial with COSXL models for example.**Manual scheduler**: uses eval() to create a custom schedule. The math module is fully imported. Available variables are:
- sigmin: sigma min
- sigmax: sigma max
- phi
- pi comes from math
- x equals 1 for the first step and 0 for the last step.
- y equals 0 for the first step and 1 for the last step.
- s or steps: total amount of steps.
- j from 0 to total steps -1.
- f gives a normalized from 1 to 0 curve based on a reversed Fibonacci sequenceAnd this one makes the max sigma proportional to the amount of steps, it is pretty good with dpmpp2m:
max([x**phi*s/phi,sigmin])
This one works nicely with lms, euler and dpmpp2m NOW ALSO WITH dpmpp2m_sde if you toggle the sgm button:
x**((x+1)*phi)*sigmax+y**((x+1)*phi)*sigmin
Here is how the graphs look like:

**The Golden Scheduler**: Uses phi as the exponent. Hence the name 😊. The formula is pretty simple:
(1-x/(steps-1))**phi*sigmax+(x/(steps-1))**phi*sigmin for x in range(steps)
Where x it the iteration variable for the steps.
Or if you want to use it in the manual node:
x**phi*sigmax+y**phi*sigmin
**It works pretty well with dpmpp2m, euler and lms!**
The karras formula can be written like this:
(sigmax ** (1 / 7) + y * (sigmin ** (1 / 7) - sigmax ** (1 / 7))) ** 7
Using tau:
(sigmax ** (1 / tau) + y * (sigmin ** (1 / tau) - sigmax ** (1 / tau))) ** tau
With a formula based on the fibonacci sequence:
(sigmax-sigmin)*f**(1/2)+sigmin
More steps means a steeper curve.

Example with this formula:

Here is a comparison, the golden scheduler, using my model [Iris Lux](https://civitai.com/models/201287?modelVersionId=234300) :

Karras:

Here is a mix using dpmpp3m_sde with 50% exponential, 25% simple and 25% sgm uniform:



