KSampler (Mango)
The stock KSampler, but it takes notes for you
- model
- latent_image
- positive
- negative
- lora_stack
- LATENT
- METADATA
- METADATA_TEXT
KSampler (Mango) is the workhorse of the pack and the easiest way to understand what all these nodes are doing. It's a drop-in replacement for the stock KSampler - same model, latent, positive/negative, seed, steps, CFG, sampler, scheduler, denoise inputs - with two additions that matter. First, it supports live preview and cancellation, so you can watch images form and hit stop mid-batch without killing ComfyUI. Second, it compiles a metadata object as it samples: seed, CFG, sampler, scheduler, steps, denoise, model name and hash, the full prompt text, and every LoRA hash in your stack. That METADATA output is what Image Saver (Mango) turns into a Civitai-compatible PNG.
For a beginner this node's superpower is the reuse_seed toggle and the extra text fields. Everything you'd normally have to retype or reconstruct after the fact - "what sampler was that again?" - is captured automatically.
How it works
Under the hood it calls the same comfy.sample.sample function the stock KSampler uses, with the same CFG-based guider (so yes, this one does take a negative prompt - it's the SD/SDXL path, not the Flux path). The additions are bookkeeping around the edges: a reuse_seed flag that makes the node remember the last seed it used so a re-run keeps the same noise even if you hit "queue" twice, a cancellation check before starting, and a metadata build step that pulls together everything the node knows about the run.
Inputs and outputs that matter
The familiar sampling inputs are all there - model, latent_image, seed, steps, cfg, sampler_name, scheduler, denoise, positive, negative - and the defaults are the stock ones (20 steps, CFG 7, euler). The Mango-specific additions:
- reuse_seed - keep the previous seed on re-runs. Great for tweaking the sampler or steps without the image jumping around.
- positive_prompt_text / negative_prompt_text - plain text fields that get recorded into metadata. Like FluxSampler's
prompt_text, these do not affect the image; they exist so the receipt records what you actually wrote. - ckpt_name - a text field for the checkpoint name, typically wired from the
ckpt_nameoutput of Loader (Mango). - lora_stack - wire the loader's
lora_stackhere so the metadata logs every LoRA and its hash.
Outputs: LATENT (to your VAE decoder), METADATA (the dict), and METADATA_TEXT (a JSON string) - the last two feed Image Saver (Mango).
Installing it
KSampler (Mango) is part of the Mango Node Pack:
cd ComfyUI/custom_nodes
git clone https://github.com/mang01010/MangoNodePack
Restart ComfyUI, or search "Mango Node Pack" in ComfyUI Manager. The README lists pip install safetensors as the only extra dependency, and stock ComfyUI already has it.
Gotchas
The same trap as its Flux sibling: the prompt text fields are metadata-only. If you edit your positive conditioning upstream but leave positive_prompt_text stale, your saved images will carry the wrong prompt. Some users find the node slightly slower than stock because of the metadata hashing work on large checkpoint files - it's a short one-time stream, not a big deal on SSD. And remember this is the CFG-based sampler; for Flux models you want FluxSampler (Mango) and FluxGuidance instead. If you want "stock KSampler behavior but with a paper trail," this is the one.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| latent_image | LATENT | Latent to sample from | |
| seed | INT | 00–18446744073709550000 | — |
| reuse_seed | BOOLEAN | false | — |
| steps | INT | 201–200 | — |
| cfg | FLOAT | 7.000–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 1.000–1 | — |
| positive | CONDITIONING | Positive conditioning tensor | |
| negative | CONDITIONING | Negative conditioning tensor | |
| positive_prompt_text | STRING | — | |
| negative_prompt_text | STRING | — | |
| ckpt_name | STRING | Checkpoint name (from MangoLoader) | |
| lora_stack | LORA_STACK | Optional LoRA stack (from MangoLoader) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| METADATA | METADATA | — |
| METADATA_TEXT | STRING | — |