deaed13f0dabc981c042c3ca15b12438f57dab6e
ComfyUI-FlowMatch-Advanced
Custom nodes to make ComfyUI sampling closer to ai-toolkit flow-matching behavior for Flux, Qwen-Image, and Z-Image.
Nodes
FlowMatch Sigmas (ai-toolkit style)
OutputsSIGMASforSamplerCustomAdvancedusing ai-toolkit-style formulas and defaults.DiT FlowMatch Model (ai-toolkit style)
Patchesmodel_samplingwith a real Comfy sampling object (Comfy-native patching), not a callback.
Model Presets
flux: dynamic shift (base_shift=0.5,max_shift=1.15,max_seq_len=4096)qwen: dynamic shift (base_shift=0.5,max_shift=0.9,max_seq_len=8192)z-image: static shift (shift=3.0)
Recommended Workflow (Closest to ai-toolkit)
- Load your model and LoRA.
- Use
DiT FlowMatch Model (ai-toolkit style)on the model (setmodel_type=autounless needed). - Use
FlowMatch Sigmas (ai-toolkit style)to generateSIGMAS. - Run
SamplerCustomAdvanced:- sampler:
euler(orres_multistepif that is your trained setup) - sigmas: from
FlowMatch Sigmas (ai-toolkit style) - guider:
CFGGuider(typicallycfg=1.0for flow models)
- sampler:
- Decode with VAE.
Notes
- This is designed for the
SamplerCustomAdvancedpath.
KSamplercannot directly inject this exact custom sigma schedule. force_aitk_timesteps=trueuses1.0 -> 1.0/stepstimesteps before shift math, matching ai-toolkit behavior more closely.- Default
steps=25is set for closer ai-toolkit-style sample quality (you can still drop to 20 for faster Flux previews).
Languages
Python
88.9%
Shell
11.1%