ComfyUI Node

GoldenNoise

Don't curse the seed — refine it instead

By LucipherDev·Created 2 years ago·Updated about a year ago· 24
GoldenNoise
  • noise
  • conditioning
  • NOISE
model_id
npnet_model
device

You know how the same prompt on two seeds can look dramatically different - one sharp and coherent, one smeary mush? The Golden Noise paper (arXiv 2411.09502) made a genuinely interesting claim: that spread isn't just luck. Some random latents are, on average, better starting points than others, and you can learn to predict the perturbation that makes a random noise behave well for a given prompt. GoldenNoise is a ComfyUI port of that idea. You feed it your plain noise plus your prompt conditioning, and it hands back a "golden" noise that samples cleaner.

Before you get excited: this is not a magic quality button. The gains the authors report are real but modest - the pack's own README shows an ImageReward comparison over just 50 images per prompt, and it's an improvement, not a revolution. Where it earns its keep is few-step distilled models (the paper was validated on SDXL, DreamShaper-xl-v2-turbo, and Hunyuan-DiT), because that's where a bad starting latent costs you the most. There are only three model_id choices - SDXL, DreamShaper, DiT - and that list is the whole story: this is an SDXL-family and DiT toy. It's not for Flux, and it's not for SD 1.5 (more on that below).

How it works

The trick is that it doesn't touch your sampler at all. The paper's NPNet ("noise prompt network") is a plug-in that only transforms the initial noise. In this node, that means the input noise isn't a tensor - it's a NOISE object from a RandomNoise node (or anything else producing NOISE). GoldenNoise wraps it, runs the refinement when the sampler asks for noise, and returns a new NOISE object.

Mechanically, the node loads three small networks: a NoiseTransformer built around a Swin-T backbone (timm's swin_tiny_patch4_window7_224), an SVD-style U-Net, and an AdaGroupNorm text-embedding module. It fuses your conditioning text embeddings with the initial noise to produce the refined latent. Everything runs at 128×128 - your actual latent gets nearest-exact upscaled down for the NPNet and back up afterward, so it's a 128px-level adjustment, not a full-res one.

Inputs and outputs that matter

  • noise - your RandomNoise output. The node reads its seed, so keep a fixed seed if you want reproducible golden noise.
  • conditioning - the positive prompt conditioning from your CLIP Text Encode. This is the "noise prompt": the perturbation is tailored to your prompt.
  • model_id - SDXL, DreamShaper, or DiT. Pick the one matching the NPNet weights you downloaded.
  • npnet_model - the dropdown of .safetensors files in your models/npnets folder.
  • device - cuda, or cpu if you must.

The single output is NOISE (tooltip: "The golden noise"). It wires into the noise input of a custom sampler - the bundled example uses SamplerCustomAdvanced - and nothing else.

The beginner trap

This node lives under sampling/custom_sampling/noise, which should tell you the catch: it only works with ComfyUI's custom sampling framework. You can't drag it into a normal KSampler workflow. You need the Custom Sampler / SamplerCustomAdvanced setup, and GoldenNoise replaces the RandomNoise feeding it. The pack ships a comparison workflow that runs golden and plain noise side by side - the best way to see what it's actually doing for you.

Installing it

Via ComfyUI Manager, search "Golden-Noise". Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/LucipherDev/ComfyUI-Golden-Noise
cd ComfyUI-Golden-Noise
pip install -r requirements.txt   # timm, einops

Restart, then download the pre-trained NPNet weights (SDXL, DreamShaper, Hunyuan-DiT safetensors) from LucipherDev/Golden-Noise-NPNets into ComfyUI/models/npnets/ - the npnet_model dropdown reads that folder, so nothing appears until you add files.

Common issues

  • Empty npnet_model dropdown - the safetensors aren't in models/npnets. That's the #1 "nothing works" cause.
  • Old timm throws an import error on timm.layers - older timm releases don't expose it. pip install -U timm fixes it; this is a known pain point for the whole Golden-Noise port family.
  • On SD 1.5 it silently does nothing. The conditioning embeddings are SDXL-shaped (2048×77), so on an SD 1.5 checkpoint the forward pass fails - and the code swallows the exception and returns your original noise. A quiet no-op, so you'd never know. Golden noise needs an SDXL-family or DiT model.
  • First run downloads a Swin-T backbone. timm fetches the pretrained swin_tiny weights from HuggingFace when the node first loads, so you need internet that first time even though the NPNet itself is local.

The honest verdict: it's a fun, well-documented research novelty that occasionally does something lovely on few-step SDXL. The paper got real community attention when it dropped - the r/StableDiffusion announcement thread pulled a couple hundred upvotes and several ComfyUI ports followed within days - but expect a subtle quality bump, not a new model. For that use case, this is the cleanest port of the bunch, and the only one that hands you safetensors on HuggingFace instead of a Google Drive link.

Categorysampling/custom_sampling/noise

Inputs (5)

NameTypeDefaultDescription
noiseNOISE
conditioningCONDITIONING
model_idCOMBO3 options: SDXL, DreamShaper, DiT
npnet_modelCOMBO0 options:
deviceCOMBO2 options: cuda, cpu

Outputs (1)

NameTypeDescription
NOISENOISEThe golden noise