VQ Fréchet Inception Distance (FID)
FID is the number every image-model paper still leads with — now it runs in your graph
- images_generated
- images_reference
- fid
- summary
If you've read any image-generation paper since 2017, you've seen FID quoted in the abstract. It's the Fréchet Inception Distance, and it's the standard way to say "my generated images are statistically close to my real ones." This node brings that same measurement into your ComfyUI graph so you can evaluate your outputs without leaving the workflow.
Where the full-reference nodes (PSNR, SSIM) compare one image to one reference, FID is a distribution metric: it compares a whole batch of generated images against a whole batch of references, and scores how far apart the two populations are. Lower is better; zero means identical distributions. You reach for it when you want to know whether workflow A produces images that are statistically more "real-looking" than workflow B - the classic benchmark scenario.
How it works
Both batches get run through Inception V3 (pretrained on ImageNet, weights auto-downloaded on first use) and each image becomes a 2048-dimensional feature vector. The node fits a Gaussian to each batch's features, then computes the Fréchet distance between the two Gaussians - a combination of the gap between the means and a covariance term. Small distances mean the generated and reference batches overlap in feature space; large ones mean your model is drifting away from the real distribution.
Inputs and outputs
Required:
images_generated(IMAGE) - your outputs.images_reference(IMAGE) - the ground-truth set.
Both are standard [N, H, W, 3] image batches. No optional inputs.
Outputs:
fid(FLOAT) - the distance. Lower is better.summary(STRING) - report including sample counts. The sample counts matter; read them.
Calibration from the pack: under 10 is near-photorealistic, 10–30 very good, 30–100 fair-to-good for generative work, over 100 you're in trouble.
Installing
Part of ComfyUI-VideoQuality-Metrics, installed once:
cd ComfyUI/custom_nodes
git clone https://github.com/jajos12/ComfyUI-VideoQuality-Metrics
pip install -r ComfyUI-VideoQuality-Metrics/requirements.txt
Restart ComfyUI; the node sits under VideoQuality/Distributional. Manager can install the pack if you search "VideoQuality Metrics".
Common issues
- The number is meaningless with small batches. FID needs a real sample size - think hundreds of images - to estimate covariance properly. Feed it 50 frames from a video and you're measuring noise, not quality. With a single image per side the implementation falls back to an identity covariance, so the result degenerates into a squared feature-mean difference that won't match any published FID number.
- First run downloads Inception V3 weights (~100 MB). Let it finish.
- Don't compare FID across different reference sets. It's only meaningful within a comparison, not as an absolute score. This is why the node's summary prints the sample counts - check that your two batches actually match in size and content.
- FID favors photorealistic outputs. It's trained on ImageNet, so an anime-style batch will score worse against a photo reference even if it's "good" anime. Compare like with like.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images_generated | IMAGE | — | |
| images_reference | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| fid | FLOAT | — |
| summary | STRING | — |