Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

ComfyUI Inference Sampler

A ComfyUI custom node implementing Pareto-weighted adaptive sampling that blends historical gradient context with the current diffusion step.

Installation

  1. Clone or copy this folder into ComfyUI/custom_nodes/
  2. Restart ComfyUI
  3. The Inference Sampler node will appear under the sampling category

Parameters

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.

How It Works

Each step:

  1. Computes cosine similarity between the current gradient and each stored historical gradient
  2. Applies a Pareto PDF to weight historical gradients by their alignment score
  3. Blends the Pareto-weighted context with momentum from the previous step (heterodyne_strength, gradient_strength)
  4. Blends that combined direction back with the raw current gradient (context_weight)
  5. Steps forward and stores the gradient for the next iteration

Requirements

  • ComfyUI 0.17.0+
  • Python 3.10+
  • PyTorch

Disclaimer

Obfuscated because I felt nostalgic

License

Arc-9 Open Royalty Agreement 1.4

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages