KJNodes/noisegenerated

Generate Noise(GenerateNoise)

This node internally uses PyTorch's random number generator to ensure noise reproducibility by setting a seed.

Generate Noise

model
sigmas
LATENT
width
512
height
512
batch_size
1
seed
123
multiplier
1.00
constant_batch_noise
normalize
latent_channels
COMBO
shape
COMBO
KJNodes

The Generate Noise node internally uses PyTorch's random number generator, ensuring noise reproducibility by setting a seed.

The Generate Noise node is a utility tool for generating random noise. Its core function is to create noise tensors that conform to specific dimensions and distributions. This noise can be used directly as latent space (Latent) data, providing initial randomness for the image generation process.

Node Functionality

This node internally uses PyTorch's random number generator, ensuring noise reproducibility by setting a seed. It supports generating noise in various shape formats (BCHW, BCTHW, BTCHW) to meet the needs of different model architectures. It also allows for scaling (multiplier) and normalization (normalize) of the generated noise.

Node Parameter Description - Generate Noise

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
modelMODELNo--Optional model input. When connected, the node will use the model's internal channel count setting to override the latent_channels parameter.
sigmasSIGMASNo--Optional scheduler sigmas (SIGMAS) input. When connected, the generated noise will be scaled according to the sigmas for finer noise control.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
widthINTYes51216 - 4096 (Step: 1)Specifies the width of the generated noise image. The width of the final noise tensor is this value divided by 8. Value range: 16 to 4096.
heightINTYes51216 - 4096 (Step: 1)Specifies the height of the generated noise image. The height of the final noise tensor is this value divided by 8. Value range: 16 to 4096.
batch_sizeINTYes11 - 4096Specifies the batch size for noise generation, i.e., how many noise images to generate at once. Value range: 1 to 4096.
seedINTYes1230 - 0xffffffffffffffff (Step: 1)Controls the seed value for random number generation. The same seed produces identical noise. Value range: 0 to 0xffffffffffffffff.
multiplierFLOATYes1.00.0 - 4096 (Step: 0.01)Scaling multiplier for noise intensity, used to globally amplify or attenuate the generated noise. Value range: 0.0 to 4096.0.
constant_batch_noiseBOOLEANYesFalse-Boolean switch. If enabled, all noise images in the batch are identical; if disabled, each noise image in the batch is different.
normalizeBOOLEANYesFalse-Boolean switch. If enabled, normalizes the generated noise to have a mean of 0 and a standard deviation of 1.
latent_channelsCOMBONo-"4", "16"Specifies the number of channels for the generated latent noise.
shapeCOMBONo-"BCHW", "BCTHW", "BTCHW"Specifies the tensor shape format.

Output

Parameter NameData TypeDescription
LATENTLATENTOutputs the generated noise data in latent representation (LATENT) format, ready for use by subsequent sampling or processing nodes.

Usage Scenarios

In image generation workflows, this node is commonly used to provide initial "blank" latent data for the Sampler, especially when the sampler's "add_noise" option is turned off. It can also be used for noise injection experiments, exploring image variations by combining the generated noise with other latent representations.

Notes

Please note that the dimensions of the generated noise are automatically downsampled (typically divided by 8) based on the selected model or latent channel count. When connected to a model input, the node will prioritize using the model's internal channel count setting.

The Generate Noise node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…