Nodes/ComfyUI-Civitai-Metadata-Bridge/KSampler + Metadata Outputs
ComfyUI Node

KSampler + Metadata Outputs

A KSampler That Remembers What It Did

By Mikaelosa·Created a day ago·Updated about 23 hours ago· 0
KSampler + Metadata Outputs
  • model
  • positive
  • negative
  • latent_image
  • LATENT
  • seed
  • steps
  • cfg
  • sampler_name
  • scheduler
  • denoise
  • width
  • height
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00

Standard KSampler is great at sampling and terrible at telling you what it did. The values you set live in widgets - they're not exposed as outputs - so when you save metadata, you're either typing them by hand or hoping your saver node guessed right. Change a widget after you wire something up and your recorded settings silently drift from what actually ran. This node fixes that by doing the sampling and then handing you the proof.

It's a near-drop-in swap for the core KSampler, and "near" is doing a lot of reassuring work: underneath, it calls ComfyUI's own common_ksampler - the exact function the built-in node uses. Same sampler list (all 44), same 9 schedulers, same conditioning, same latent in and out. You're not getting a new sampling engine, you're getting a KSampler with a receipt.

What you wire

All the inputs are the standard KSampler set - model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise. Nothing exotic.

The outputs are where it earns its keep. LATENT continues on to VAE Decode exactly as before. Then:

  • seed, steps, cfg, denoise - the actual values used, as INT/FLOAT outputs.
  • sampler_name, scheduler - the names as strings.
  • width, height - inferred from the input latent, so they reflect the real denoised resolution (it accounts for each model family's latent scaling factor, not just the naive ×8).

Wire these into Image Saver Metadata - seedseed_value, stepssteps, cfgcfg, and so on down the README's mapping - and the saved metadata is guaranteed to match what the sampler actually consumed. That's the whole point: the embedded workflow in the PNG stays evidence of the setup, but the explicit values can't drift.

The one thing it can't do

It can't recover your prompt strings. KSampler receives already-encoded CONDITIONING, not text, so no node downstream of it can reconstruct what you typed. The fix is to pass the positive and negative prompt strings separately - once to CLIP Text Encode as usual, and once to Image Saver Metadata's positive / negative inputs. Slightly redundant, but that redundancy is what makes the metadata complete.

Installation

Search Civitai Metadata Bridge in ComfyUI-Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Mikaelosa/ComfyUI-Civitai-Metadata-Bridge

Then restart ComfyUI. The companion save node lives in alexopus/ComfyUI-Image-Saver; this pack adds no third-party Python dependencies of its own.

Gotchas

  • Don't forget the prompts. If your saved metadata has no prompt, this node isn't broken - that's the CONDITIONING limitation above. Feed the strings to the saver directly.
  • modelname socket missing? The README recommends connecting Civitai Model Selector's path to Load Checkpoint's ckpt_name and Image Saver Metadata's modelname, so the saver computes the checkpoint hash itself instead of trusting Civitai to infer the model. If modelname appears as a text widget, right-click it and convert it to an input. Same trick applies to additional_hashes if it shows up as a box.

If you save locally with SaveImage and never inspect metadata, this node is unnecessary overhead - but if you post to Civitai and care about your generations being attributed correctly, it's the rare "metadata plumbing" node that's actually pleasant to use. It just works, and it removes a whole class of "wait, that's not the seed I used" moments.

Categorymodel/sampling

Inputs (10)

NameTypeDefaultDescription
modelMODELThe model used for denoising the input latent.
seedINT00–18446744073709550000The random seed used for creating the noise.
stepsINT201–10000The number of denoising steps.
cfgFLOAT8.00–100Classifier-Free Guidance scale.
sampler_nameCOMBOThe sampler algorithm to use.
schedulerCOMBOThe scheduler used for sampling.
positiveCONDITIONINGThe positive conditioning.
negativeCONDITIONINGThe negative conditioning.
latent_imageLATENTThe latent image to denoise.
denoiseFLOAT1.000–1Amount of denoising applied.

Outputs (9)

NameTypeDescription
LATENTLATENTThe denoised latent.
seedINTThe seed used for sampling.
stepsINTThe number of steps used for sampling.
cfgFLOATThe CFG value used for sampling.
sampler_nameSTRINGThe sampler name used for sampling.
schedulerSTRINGThe scheduler name used for sampling.
denoiseFLOATThe denoise value used for sampling.
widthINTThe inferred image width from the latent.
heightINTThe inferred image height from the latent.