Nodes/ComfyUI-sonar/SonarNormalizeNoiseToScale
ComfyUI Node

SonarNormalizeNoiseToScale

Custom noise type that allows precisely controling noise normalization. The default range of -4.5 to 4.5 is roughly what you'd get from 10,000 items of Gaussian noise.

By blepping·Created 3 years ago·Updated 4 days ago· 49
SonarNormalizeNoiseToScale
  • custom_noise
  • sonar_custom_noise_opt
  • SONAR_CUSTOM_NOISE
factor1.000
rescale0.000
min_negative_value-4.500
max_negative_value0.000
min_positive_value0.000
max_positive_value4.500
modesimple
dims-3, -2, -1
std_dims-3, -2, -1
std_multiplier1.000
mean_dims-3, -2, -1
mean_multiplier1.000
normalize_noisefalse
normalizedisabled
Categoryadvanced/noise

Inputs (16)

NameTypeDefaultDescription
factorFLOAT1.000-10000–10000Scaling factor for the generated noise of this type.
rescaleFLOAT0.0000–10000When non-zero, this custom noise item and other custom noise items items connected to it will have their factor scaled to add up to the specified rescale value. When set to 0, rescaling is disabled.
custom_noiseSONAR_CUSTOM_NOISE,OCS_NOISEAllows connecting a custom noise chain. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE
min_negative_valueFLOAT-4.500-10000–10000In simple mode, this is just the lowest value in the range (and can be positive, despite the name). In advanced mode, this controls the minimum negative value. If you set it to 0 or higher then normalization will leave negative values alone.
max_negative_valueFLOAT0.000-10000–10000Not used in simple mode. In advanced mode, this controls the maximum negative value. If you set it to 0 or higher, a maximum negative value will be automatically determined from negative value closest (but not equal to) zero.
min_positive_valueFLOAT0.000-10000–10000Not used in simple mode. In advanced mode, this controls the minmum positive value. If you set it to 0 or lower, a minimum positive value will be automatically determined from positive value closest (but not equal to) zero.
max_positive_valueFLOAT4.500-10000–10000In simple mode, this is just the highest value in the range (and can be negative, despite the name). In advanced mode, this controls the maximum positive value. If you set it to 0 or lower then normalization will leave positive values alone.
modeCOMBOsimpleThere are several modes: simple: The noise will be rebalanced to be in between min_negative_value and max_positive_value. Though it sounds weird, you don't need to respect the positive/negative in the names. It is just treated as a simple range. advanced: Positive and negative values in the noise are separately rebalanced to be between the specified ranges. If you set max_negative_value to something positive or min_positive_value to something negative this will automatically determine whatever the closest value to zero is for each sign. Additionally, if you set max_positive_value to something negative or min_negative_value to something positive then values for that sign will be left alone.
dimsSTRING-3, -2, -1A comma separated list of dimensions which can be negative to count from the end. This behaves differently in advanced mode: If left blank, normalization will be global. If set to anything, normalization will be over each batch item separately. The actual values of the dimensions are ignored in advanced mode currently.
std_dimsSTRING-3, -2, -1A comma separated list of dimensions which can be negative to count from the end.
std_multiplierFLOAT1.000-10000–10000Multiplier on the distance of the std from 1.0. The noise will be divided by this. You can set it to 1.0 to skip the division. When enabled, the division occurs before the final normalize and scaling and after the min/max value parameters are applied.
mean_dimsSTRING-3, -2, -1A comma separated list of dimensions which can be negative to count from the end.
mean_multiplierFLOAT1.000-10000–10000Multiplier on the mean of the noise. The mean will be subtracted from the noise if it's not 0. This occurs before the final normalize and scaling and after the min/max value parameters are applied.
normalize_noiseBOOLEANfalseControls whether the noise source is normalized immediately after generation.
normalizeCOMBOdisabledControls whether the generated noise is normalized to 1.0 strength. Enabling this does the same thing as the default mean/std settings.
sonar_custom_noise_optoptSONAR_CUSTOM_NOISE,OCS_NOISEOptional input for more custom noise items. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE

Outputs (1)

NameTypeDescription
SONAR_CUSTOM_NOISESONAR_CUSTOM_NOISEA custom noise chain.