Nodes/ComfyUI-sonar/SonarResizedNoiseAdv
ComfyUI Node

SonarResizedNoiseAdv

Resized noise, but with a real sizing system

By blepping·Created 3 years ago·Updated 15 days ago· 49
SonarResizedNoiseAdv
  • custom_noise
  • SONAR_CUSTOM_NOISE
factor1.000
width32.000
height32.000
spatial_moderelative
spatial_compression8
downscale_strategycrop
initial_referenceprefer_crop
crop_modecenter
crop_offset_horizontal0
crop_offset_vertical0
upscale_modenearest-exact
downscale_modenearest-exact
normalizedefault

SonarResizedNoiseAdv is the advanced sibling of SonarResizedNoise: same job - resize a noise item before it reaches the sampler - but with a proper sizing system instead of one hard-coded interpretation of width and height. If you only ever resize noise for SD 1.5 or SDXL, the basic version is fine. If you're working with models that don't follow the classic 8x spatial compression - or you want to think in percentages and padding instead of absolute pixels - this is the one.

What the "Adv" buys you

  • spatial_mode (relative / percentage / absolute) - the core difference. In relative mode, width/height behave as padding around the source noise. In percentage mode, values are fractions of the original size: 1.0 = 100%, 0.5 = 50%. In absolute mode, they're exact sizes.
  • spatial_compression (default 8) - in absolute mode, your width/height get multiplied by this to reach latent space, because most image models use 8x spatial compression. This is the knob that makes the node friendlier to unusual models: a model with different compression needs a different value here, and it's ignored in percentage mode. The changelog specifically calls out ACE-Steps as a case where absolute sizes are what you want.
  • width / height (default 32) - interpreted per spatial_mode. In absolute mode, remember the tip that carries over from the basic node: set them higher than the image you're actually sampling and let cropping do the work.

Everything else matches the basic node: downscale_strategy (leave on crop for normal workflows), crop_mode with nine positions, crop_offset_horizontal / crop_offset_vertical for nudging the window, upscale_mode / downscale_mode for resampling, plus factor, normalize, and the custom_noise input. Output is the standard SONAR_CUSTOM_NOISE that feeds a Sonar sampler, SamplerConfigOverride, or NoisyLatentLike.

When to reach for it

Use the basic version unless you have a specific reason: a non-8x model, or a workflow where you want to reason in percentages ("give me noise at 50% of the latent, then let the chain crop it"). The percentage mode is genuinely handy for experimentation because you can build a chain that self-adjusts to whatever resolution the sampler happens to use - no manual resizing when you swap between SDXL and a video model.

Installing

Ships with the ComfyUI-sonar pack. Install via ComfyUI Manager (search "ComfyUI-sonar"), or clone it:

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

Restart ComfyUI and look under advanced/noise. Pure Python, no extra packages, no model files. One pack-level note: the README's disclaimer about things "changing fairly frequently" applies double to the Advanced nodes - the absolute/percentage system is newer territory for the author, so don't be surprised if a future update renames or reinterprets a mode.

Categoryadvanced/noise

Inputs (14)

NameTypeDefaultDescription
factorFLOAT1.000-10000–10000Scaling factor for the generated noise of this type.
widthFLOAT32.0000–10000Note: In absolute mode, this should almost always be set to a higher value than the image you're actually sampling.
heightFLOAT32.0000–10000Note: In absolute mode, this should almost always be set to a higher value than the image you're actually sampling.
spatial_modeCOMBOrelativeIn relative mode, the sizes control padding. In percentage mode, the values will be interpreted as percentages of the origal size where 1.0 would be 100%, 0.5 would be 50% and so on. In absolute mode, this controls the absolute size.
spatial_compressionINT81–10000Most image models use 8x spatial compression. When spatial mode is absolute, the sizes will be multiplied by this value. It is ignored in percentage mode.
downscale_strategyCOMBOcropScaling noise is something you'd pretty much only use to create weird effects. For normal workflows, leave this on crop.
initial_referenceCOMBOprefer_cropThe initial latent the noise sampler uses as a reference may not match the requested width/height. This setting controls whether to crop or scale. Note: Cropping can only occur when the initial reference is larger than width/height in both dimensions which is unlikely (and not recommended).
crop_modeCOMBOcenterNote: Crops will have a bias toward the lower number when the size isn't divisible by two. For example, a center crop of size 3 from (0, 1, 2, 3, 4, 5) will result in (1, 2, 3).
crop_offset_horizontalINT0-10000–10000This offsets the cropped view by the specified size. Positive values will move it toward the right, negative values will move it toward the left. The offsets will be adjusted to to fit in the available space. For example, if you have crop_mode set to top_right then setting a positive offset isn't going to do anything: it's already as far right as it can go.
crop_offset_verticalINT0-10000–10000This offsets the cropped view by the specified size. Positive values will move it toward the bottom, negative values will move it toward the top. The offsets will be adjusted to to fit in the available space. For example, if you have crop_mode set to bottom_right then setting a positive offset isn't going to do anything: it's already as far down as it can go.
upscale_modeCOMBOnearest-exactAllows setting the scaling mode when width/height is smaller than the requested size.
downscale_modeCOMBOnearest-exactAllows setting the scaling mode when width/height is larger than the requested size and downscale_strategy is set to 'scale'.
normalizeCOMBOdefaultControls whether the generated noise is normalized to 1.0 strength.
custom_noiseSONAR_CUSTOM_NOISE,OCS_NOISEAllows connecting a custom noise chain. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE

Outputs (1)

NameTypeDescription
SONAR_CUSTOM_NOISESONAR_CUSTOM_NOISEA custom noise chain.