Nodes/Mango Node Pack/FluxSampler (Mango)
ComfyUI Node

FluxSampler (Mango)

A Flux sampler that writes its own receipt

By mang01010·Created about a year ago·Updated 4 months ago· 3
FluxSampler (Mango)
  • model
  • conditioning
  • lora_stack
  • latent_image
  • output
  • METADATA
  • METADATA_TEXT
flux_guidance3.5
prompt_text
unet_name
unet_hash
noise_seed1234
reuse_noisefalse
sampler_name
scheduler
steps20
denoise1.00

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.

CategoryMango Node Pack/Sampling

Inputs (14)

NameTypeDefaultDescription
modelMODEL
conditioningCONDITIONING
flux_guidanceFLOAT3.50–100
lora_stackLORA_STACK
latent_imageLATENT
prompt_textSTRING
unet_nameSTRINGUNET/Checkpoint name
unet_hashSTRINGUNET hash from CompositeMangoLoader
noise_seedINT12340–18446744073709550000
reuse_noiseBOOLEANfalse
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
stepsINT201–10000
denoiseFLOAT1.000–1

Outputs (3)

NameTypeDescription
outputLATENT
METADATAMETADATA
METADATA_TEXTSTRING