SamplerTTM
A higher-order ODE solver that differentiates the model itself
- SAMPLER
SamplerTTM is the "we've got a math major in the house" member of the ComfyUI Extra Samplers pack. TTM is a higher-order exponential integrator whose lineage goes back to Katherine Crowson's source implementation - the same Kat the pack's README credits alongside Birch-San - and it does something most samplers don't: it takes a derivative of the model itself, mid-sampling, to get a better step.
The mechanism, kept honest: normal samplers (Euler, Heun) approximate the denoising step using just the model's output at the current noise level. TTM computes the model output and its derivative with respect to the input - the code uses PyTorch forward-mode autodiff (forward_ad / dual tensors) to get that derivative in a single pass - and then feeds both into an exponential-integrator update with phi_1 / phi_2 correction terms. That's why the source file is decorated with @enable_grad(). The payoff is a second-order-quality step that can squeeze quality out of fewer steps, at the cost of a heavier per-step computation and a fair bit of VRAM/state. It's genuinely clever, and it's also a sampler you should approach as an experiment rather than a daily driver.
The inputs that matter:
eta- the ancestral/noise-injection strength. Default 1; lower it toward 0 for a more deterministic, ODE-like run.s_noise- scales the per-step noise. Default 1.noise_sampler_type- the pack's usual menu: gaussian, brownian, pyramid, perlin, laplacian, etc. Gaussian is the safe start.
Output: a SAMPLER for your custom sampling chain.
Two honest warnings. First, the pack's own README notes TTM came from Kat's source implementation, so treat its tuning expectations as inherited from that lineage - it's a higher-order solver for people who already know they want one, not a "pick this and it's better" button. Second, and this is the bigger one: the community's hard-won lesson, recorded in the knowledge base, is that high-order solvers and aggressive schedules fall apart on flow-matching models. TTM is at its best on DDPM-style models (SD 1.5/SDXL families) where curved trajectories give higher-order corrections something to fix. On a straight flow-matching trajectory, keep it conservative or skip it.
Install is the shared pack routine - ComfyUI Manager → "ComfyUI Extra Samplers", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Clybius/ComfyUI-Extra-Samplers
then restart. No model downloads; dependency kornia. If TTM is more math than you wanted today, the pack's SamplerRES_Momentumized gives you a similar "fancier step" spirit with a friendlier UI.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| noise_sampler_type | COMBO | 7 options: gaussian, uniform, brownian, highres-pyramid, pyramid, perlin, +1 | |
| eta | FLOAT | 1.000–100 | — |
| s_noise | FLOAT | 1.000–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAMPLER | SAMPLER | — |