Nodes/Skoogeer-Noise/Fluid Latent Advection
ComfyUI Node

Fluid Latent Advection

Flow Your Latent Like Dye — Deformation Before Decode

By ttulttul·Created 8 months ago·Updated 2 months ago· 14
Fluid Latent Advection
  • latent
  • mask
  • latent
  • velocity_preview
steps20
dt1.00
resolution_scale0.50
force_count3
force_strength5.0
force_radius0.10
swirl_strength2.0
velocity_damping0.980
diffusion0.00
vorticity0.00
seed0
wrap_modeclamp

Fluid Latent Advection is the latent-space version of Fluid Image Advection: same stable-fluids simulation, but instead of pushing pixels around, it treats the latent's channels as dye and advects them through a viscous velocity field. You get a LATENT in, a LATENT out, and the deformation happens before the VAE ever runs. The difference from doing it in image space is real - the flow interacts with feature structure rather than raw color, so the smear comes out looking more like the image is made of something physical than like it was photoshopped.

If you've read the image variant's article, the mechanism is identical and you can skim this: random force injections ("sticks") stir a velocity field, vorticity confinement makes the motion curl, velocity advects itself, damping bleeds energy, and then the latent's channels get advected through the final velocity. Repeat for steps. The one implementation detail worth knowing here is that the latent channels are flattened and advected as a single field, so the whole sample moves coherently rather than each channel flowing its own direction.

The parameter list is the same as the image version, and the ones you'll touch are the same set:

  • steps / dt - duration and time-step size.
  • resolution_scale - internal sim resolution. 0.5 is the default and the right place to start; this is your speed control.
  • force_count, force_strength, force_radius, swirl_strength - how many sticks, how hard, how wide, how twisty.
  • velocity_damping - lower = the flow settles faster, more viscous.
  • vorticity - makes the flow billow instead of sliding straight.
  • wrap_mode - clamp / wrap / mirror for sampling outside the bounds.

Outputs: the deformed latent plus a velocity_preview image showing the flow field. Optional mask input limits the advection to masked regions (resized to latent resolution).

Where it fits

This is the node to reach for when you want fluid motion but you also want a sampler to "heal" the result into something coherent. Flow the latent, then KSampler at moderate denoise - the model will re-interpret the smears as water, silk, or drifting fog, which is a much more believable kind of motion than a raw pixel smear. It's also the base ingredient for the pack's smoke workflow, which layers buoyancy on top of exactly this advection.

Installing

Part of the Skoogeer-Noise pack by ttulttul:

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

Restart ComfyUI or install via Manager ("Skoogeer-Noise"). Dependencies are torch/numpy/einops/pyyaml only - no models, no downloads.

Gotchas

Same two warnings as the image variant, plus one latent-specific. Speed: it's a real simulation on CPU tensors, so keep resolution_scale at 0.5 and don't crank steps into the hundreds on big latents. Stillness: zero force_count means nothing happens, check it if your latent comes back untouched. And the latent-specific one - Flux.2's patchified 128-channel latents will advect into blocky artifacts because the 2x2 patch blocks aren't true spatial neighbors. Unpatchify with Unpatchify Flux.2 Latent before this node and re-patchify after, or stick to SD-family latents. Folder name matters too: keep it Skoogeer-Noise or the module import (custom_nodes.Skoogeer-Noise) breaks.

Categorylatent/perturb

Inputs (14)

NameTypeDefaultDescription
latentLATENTLatent to distort by fluid advection (treats channels as dye).
stepsINT200–256Number of simulation steps.
dtFLOAT1.000–4Time step size used during semi-Lagrangian advection.
resolution_scaleFLOAT0.500.25–1Internal simulation resolution scale (lower = faster).
force_countINT30–64Number of random force injections ('sticks') per step.
force_strengthFLOAT5.00–64Linear force magnitude added to velocity (in latent pixels / step).
force_radiusFLOAT0.100–1Normalized radius of influence (0.1 = 10% of min(width,height)).
swirl_strengthFLOAT2.00–64Rotational component added around each stick position.
velocity_dampingFLOAT0.9800–1Velocity decay applied each step (lower = more viscous / quickly settles).
diffusionFLOAT0.000–1Optional velocity diffusion (simple Gaussian smoothing).
vorticityFLOAT0.000–10Vorticity confinement strength (adds swirling detail).
seedINT00–18446744073709550000Seed controlling the random stick injections.
wrap_modeCOMBOclampHow advection samples outside the bounds.
maskoptMASKOptional mask to limit the effect to masked areas (mask is resized to latent resolution).

Outputs (2)

NameTypeDescription
latentLATENT
velocity_previewIMAGE