MD: Noise Decay Scheduler (Advanced)
MD Noise Decay Scheduler
- scheduler
- plot_image
Stock schedulers give you presets - Karras, linear, exponential - and they're fixed. This node lets you draw a noise decay envelope and hands it to the pack's PingPong samplers as a SCHEDULER object, plus a matplotlib plot so you can actually see what you made before you commit to a render. It's the same idea as an LFO or envelope in a synth: the shape you choose decides whether the process dives fast and smooths out, or lingers at the top then crashes down.
How it works
The core is a decay-curve generator. algorithm_type picks the math: polynomial (the standard ease-in, with decay_exponent controlling the curve - 1.0 is linear, 2.0 is quadratic), sigmoidal (an S-curve), piecewise (you type manual anchors like 1.0, 0.8, 0.2, 0.0 in custom_piecewise_points), fourier (an oscillating cosine wave, fourier_frequency sets the cycle count), exponential, and gaussian (a bell).
start_value and end_value pin the envelope's endpoints - 1.0 decaying to 0.0 is the standard shape, but a 0.0 start rising somewhere is your attack envelope. invert_curve flips the whole thing vertically (computes 1 - y), which is the fastest way to turn a decay schedule into an attack schedule. There's also enable_temporal_smoothing with a smoothing_window for a moving-average filter - genuinely useful in piecewise mode where the joins between your manual points can be jagged.
Two quality-of-life toggles: use_caching (stores identical curves in memory so repeated queue runs don't recompute) and preview_steps (plot resolution; 20–50 is plenty).
The outputs
scheduler is the one you care about - a SCHEDULER object you wire into the scheduler input of PingPongSamplerNodeFBG, Basic, or Lite. plot_image is the visualization, an IMAGE you can route to a preview node. And here's the critical thing to understand:
This is not a SIGMAS output. It won't plug into a stock ComfyUI KSampler.
It's a pack-specific object built for the pack's own sampler family. If you load a shared workflow and this node looks broken, that's usually the mismatch - it belongs in an MD PingPong pipeline, not in front of a vanilla sampler.
Installing it
Ships with MD Nodes; the plot needs matplotlib, which is in the pack's requirements:
cd path/to/ComfyUI/custom_nodes
git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
cd ComfyUI_MD_Nodes
pip install -r requirements.txt
Or search MD_Nodes in ComfyUI Manager and restart.
Where it fits
Think of this as the "curve design" front-end for the PingPong ecosystem: the hybrid scheduler gives you the standard sigma math, GITS adapts step spacing, and this one is for when you want a bespoke envelope and a picture of it. The author's own guidance is sensible - polynomial at exponent 2.0 for standard diffusion ease-in, and don't reach for fourier unless you know you want oscillation, because non-standard shapes give unpredictable injection results. Start with the defaults, look at the plot, then bend the curve.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| algorithm_type | COMBO | polynomial | DECAY ALGORITHM • Purpose: Defines the mathematical function shaping the curve. • Options: Polynomial (Linear/Quad), Sigmoidal (S-Curve), Gaussian (Bell). • Trade-offs: Non-standard shapes (Fourier) may yield unpredictable injection results. ⭐ Recommended: 'polynomial' for standard diffusion ease-in. |
| decay_exponent | FLOAT | 2.00.1–10 | DECAY EXPONENT (STEEPNESS) • Purpose: Controls the rate/curvature of the decay drop-off. • Options: 1.0 = Linear, 2.0 = Standard Quadratic. • Trade-offs: Extreme values (>5.0) cause massive steps at the very beginning. ⭐ Recommended: 2.0 for standard ease-in. |
| start_value | FLOAT | 1.00-2–2 | START VALUE • Purpose: The Y-value magnitude at the very first step (t=0). • Range: Typically 0.0 to 1.0. ⭐ Recommended: 1.0 for standard decay, 0.0 for attack envelopes. |
| end_value | FLOAT | 0.00-2–2 | END VALUE • Purpose: The Y-value magnitude at the final step (t=max). • Range: Typically 0.0 to 1.0. ⭐ Recommended: 0.0 for standard decay. |
| invert_curve | BOOLEAN | false | INVERT CURVE • Purpose: Flips the curve vertically (Calculates 1 - y). • Effect: Quickly turns a decay schedule into an attack schedule. ⭐ Recommended: False unless intentionally building inverse logic. |
| preview_steps | INT | 202–1000 | PREVIEW STEPS • Purpose: Resolution fidelity of the generated plot image. • Range: 2 to 1000 samples. • Trade-offs: Higher values yield smoother curves but slightly slower node execution. ⭐ Recommended: 20-50 is sufficient for visualization. |
| use_caching | BOOLEAN | true | USE CACHING • Purpose: Stores results in memory to avoid recalculating identical curves. • Trade-offs: Uses trace memory, but massively speeds up queue runs. ⭐ Recommended: True. |
| enable_temporal_smoothing | BOOLEAN | false | ENABLE SMOOTHING • Purpose: Applies a moving average filter to the final curve. • Effect: Softens sharp transitions, highly useful in 'piecewise' mode. ⭐ Recommended: False for pure mathematical curves. |
| smoothing_windowopt | INT | 32–20 | SMOOTHING WINDOW • Purpose: The rolling kernel size of the moving average filter. • Requirement: Active only if 'enable_temporal_smoothing' is True. ⭐ Recommended: 3-5 to retain general shape while blurring spikes. |
| custom_piecewise_pointsopt | STRING | 1.0,0.5,0.0 | PIECEWISE POINTS • Purpose: Manual control anchors for the curve. • Requirement: Active only if Algorithm = 'piecewise'. • Format: Comma-separated floats (e.g., '1.0, 0.8, 0.2, 0.0'). |
| fourier_frequencyopt | FLOAT | 1.00.1–10 | FOURIER FREQUENCY • Purpose: Number of oscillating cycles for the algorithm. • Requirement: Active only if Algorithm = 'fourier'. ⭐ Recommended: 1.0 creates a single bell-like cosine wave. |
| debug_modeopt | COMBO | 0 - Silent | LOGGING VERBOSITY • Purpose: Controls console output and structural profiling. • Options: 0 (Production), 1 (Analytics Report), 2 (Full trace). ⭐ Recommended: 0 - Silent. |
| enable_profilingopt | BOOLEAN | false | ENABLE PROFILING • Purpose: Measure generation time for performance tuning. • Note: Automatically enabled if debug_mode >= 1. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| scheduler | SCHEDULER | — |
| plot_image | IMAGE | — |