Load Int From Image
Pull the Exact Integers Out of Any PNG
- image
- INT
That one perfect seed is buried inside a PNG, and you want it back. Load Int From Image digs integer values out of an image's embedded workflow metadata - seed, steps, resolution - and feeds them into your graph as a real INT.
It's part of comfyui-parse-image, shinich39's metadata-reading pack. Where its Float sibling handles decimals, this one handles whole numbers, and it's the seed-recovery workhorse of the family.
How it works
ComfyUI saves the generating workflow as JSON inside every output PNG's metadata. That's the mechanism behind drag-an-image-in-and-rebuild-your-graph, the feature the community treats as a basic right. This node reads that JSON, finds one widget by name, and returns its value. No pixel analysis, no models - it's pure bookkeeping.
The README's examples show exactly what to query:
KSampler.seed- the seed that produced the imageKSampler.steps- sampling stepsKSampler[1].seed- the second KSampler's seed, when a workflow has more than oneEmpty Latent Image.width/.height- the output resolution
That [INDEX] is the node's best trick. Most query formats here are <TITLE|TYPE|ID>.<WIDGET_NAME>, but when your image's workflow has two or three KSamplers, the first segment isn't enough. KSampler[1].seed picks the second one; [2] the third. It's the disambiguation you need the moment a workflow has a main pass and a hires fix.
Three inputs:
- image - from a supported loader:
LoadImage,LoadImageMask, Inspire'sLoadImage //Inspire, Crystools' "Load image with metadata", and others. - query - the dotted path, e.g.
KSampler.seedorKSampler[1].seed. - int - the fallback when nothing matches. Defaults to
0.
The output is a single INT, which wires straight into a KSampler's seed, an Empty Latent Image's width/height, or any other integer input.
Installing it
Pure utility, zero baggage: no model downloads, no extra dependencies. Install through ComfyUI Manager (search "comfyui-parse-image") or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/shinich39/comfyui-parse-image
Restart ComfyUI and look under Add node > loaders > Load Int From Image.
Common issues
The usual suspects apply: the fallback means your query didn't match, and a fallback of 0 is easy to mistake for a real seed. The [INDEX] form fails silently if you count the KSamplers wrong - the README's example implies the index follows the node's order in the workflow, so when in doubt, count them. And Empty Latent Image.width only resolves if that specific node is in the image's workflow - a lot of images are made with tiled or other latent setups that have no such widget. Finally, an image without embedded workflow data (stripped on export, or saved by a tool that doesn't embed it) has nothing to parse, and you get the fallback. Get the query right and it's the closest thing the pack has to reading an image's mind.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| query | STRING | — | |
| int | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |