Nodes/comfyui-lrw-nodes/Latent Curvature Map (LRW)
ComfyUI Node

Latent Curvature Map (LRW)

A 'map' of latent curvature that's really one number

By lajjadred·Created 3 months ago·Updated 3 months ago· 12
Latent Curvature Map (LRW)
  • latent
  • metric
  • curvature_map

Let's be straight with you about what this node is and isn't. Latent Curvature Map takes a latent and a metric and outputs an IMAGE - so your brain goes "a heatmap of where latent space is curvy, nice." What you actually get is a single scalar per latent in your batch, computed as the local volume element sqrt(det G(z)) of the pullback metric, normalized to 0–1, and drawn as a 64×64 grayscale block. It's a "map" in the same way a thermometer reading is a weather map. One number, per latent, blown up into a picture.

That's not me being sneaky about a bug - it's visible right in the source. The node computes one volume element per batch item, normalizes, and expands it to a 64×64 image because ComfyUI's IMAGE type wants pixels. Which is fine! Just go in knowing what you're looking at.

What it's good for

The number it computes is genuinely meaningful: sqrt(det G) is how much the decoder "stretches" space at that latent point - a proxy for how much volume of pixel-space a small region of latent-space covers. High value = lots of room, changes matter a lot; low value = the model is squeezing things, you're in a region where a nudge does little. The README frames it as visualizing "local metric/volume behavior."

Practical uses are mostly diagnostic. Feed it a latent from VAEEncode of an image you're about to edit and compare against another image's reading - differences in this value across the batch can hint at which image sits in a more "compressed" or "expanded" part of latent space before you go pushing vectors around with LRW_ParallelTransport. It's an experiment tool, not a production filter.

Inputs and output

  • latent - one or more latents. Each batch item gets its own scalar.
  • metric - required, from LRW_VAEDecoderBridge or LRW_PullbackMetric.

Output: curvature_map, an IMAGE with one grayscale block per latent in the batch. View it with any preview node.

Honest expectations

Because it's one scalar per latent normalized across the batch, the absolute value means nothing - only the relative ordering inside the batch does. And like every metric-based node here, it needs the real pullback metric, which is the expensive path that the WAN side of the pack deliberately avoids. So if you're doing WAN video, this isn't your node; LRW_WanCurvatureGuide is the WAN-friendly cousin that computes a similar distance/curvature stat without the Jacobian. This one is for image-model exploration.

Install

Part of comfyui-lrw-nodes by lajjadred, fronting his latent-riemannian-world package. ComfyUI Manager (search "comfyui-lrw-nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/lajjadred/comfyui-lrw-nodes
cd comfyui-lrw-nodes
pip install -r requirements.txt

Restart ComfyUI. Real deps: latent-riemannian-world >= 0.3.0, torch >= 2.4, Python 3.12+. The pack had early registration/import bugs that made nodes show as broken/UNKNOWN - git pull + full restart, single copy in custom_nodes. License is BSL-1.1.

Categorylrw/metric

Inputs (2)

NameTypeDefaultDescription
latentLATENT
metricMETRIC

Outputs (1)

NameTypeDescription
curvature_mapIMAGE