SonarCustomNoiseParameters
The node that fixes the pack's reproducibility problem
- custom_noise
- SONAR_CUSTOM_NOISE
SonarCustomNoiseParameters doesn't generate noise itself - it wraps another SONAR_CUSTOM_NOISE chain and lets you control how that noise gets generated. It's the plumbing node, and the one that answers the pack's most annoying quirk: the README admits that noise gets generated on GPU or CPU "probably inconsistently," which means the same seed can give different results on different GPUs. This node is where you take control of that, plus dtype, RNG behavior, and a few fixups for weird latents.
What it actually does
Feed a custom_noise chain in, set your overrides, get the same chain out with the overrides applied. The output type is still SONAR_CUSTOM_NOISE, so it slots into any chain position. Its superpower is making non-deterministic noise deterministic, or deliberately independent.
The settings that matter:
rng_mode-default(nothing special),separate(creates its own generator and saves/restores state, covering the Pythonrandommodule too), orfork(uses the current RNG state but restores it afterward). If you want your noise independent of whatever else is sampling,separateis the one.rng_state_offset- the author's clever rename. It's a seed, but not calledseedon purpose, because ComfyUI's default seed widget auto-increments and the author wants you to be able to not have that. Plug an INT primitive in if you want auto-increment.rng_offset_mode-disabled,override, oradd, controlling how that offset interacts with the seed the sampler would otherwise use.addis handy for per-frame offsets in video/batch work.override_dtype- mostly leave alone, butfloat64is the useful one if you're seeing precision artifacts; the tooltip explicitly says to avoid the int and float8 types.override_device-cpu,gpu, ordefault. This is your reproducibility switch: pin tocpuand you remove a whole class of "seed changed between runs" weirdness, at the cost of speed.
The fixups
Three toggles that exist because real latents are messy:
frames_to_channels- for 5D video latents, moves the frame dimension into channels. Many noise generators can't handle 5D directly. The tooltip says it's safe to enable for all models.ensure_square_aspect_ratio- rearranges H/W to be square, padding with zeros. Helps noise types that choke on extreme aspect ratios, and handles 3D (single spatial dimension) latents.fix_invalid- replaces NaNs and infinities with 0. If you're getting black or corrupted outputs from a noise type you just pushed too far, flip this on before debugging anything else.
Plus the standard factor, normalize (default/forced/disabled), and a custom_noise input.
Install
Standard pack install: ComfyUI Manager → search "ComfyUI-sonar" → Install → restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/blepping/ComfyUI-sonar
No models, no extra deps. If you hit the GPU-vs-CPU seed divergence the README warns about, this node - specifically override_device and rng_mode - is the fix, and it's the reason to install this node even if you otherwise leave the noise toybox alone.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| factor | FLOAT | 1.000-10000–10000 | Scaling factor for the generated noise of this type. |
| custom_noise | SONAR_CUSTOM_NOISE,OCS_NOISE | Allows connecting a custom noise chain. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE | |
| rng_state_offset | INT | 00–10000 | In other words, seed. Avoiding using the word seed here to suppress ComfyUI's annoying default behavior. If you want stuff like auto-increment you can connect an INT primitive node. |
| rng_offset_mode | COMBO | disabled | Controls the seed passed to the noise sampler and also seeding when rng_mode is set to separate. Most noise samplers don't care about the seed so this generally will only have an effect in when rng_mode is set to separate. |
| rng_mode | COMBO | default | default mode doesn't do anything special. separate mode creates a generator and saves/restores the state when generating noise (also includes the Python random module). fork uses the existing RNG state (for both Torch and Python random module) but restores it to whatever it was before the custom noise was called. |
| frames_to_channels | BOOLEAN | false | Only applicable for 5D latents (video models). Will move the frame dimension into channels, may be necessary if a noise type can't deal with 5D latents directly. It's safe to enable this for all models. |
| ensure_square_aspect_ratio | BOOLEAN | false | Will rearrange the height/width sizes to be square, padding with zeros if necessary. May help some noise types work better with extreme aspect ratios, can also deal with 3D (1 spatial dimension) latents. |
| fix_invalid | BOOLEAN | false | Replaces any NaNs or infinite values with 0. |
| override_dtype | COMBO | default | Can be used to override the dtype the noise is generated with. Not all noise generators support all types. I don't recommend using the int or float8 types. Probably the most useful override is float64. |
| override_device | COMBO | default | default just uses whatever device normally would be used. gpu will use ComfyUI's default GPU device and also toggle the cpu_noise flag off. cpu will use the CPU device and toggle the cpu_noise flag on. |
| normalize | COMBO | default | Controls whether noise is normalized to 1.0 strength. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SONAR_CUSTOM_NOISE | SONAR_CUSTOM_NOISE | A custom noise chain. |