Nodes/Skoogeer-Noise/Latent Reaction-Diffusion
ComfyUI Node

Latent Reaction-Diffusion

Grow Patterns Where the Sampler Can See Them

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Latent Reaction-Diffusion
  • latent
  • mask
  • LATENT
seed0
iterations200
feed_rate0.036
kill_rate0.065
diffusion_u0.16
diffusion_v0.08
time_step1.00
strength0.75
channel_modeshared
temporal_modelocked

Latent Reaction-Diffusion is the latent-space sibling of the pack's Image Reaction-Diffusion node, and it does the same thing in a different neighborhood: it runs a Gray-Scott reaction-diffusion simulation and injects the resulting organic pattern into a latent instead of an image. Same biology-inspired spots-and-stripes texture, but applied where the sampler - and the VAE - actually work.

Why would you bother doing this in latent space rather than just pasting texture onto a decoded image? Because injecting into the latent means the pattern gets integrated into the model's own feature representation before (or during) sampling, so it can read as genuine structure rather than an overlay you'd have to blend in post. It's a nice fit for workflows that already do their editing in latent space - texture transfer, structured variation on a latent before decode, or consistent organic perturbation across a batch.

How it works

The mechanism is identical to the image variant: seed initial chemical concentrations, run the Gray-Scott simulation for iterations steps, normalize the resulting pattern, and add it to the latent scaled by the latent's standard deviation times strength. feed_rate (F) and kill_rate (K) are the pattern-shape dials - F=0.036 / K=0.065 are the defaults sitting in classic spot/stripe territory. channel_mode reuses one simulation for all channels or reruns per channel; temporal_mode locks the pattern across video frames or reruns per frame. The optional mask is resized to latent resolution and confines the injection.

The inputs that matter

  • latent - the latent to perturb.
  • seed - initial concentrations; changes the pattern.
  • iterations - simulation length; more steps = more evolved pattern, slower.
  • feed_rate / kill_rate - the shape dials. Small changes, huge pattern differences.
  • strength - how hard the pattern pushes in, relative to latent std.

Output is a LATENT.

Installing it

Part of Skoogeer-Noise. Manager → search "Skoogeer-Noise", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise

Restart ComfyUI. Deps are torch, numpy>=1.26, einops, pyyaml>=6.0.3 - nothing heavy.

Common gotchas

Same F/K sensitivity as the image version: 0.001 in feed_rate flips spots to stripes, so treat it as a creative search, not a set-and-forget. Watch the compute budget - the simulation loops over the whole latent grid iterations times, and per_channel mode multiplies that by your channel count. And the Flux.2 warning applies here too: if your latent is patchified (128 channels, 2x2 blocks), wrap the node with Unpatchify Flux.2 Latent before and Patchify Flux.2 Latent after, or the pattern will sit on top of block boundaries instead of the real spatial layout.

CategoryLatent/Noise

Inputs (12)

NameTypeDefaultDescription
latentLATENTLatent that will receive reaction-diffusion patterns.
seedINT00–18446744073709550000Seed for the initial chemical concentrations.
iterationsINT2001–2000Number of Gray-Scott simulation steps.
feed_rateFLOAT0.0360–0.1Feed rate (F) controlling how quickly chemical U is replenished.
kill_rateFLOAT0.0650–0.1Kill rate (K) regulating removal of chemical V.
diffusion_uFLOAT0.160–1Diffusion rate for chemical U.
diffusion_vFLOAT0.080–1Diffusion rate for chemical V.
time_stepFLOAT1.000.01–5Simulation time step used during integration.
strengthFLOAT0.750–5Scale of the normalized pattern relative to the latent's standard deviation.
channel_modeCOMBOsharedReuse one simulation for all channels or rerun per channel.
temporal_modeCOMBOlockedlocked reuses the same pattern for every frame; animated reruns the simulation per frame.
maskoptMASKOptional mask (often image-sized) to limit the pattern injection to masked areas. The mask is resized to latent resolution (bicubic when downscaling).

Outputs (1)

NameTypeDescription
LATENTLATENT