Audio Noise to Latent
Turn a Song Into the Noise Your Sampler Starts From
- noise_params
- analysis_type
- LATENT
You've got a track you love, and you want images that react to it. This is the node where that actually happens - the endpoint of the Kayarte audio pack, the one that finally hands you a LATENT you can feed to a KSampler. Everything upstream (audio analysis, noise params) is just setting the table for this moment. And it's the one node in the pack that shows up in Google, which tracks: it's where the pipeline pays off.
What it is
Audio Noise to Latent ("NoiseToLatentConverter") takes the NOISE_PARAMS dict from the Audio To Noise Parameters node and turns it into a real, sampler-ready latent tensor. You pick a noise flavor - gaussian, salt_pepper, or perlin - and it builds the noise that the diffusion model will "denoise" into a picture. No model downloads, no API key, nothing cloud. It's all math on your own machine.
How it works
Diffusion models don't work in pixels. The VAE squeezes images down to a latent space that's 8× smaller per side with 4 channels - that's why the node quietly divides your width and height by 8 and builds a (batch, 4, h/8, w/8) tensor. At 512×512 that's a 64×64×4 tensor, which is why the generation runs fine on CPU (the code literally pins it to device="cpu" - nothing for your GPU to be jealous about).
The three noise types are genuinely different:
- gaussian -
torch.randnscaled by the intensity and persistence your audio produced. Smooth, soft, the default for a reason. - salt_pepper - a random mask punches values to ±intensity, giving crunchy, pixelated texture.
- perlin - actual gradient-based Perlin noise, the organic, wispy one.
The analysis_type also tweaks the math: onset/segment analyses boost intensity 1.5× and grain 2×, mel/spectral add extra frequency detail, tempo scales grain up and persistence down. The intent is that a drum-heavy track reads as sharper, denser noise than an ambient one.
The inputs that matter
You'll set four things:
- width / height - default 512, step 8. This is your output resolution; the latent dims are these divided by 8.
- batch_size - 1 to 64. How many frames of noise you get. If you're after a sequence, this is where you ask for it.
- noise_type - gaussian, salt_pepper, or perlin. Your call.
- noise_params and analysis_type - wired from upstream. Keep the analysis_type consistent with what the analysis node produced, or the per-type tuning will fight itself.
The single output is a LATENT. Wire it into a KSampler's latent input and keep denoise under 0.5 - the pack's own README says so, and it's the same low-denoise trick you already know from img2img: the model keeps the structure of your noise while painting over it, so the audio character shows through. The author's own example workflow skips the sampler entirely and previews the latent with a TAESDXL preview node, which is a fast way to see what your noise looks like before committing.
Installing the pack
Install via ComfyUI Manager (search "AudioDriven Latent Space Tools") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Kayarte/AudioDriven-Latent-Space-Tools-for-ComfyUI
then restart ComfyUI. One catch: the repo ships no requirements.txt, but the analysis node imports librosa, which ComfyUI doesn't include. You'll usually need:
pip install librosa
in your ComfyUI Python environment (that also drags in numba, scipy, and soundfile). Miss this and you'll hit the classic No module named 'librosa' error on load.
When it misbehaves
This node is the end of a chain, so it's only as healthy as its upstream. If the analysis node failed on a bad file path, noise_params comes back empty and this node throws a KeyError. Check the Audio To Noise Parameters debug_info output first. Also note Perlin re-seeds its random gradients every run, so a perlin latent is not reproducible - set a seed upstream if you care. And if your noise looks like it has nothing to do with the music, the usual culprit is a mismatch between the analysis_type you set here and the one the analysis node actually ran.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| noise_params | NOISE_PARAMS | — | |
| width | INT | 51264–2048 | — |
| height | INT | 51264–2048 | — |
| batch_size | INT | 11–64 | — |
| noise_type | COMBO | 3 options: gaussian, salt_pepper, perlin | |
| analysis_type | ANALYSIS_TYPE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |