Nodes/ComfyUI-Better-Flow/any to hash x2
ComfyUI Node

any to hash x2

One fingerprint from two inputs

By lokinou·Created 11 months ago·Updated 8 months ago· 2
any to hash x2
  • anything1
  • anything2
  • string

any to hash x2 is the two-input sibling of any to hash, and it exists for one practical reason: cache keys. A single-input hash answers "did this one thing change?" - which is rarely the question your workflow actually asks. You usually want to know "did both the image and the prompt change?", or "did the prompt and the seed change?", and that's a job for a combined fingerprint.

The mechanism is straightforward: it hashes each input the same way as the single version (tensors migrated to CPU first so image hashes are stable), then re-hashes the concatenation of the two MD5s. Because it's a hash of a hash, either input changing produces a completely different final digest - exactly what you want when the combined value feeds a cache key. The README's stated pairing: use this with Cache any so a cache entry is keyed on multiple inputs at once (their example: image + text).

Inputs and outputs

  • anything1 (required, any type) - first thing to fingerprint.
  • anything2 (required, any type) - second thing.
  • string (output, any type) - the 32-char MD5 hex digest of both.

Like its sibling it's an output node, and it writes the hash into its own widget so you can see the fingerprint on the canvas without squinting at wires. Both inputs are required - there's no "hash anything else, then one more" mode, so if you need three inputs you chain a second x2 node. Also inherits the family's limitations: None inputs raise, and tensor-typed objects beyond images can still hash inconsistently.

Install

It ships in lokinou/comfyui-better-flow alongside all the other nodes here. Via ComfyUI Manager, search "comfyui-better-flow", or:

cd ComfyUI/custom_nodes
git clone https://github.com/lokinou/comfyui-better-flow.git

Restart ComfyUI completely after cloning - a real restart, not Reload - so the node registers. No pip step, no model files, nothing extra; the pack is dependency-free.

Verdict

This is a utility node, and it doesn't try to be more. If you're already using Cache any with a multi-part key, it's the node that makes that workflow correct instead of accidentally wrong. If you're not caching, you probably don't need it - but keep it in mind for the day you start asking "did this actually change?" about two things at once.

Categoryworkflow

Inputs (2)

NameTypeDefaultDescription
anything1*
anything2*

Outputs (1)

NameTypeDescription
string*