LatentWalkConditionalRandom
A random walk through prompt space that stays on the leash
- start
- CONDITIONINGS
Every other node in the Latent Walk pack needs two points: a start and an end, and it morphs between them. LatentWalkConditionalRandom is the odd one out - it takes a single prompt embedding and wanders around it randomly, producing a batch of nearby-but-different conditionings. It's the tool for the question "what else lives next to this prompt?" when you're too lazy to write twenty variations by hand.
How the walk works
The core idea is a constrained random walk. Starting from your start CONDITIONING, the node generates steps conditionings where each step adds a random vector - but a normalized random vector, scaled by dist_mult times the length of the original embedding, so the walk stays in the same neighborhood rather than careening off into prompt-soup territory. After each step it renormalizes the result back to the start's original norm, which keeps the conditioning at a magnitude the sampler actually expects. Without that normalization, the whole thing drifts into garbage.
The two knobs that matter are dist_mult and momentum. dist_mult (default 0.5) sets how big each random step is relative to the embedding's length - the higher it goes, the further each frame wanders. momentum (default 0.0) decides how much of the previous step's direction carries forward: at 0 it's pure random noise, every step an independent jitter; at 1.0 it's a straight line, which is just a walk that never turns. In between, you get a drunk-but-directional drift. There's no end prompt and no blend or travel mode - this node's whole job is exploration, not interpolation.
What you do with it
steps (default 9) conditionings come out as a single batched CONDITIONING, so - same as its sibling - your latent needs batch_size = steps or the sampler will only draw one image. Hook it up like this:
- One CLIPTextEncode into
start. - LatentWalkConditionalRandom into a KSampler.
- EmptyLatentImage (or a latent) with batch set to
steps. - Queue and watch a batch of variations roll out.
The outputs are great for seed-sweep-style exploration - "give me a batch of things in this prompt's vicinity" - and for animation frames that drift rather than morph, since each frame is a small coherent step from the last instead of a forced interpolation between two fixed points.
The fiddly part
The dials are the trap. dist_mult too high and you leave the meaningful part of embedding space - you get the prompt version of static, where every frame is recognizable mush. Too low and every frame is a near-duplicate of the start and the batch is pointless. There's no right answer baked in; start at the 0.5 default and nudge. Also worth knowing: the walk is seeded from whatever randomness torch.randn_like produces, so two runs won't give you the same batch unless you get lucky - treat it as a generator, not a reproducible recipe. That's actually the point, but it surprises people the first time.
Installing it
It's part of the Latent Walk pack (rnbwdsh/ComfyUI-LatentWalk), a fork of Nicholas McCarthy's TravelSuite. In ComfyUI Manager, search "Latent Walk":
cd ComfyUI/custom_nodes
git clone https://github.com/rnbwdsh/ComfyUI-LatentWalk
Restart ComfyUI after cloning. Dependencies are torch, numpy, Pillow and scipy - nothing exotic, no model downloads. Compared to the pack's other nodes this is the lowest-effort one: one input, no shape-matching asserts to trip over, and you don't need the execution-inversion loop library that LatentWalkNoise demands. If you want variation generation with zero wiring, this is the node to grab.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| start | CONDITIONING | — | |
| dist_mult | FLOAT | 0.500.001–1000 | — |
| momentum | FLOAT | 0.000–1 | — |
| steps | INT | 9 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONINGS | CONDITIONING | — |