Custom nodes to make ComfyUI sampling closer to ai-toolkit flow-matching behavior for Flux, Qwen-Image, and Z-Image.
- This custom node has a
requirements.txtand needs:- ai-toolkit-matched
diffuserspinned to commit8600b4c10d67b0ce200f664204358747bd53c775
- ai-toolkit-matched
- If you install manually, run in your ComfyUI Python environment:
pip install -r custom_nodes/ComfyUI-FlowMatch-Advanced/requirements.txt
FlowMatch Sampler (ai-toolkit exact)
Single all-in-one sampler node: patches model sampling, builds ai-toolkit flowmatch sigmas, and runs sampling directly.
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)
- Load your model and LoRA.
- Use
FlowMatch Sampler (ai-toolkit exact):sampler_name=euler(orres_multistepif your training setup uses it)- defaults match this repo's
config.yamlsample block (model_type=z-image,seed=42,steps=8,guidance_scale=1,width=768,height=1024) - switch
model_typeonly when sampling non Z-Image models width/heightmust match your generation resolution
- Decode the returned latent with VAE.
- This node is the only supported path in this repo.
force_aitk_timesteps=trueuses1.0 -> 1.0/stepstimesteps before shift math, matching ai-toolkit behavior more closely.- When available, the node attempts to use ai-toolkit's own scheduler backend first and falls back to local formulas automatically.