FlowMatch Euler Discrete Scheduler (Custom)
The Z-Image scheduler ComfyUI forgot to ship
- sigmas
If you're running Z-Image Turbo and your 9-step outputs come out a touch soft or noisy, this is the node the author built to fix exactly that. The pitch on the pack is blunt: "9 steps, big res, zero noise." The reason it exists is smaller than it sounds - ComfyUI ships a long list of schedulers, but not FlowMatchEulerDiscrete, which happens to be the exact scheduler the official Z-Image diffusers demo runs. erosDiffusion just wired the diffusers one into ComfyUI so you can actually use it.
The pack does that two ways. It registers a plain FlowMatchEulerDiscreteScheduler entry in the KSampler dropdown - pick it, run, done. And it gives you this node, the Custom one, which exposes every parameter of the diffusers scheduler and outputs SIGMAS for the SamplerCustom node. This is the tinkerer's path: more knobs, more rope.
How it works
Z-Image, Flux, Chroma, Qwen-Image - everything since SD3 - are flow-matching (rectified-flow) models. Instead of predicting the noise on a curved trajectory the SD 1.5 way, they learn a near-straight line from noise to image. That single property is why they run in 4-9 steps instead of 20-50, and it's also why old scheduler habits break on them: there's very little for a clever noise curve to correct, and a lot for it to distort.
A scheduler's whole job is to hand the sampler the list of noise levels - the sigmas - to walk through. This node builds that list the diffusers way, matched to how Z-Image was actually demoed, rather than approximating it with a stock ComfyUI schedule. Feed the sigmas to a SamplerCustom running Euler and you get the model's intended sampling path.
The inputs and outputs that matter
Everything is a widget here - there are no conditioning sockets, just numbers going in and one SIGMAS output going out. The few that earn your attention:
- steps - defaults to 9, which is the Z-Image Turbo home range. More isn't better on a distilled model; past ~9 you usually lose quality, not gain it.
- shift - defaults to 3, and this is the lever that matters most. It's the same timestep-shift idea as ModelSamplingAuraFlow: it decides how sampling effort splits between composition and fine detail. It's model-specific, and the community consensus for Z-Image Turbo is that it wants a higher value than ComfyUI's default of 3 - people land around 7. If your images look soft, raise this before touching anything else.
- start_at_step / end_at_step - trim the schedule to a slice. Added so you can drive image-to-image or restart/refine passes off a partial sigma list instead of the full one.
The rest - use_dynamic_shifting with its base_shift/max_shift/base_image_seq_len/max_image_seq_len companions, num_train_timesteps, time_shift_type, shift_terminal, invert_sigmas, stochastic_sampling, device (leave on auto) - are faithful mirrors of the diffusers config. You can safely ignore them until you have a specific reason not to.
Wire the sigmas output into SamplerCustom's sigmas input, pair it with an Euler sampler, and you've replaced the built-in scheduler entirely.
Installing it
Two ways. In ComfyUI Manager, search erosDiffusion (or ComfyUI-EulerFlowMatchingDiscreteScheduler), install, restart. Or from a terminal: cd ComfyUI/custom_nodes && git clone https://github.com/erosDiffusion/ComfyUI-EulerDiscreteScheduler.git, then restart ComfyUI. No model files to download - it's a scheduler, not a checkpoint.
Where people get burned
- Don't flip the karras or exponential sigma switches. The node exposes
use_karras_sigmasanduse_exponential_sigmasbecause diffusers does - but on flow-matching models those two are universal failures, not just weaker choices. The biggest sampler sweep in the community (62 samplers, 16 schedulers on Z-Image Turbo) found them breaking across the board. Leave them disabled.use_beta_sigmasis the one that's actually safe to experiment with. - The scheduler vanishes when RES4LYF is installed. This is the pack's best-known conflict, and RES4LYF is everywhere these days, so it hits a lot of people. The plain KSampler entry stops appearing in the dropdown. Cleanest fix: just use this Custom node into SamplerCustom, which sidesteps the dropdown entirely. Otherwise the README suggests wiring a BasicScheduler through a SamplerCustom, or disabling RES4LYF if you don't need it. The 1.0.8 update tried to patch the collision directly.
- Install fails on
peft. A few users hit a version mismatch on thepeftpackage at startup. Check your ComfyUI startup log and pin the version it asks for.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| steps | INT | 91–10000 | Total number of diffusion steps to generate the full sigma schedule. |
| start_at_step | INT | 00–10000 | The starting step (index) of the sigma schedule to use. Set to 0 to start at the beginning (first step). |
| end_at_step | INT | 99990–10000 | The ending step (index) of the sigma schedule to use. Set higher than 'steps' to use all steps. |
| base_image_seq_len | INT | 256 | Base sequence length for dynamic shifting. Should match model's training resolution (e.g., 256 for 512x512 images). |
| base_shift | FLOAT | 0.50 | Stabilizes generation. Higher values = more consistent/predictable outputs. Z-Image-Turbo uses default 0.5. |
| invert_sigmas | COMBO | disable | Reverses the sigma schedule. Keep disabled unless experimenting with advanced techniques. |
| max_image_seq_len | INT | 8192 | Maximum sequence length for dynamic shifting. Affects how the scheduler adapts to large images. |
| max_shift | FLOAT | 1.15 | Maximum variation allowed. Higher = more exaggerated/stylized results. Z-Image-Turbo uses default 1.15. |
| num_train_timesteps | INT | 1000 | Timesteps the model was trained with. Should match your model's config (typically 1000). |
| shift | FLOAT | 3.00 | Global timestep schedule shift. Z-Image-Turbo uses 3.0 for optimal performance with the Turbo model. |
| shift_terminal | FLOAT | 0.00 | End value for shifted schedule. Set to 0.0 to disable. Advanced parameter for timestep schedule control. |
| stochastic_sampling | COMBO | disable | Adds controlled randomness to each step. Enable for more varied outputs (similar to ancestral samplers). |
| time_shift_type | COMBO | exponential | Method for resolution-dependent shifting. Use 'exponential' for most cases, 'linear' for experiments. |
| use_beta_sigmas | COMBO | disable | Uses beta distribution for sigmas. Experimental alternative noise schedule. |
| use_dynamic_shifting | COMBO | disable | Auto-adjusts timesteps based on image resolution. Z-Image-Turbo disables this for consistent Turbo performance. |
| use_exponential_sigmas | COMBO | disable | Uses exponential sigma spacing. Try enabling for different noise distribution characteristics. |
| use_karras_sigmas | COMBO | disable | Uses Karras noise schedule for smoother results. Similar to DPM++ samplers, often improves quality. |
| device | COMBO | auto | Device for sigma computation. 'auto' detects GPU if available, otherwise CPU. Using GPU avoids CPU->GPU transfers. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sigmas | SIGMAS | — |