Noisy Latent Perlin Dimensional
Perlin noise latents
- latent_image
- model
- LATENT
Every text-to-image run starts from noise. But here's the thing nobody tells beginners: what noise you start from is a choice, not a law of physics. The standard EmptyLatentImage → KSampler path starts from uniform random static. This node hands you the alternative: Perlin noise - the smooth, coherent gradient noise that game devs use for terrain and clouds - generated directly in the latent space.
Why bother? Because the starting noise isn't fully erased. At low denoise (img2img-style) and with ancestral samplers, the low-frequency structure of your initial latent bleeds into the final image. Pure random noise has no structure to bleed; Perlin noise has big, smooth, coherent blobs. Feed that in and you can steer broad composition - one seed that always leans toward a "mountain ridge" layout, or a sweep across seeds that changes details while the skeleton stays put. For variation steering and img2img it's a genuinely different knob than rerolling a seed. It's a refresh of Extraltodeus's well-known noise_latent_perlinpinpin, so the idea has real community pedigree, even if this pack stays a niche tool.
How it works
The node builds a classic 2D Perlin field - random gradient vectors per cell, smoothly interpolated - then does the bit that separates a toy from something that actually samples cleanly: it runs the result through torch.erfinv (the inverse error function) and scales by sqrt(2), mapping the flat [0,1] Perlin values into a near-gaussian distribution clamped to [-5, 5]. That matters because diffusion models were trained expecting gaussian latents. Feed a sampler a plainly non-gaussian starting tensor and you get banding, flat patches, or outright garbage. The "Dimensional" in the name is the channel count: it reads your model's latent_channels (4 for SD 1.5/SDXL, 16 for Flux and Wan) so the noise matches the VAE's layout instead of assuming.
The inputs that actually matter
Only three deserve your attention at first:
seed- reproducibility. Same seed, same Perlin field.detail_level- a FLOAT from -1 to 1 that scales the noise amplitude (1 + detail_level/10). Higher = more contrast in the starting field.downsample_factor- default 8, which matches the VAE's 8x downsampling (1024px → 128×128 latent). Leave it unless you know why you're changing it.
width/height are pixel dimensions (the node divides them by the downsample factor), and batch_size generates N latent samples at once. The two optional inputs are the good ones: model tells the node how many channels to make, and latent_image makes the output adopt an existing latent's exact shape.
Output and wiring
One LATENT out. The natural home for it is a SamplerCustom node's noise input, where it replaces the sampler's own generated noise - the closest thing to a direct swap-in. Or feed it to a regular KSampler as the latent with denoise under 1.0, so the structured field steers a partial redraw.
Install
Trivial - there's no requirements.txt, no model downloads, no extra deps beyond core ComfyUI (it's just torch and math). Either ComfyUI Manager → search "Dimensional Latent Perlin", or:
cd ComfyUI/custom_nodes
git clone https://github.com/NeuralSamurAI/ComfyUI-Dimensional-Latent-Perlin.git
Then restart ComfyUI. It lands under latent/noise.
Where people get burned
- The 4-channel default trap. If you don't wire in a
modelorlatent_image, the node falls back to 4 channels - right for SD 1.5/SDXL, wrong for Flux/Wan (16 channels). On those models you'll get a shape mismatch or silently broken sampling. Feed theMODELinput whenever you're not on a 4-channel model. - Mind the resolution. This is a CPU-side tensor computation. A single 1024×1024 latent is instant; crank
batch_sizeto 32 at 8192px and you're doing real work on the CPU while your GPU idles. - Don't expect a visual preview - the output is a latent, not pixels. Evaluate it through what comes out of the sampler, not by eyeballing the node.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| width | INT | 10248–8192 | — |
| height | INT | 10248–8192 | — |
| batch_size | INT | 11–64 | — |
| detail_level | FLOAT | 0.0-1–1 | — |
| downsample_factor | INT | 81–64 | — |
| latent_imageopt | LATENT | — | |
| modelopt | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |