Nodes/ComfyUI-sonar/SonarGuidanceConfig
ComfyUI Node

SonarGuidanceConfig

Steer a Sonar sampler toward a reference latent

By blepping·Created 3 years ago·Updated 9 days ago· 49
SonarGuidanceConfig
  • latent
  • SONAR_GUIDANCE_CFG
factor0.010
guidance_typelinear
start_step0
end_step9999

SonarGuidanceConfig is the settings bundle you plug into the Sonar sampler nodes (SamplerSonarEuler, SamplerSonarEulerAncestral, SamplerSonarDPMPPSDE) to push the generation toward a reference latent's structure. The reference is a real LATENT - typically a latent you encoded from a source image - and the sampler nudges itself toward that latent's composition at the steps you choose. It's a poor-man's structural control: no ControlNet, no extra model, just a guidance term inside sampling.

The Sonar context

Sonar sampling is momentum-based sampling, a niche idea that came from an A1111 extension (Kahsolt's stable-diffusion-webui-sonar) and gets ported into ComfyUI here. Instead of treating every denoising step in isolation, the sampler keeps a running history of the denoising direction and uses it to smooth or accelerate the next step. The guidance config rides on top of that momentum machinery - that's why this node is wired into the sampler nodes, not into a KSampler. Momentum-style sampling is still very much a live idea in the community (plenty of custom samplers in 2026 keep a running "momentum" of the denoising direction), but the original Sonar implementation is niche and old.

The inputs that matter

  • latent - your reference. Must be the same size as the latent being sampled, or guidance gets confused. Encode an image and use its latent here.
  • guidance_type - linear just lerps the guidance at the specified strength; euler does an Euler step toward the guidance instead. Pick euler for gentler steering.
  • factor - guidance strength, default 0.01. The README's numbers are worth memorizing: for euler, reasonable values are ~0.01–0.1; for linear, more like 0.001–0.02. Negative factors are legal and produce high contrast with very vivid colors.
  • start_step / end_step - the window (zero-based) where guidance is active. This is the fun one: instead of low guidance for the whole generation, you can use high guidance early and cut it off after a few steps, which the README explicitly recommends.

Output is a SONAR_GUIDANCE_CFG type that plugs into the guidance config input on the Sonar sampler nodes.

Where people get burned

Two things. First, the reference latent really does need to match the sampled latent's size - mismatch is the classic "why is my guidance doing nothing / looking garbage" failure. Second, the README is upfront that this guidance "probably isn't working correctly" and definitely isn't a faithful port of the A1111 original. It's a toy for playing with, not a reliable steering mechanism. If you need dependable composition control, ControlNet or a reference-strength node is the grown-up tool; this is the experiment.

Install

Part of the ComfyUI-sonar pack: ComfyUI Manager → search "ComfyUI-sonar" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/blepping/ComfyUI-sonar

No model downloads. But to actually use this node you also need the Sonar sampler nodes, which ship in the same pack - so one install gets you everything. The README recommends the ancestral Euler sampler for the best results, and mentions that BlehDiscardPenultimateSigma from the author's ComfyUI-bleh pack helps if output looks washed out.

Categorysampling/custom_sampling/samplers

Inputs (5)

NameTypeDefaultDescription
factorFLOAT0.010-2–2Controls the strength of the guidance. You'll generally want to use fairly low values here.
guidance_typeCOMBOlinearMethod to use when calculating guidance. When set to linear, will simply LERP the guidance at the specified strength. When set to Euler, will do a Euler step toward the guidance instead.
start_stepINT00–10000First zero-based step the guidance is active.
end_stepINT99990–10000Last zero-based step the guidance is active.
latentLATENTLatent to use as a reference for guidance.

Outputs (1)

NameTypeDescription
SONAR_GUIDANCE_CFGSONAR_GUIDANCE_CFG