Latent Palette Extractor π§¬
'Different Enough to Decode?' Now It's a Number
- latent
- signature
- similarity_to_input
- report
Every batch run has the same hidden waste: you sample ten seeds, and four of them are going to decode into images you've basically already seen. Latent Palette Extractor gives you a way to know that before you spend VAE time. Despite the name it's not really extracting a color palette - it's computing a signature of the latent's overall character, a fingerprint you can compare against another latent's fingerprint and get a similarity number out of. "Are these two seeds worth decoding, or are they the same picture in different clothes?" Now there's an answer, and it's a float.
How it works
For each channel, it computes three statistics across the spatial dimensions: the mean, the standard deviation, and the dominant-sign ratio (what fraction of values are positive). The whole batch reduces to one signature vector. Two latents with similar signatures tend to decode to compositionally similar images - similar brightness/contrast/structure balance. Very different signatures usually mean very different-looking results.
The comparison side is the part that makes it useful: paste a previously saved signature into compare_signature and it returns similarity_to_input, a 0β1 score between the current latent and that saved one. Save a signature from a look you liked, and you can filter a fresh batch for anything that scores close to it - or the opposite: flag anything too similar as a duplicate and skip the decode.
Inputs and outputs
- latent - in.
- compare_signature (optional) - a signature string from a past run.
- signature - the computed fingerprint, a string you can save or paste.
- similarity_to_input - the 0β1 comparison score (meaningless until you feed a reference signature).
- report - a text breakdown.
Where it fits
Two real jobs:
- Batch deduplication. Sample 20 seeds, extract signatures, and only decode the ones that are sufficiently different from each other. In a workflow that runs unattended overnight, that's VRAM and time saved on every run.
- Look matching. Get a seed you love, save its signature, and screen future batches against it - either to reproduce the vibe or to deliberately avoid it.
Honest caveats: it's a coarse fingerprint. Latents are far richer than three statistics per channel, so two latents with similar signatures can still decode to visibly different images, and two very different-looking images can share statistics. This node is a filter, not a judge - use it to prune obvious duplicates and spend your decodes on the survivors.
Install
Same as every OmniNodes node - pure NumPy/PyTorch, no extra deps:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart, find it under TensorVizion/Latent (ComfyUI Manager, search "OmniNodes", also works).
Troubleshooting
- similarity_to_input is always 0 or always 1. Check that
compare_signatureactually contains a saved signature - an empty field compares against nothing and the number is meaningless. Signatures must come from the same latent format to compare fairly. - It says two identical-seeming images are dissimilar. The signature catches overall balance, not content. If you need real content comparison, this isn't the tool - it's a cheap pre-filter.
- The name made you expect colors. Common confusion; the pack's palette-related tooling is about latent character, not a hex list. If you genuinely want a color palette from the decoded image, that's a pixel-space job.
It's a quiet, unglamorous node, and that's fine - the value is in the batch workflows where it quietly saves you from decoding twenty near-identical images. For anyone running seed sweeps at scale, it earns its place in the graph.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | β | |
| compare_signatureopt | STRING | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| signature | STRING | β |
| similarity_to_input | FLOAT | β |
| report | STRING | β |