FluxSampler (Mango)
A Flux sampler that writes its own receipt
- model
- conditioning
- lora_stack
- latent_image
- output
- METADATA
- METADATA_TEXT
Sampling is the part of the graph that actually generates pixels, and FluxSampler (Mango) is a sampler built for people who care what they generated with. On the surface it's a Flux-aware KSampler: model in, conditioning in, latent in, latent out. But it also compiles metadata as it samples - seed, steps, sampler, scheduler, guidance, prompt, model, and every LoRA hash - and hands it to you as a structured object plus a ready-to-save text block. That's the entire point of the Mango pack: generate, and get the receipt at the same time.
If you only save with the stock Save Image node, most of this is wasted on you. If you wire the output into Image Saver (Mango), you get Civitai-compatible metadata embedded in every PNG you save, automatically and correctly.
How it works
Mechanically it's a standard ComfyUI sampling call: it builds a CFG guider (with guidance coming in via the conditioning, Flux-style - no negative prompt in the usual sense, since Flux is guidance-distilled), computes sigmas from your sampler/scheduler/steps/denoise, generates noise from the seed, and runs the sampler with a live-preview callback. The Flux-specific bits are the flux_guidance value and a reuse_noise toggle: when enabled, the node remembers the last noise tensor it generated and reuses it instead of making a new one, which is handy for exploring different prompts or samplers on literally the same noise.
While it samples, it builds a metadata dict: Seed, Steps, Sampler, Scheduler, Denoise, CFG scale (which is your flux guidance), Model + Model hash (from the unet_name/unet_hash you feed in), Positive prompt (from the prompt_text field - note there's no negative prompt field, because Flux doesn't use one), and Lora hashes parsed from the LoRA stack. It also folds in your full workflow JSON, truncated to keep it sane.
Inputs and outputs that matter
The ones you'll actually touch:
- model - from a Mango loader (or any Flux-capable loader).
- conditioning - from FluxGuidance (Mango); that's where guidance lives.
- flux_guidance - FLOAT, default 3.5. Same debate as everywhere else in Flux: many people run 1.8–2.0 for less over-stylized faces.
- latent_image - from Latent Image (Mango) or an empty-latent node.
- steps / denoise / sampler_name / scheduler - the usual dials. Flux's community baseline is euler + normal/simple at 20–30 steps.
- prompt_text - the prompt string, recorded verbatim into metadata. Feed it from your Prompt (Mango) node's STRING output.
- unet_name / unet_hash - STRING inputs, typically from CompositeMangoLoader, that make the "Model" line in your metadata truthful.
- noise_seed / reuse_noise - seed control, plus the noise-reuse toggle above.
Outputs: output (LATENT) goes to your VAE decoder; METADATA (a dict) and METADATA_TEXT (a JSON string) go to Image Saver (Mango).
Installing it
It's in 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.
Gotchas
The biggest trap is thinking the prompt_text field affects the image. It does not - it's only for metadata. The actual prompt is whatever your conditioning was built from, so if you change the prompt upstream and forget to update prompt_text, your saved metadata will lie about what you used. Also, this node expects the guidance to already be stamped into the conditioning (via FluxGuidance), so don't wire a plain text-encode output and expect the guidance value to do anything. And if you want a negative prompt on Flux, you can't get one here - that's a Flux-model limitation, not a node bug.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| conditioning | CONDITIONING | — | |
| flux_guidance | FLOAT | 3.50–100 | — |
| lora_stack | LORA_STACK | — | |
| latent_image | LATENT | — | |
| prompt_text | STRING | — | |
| unet_name | STRING | UNET/Checkpoint name | |
| unet_hash | STRING | UNET hash from CompositeMangoLoader | |
| noise_seed | INT | 12340–18446744073709550000 | — |
| reuse_noise | BOOLEAN | false | — |
| 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 | |
| steps | INT | 201–10000 | — |
| denoise | FLOAT | 1.000–1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| METADATA | METADATA | — |
| METADATA_TEXT | STRING | — |