A ComfyUI custom node implementing Pareto-weighted adaptive sampling that blends historical gradient context with the current diffusion step.
- Clone or copy this folder into
ComfyUI/custom_nodes/ - Restart ComfyUI
- The Inference Sampler node will appear under the
samplingcategory
| Parameter | Default | Range | Description |
|---|---|---|---|
heterodyne_strength |
0.20 | 0.0–1.0 | Mix of current gradient vs. historical context. Higher = more past influence. |
gradient_strength |
0.40 | 0.0–1.0 | Momentum from the previous step. Higher = smoother path. |
context_weight |
0.80 | 0.0–1.0 | Final blend back toward the raw current gradient. Higher = more current. |
alpha |
0.71 | 0.1–10.0 | Pareto shape. Lower = diffuse (many steps matter). Higher = concentrated (only aligned steps matter). |
gradient_history_length |
8 | 2–20 | How many past gradients to retain for context. |
min_alignment_threshold |
0.80 | 0.01–1.0 | Minimum alignment value used as the Pareto distribution offset. |
Each step:
- Computes cosine similarity between the current gradient and each stored historical gradient
- Applies a Pareto PDF to weight historical gradients by their alignment score
- Blends the Pareto-weighted context with momentum from the previous step (
heterodyne_strength,gradient_strength) - Blends that combined direction back with the raw current gradient (
context_weight) - Steps forward and stores the gradient for the next iteration
- ComfyUI 0.17.0+
- Python 3.10+
- PyTorch
Obfuscated because I felt nostalgic
Arc-9 Open Royalty Agreement 1.4