TwinFlow Sampler
TwinFlow's sampler, for people who build their own chain
- SAMPLER
The TwinFlow Sampler is the modular route to the same one-/few-step magic the TwinFlow KSampler bundles up. Instead of an all-in-one box, it emits just a SAMPLER object - the exact type the standard SamplerCustom node accepts - so you assemble the chain yourself: this node for the sampler, the TwinFlow Scheduler for the SIGMAS, a SamplerCustom in the middle, and every step visible in the graph.
It exists for two reasons. First, modularity - the same reason anyone reaches for SamplerCustom over a KSampler. Second, honesty about the mechanism: TwinFlow's sampling isn't the stock sampler logic. It solves a rectified-flow ODE with a target-timestep twist, and that twist is exactly what makes the distilled model behave. A stock sampler won't do it; this node is how you bolt it into a custom chain.
How it works
This pack reimplements TwinFlow's sampling to ComfyUI's spec rather than vendoring the reference implementation, so the node plugs into anything that accepts a SAMPLER. Internally it:
- runs euler (1st order) or heun (2nd order) on the flow,
- mixes fresh noise into each step according to stochast_ratio (1.0 = fully stochastic, 0.0 = deterministic ODE),
- applies extrapol_ratio to extrapolate the reconstruction (off at 0.0),
- and uses sampling_style to choose what timestep the model aims at:
fewtargets the fully-denoised endpoint every step (the 2-4 step mode),anytargets the next step (flexible counts),mulkeeps the current step as its target (multi-step).
All of it runs through comfy.samplers.KSAMPLER, so it works anywhere a SAMPLER is expected - not just SamplerCustom.
The inputs that matter
There are only four, which is the whole appeal:
- sampling_style -
few/any/mul. Start withfewif you're chasing speed. - sampling_method -
euler(default) orheun. - stochast_ratio - default 1.0; the noise-mixing dial.
- extrapol_ratio - default 0.0; leave it unless you're experimenting.
Output is a single SAMPLER. Wire it up like this:
TwinFlowScheduler (SIGMAS) ──▶ SamplerCustom
TwinFlowSampler (SAMPLER) ──▶ SamplerCustom
Feed the patched model and conditioning into SamplerCustom like any custom-sampling chain. Install is the standard pack route - ComfyUI Manager, search "TwinFlow", or:
cd ComfyUI/custom_nodes
git clone https://github.com/mengqin/ComfyUI-TwinFlow.git
pip install -r requirements.txt
When it goes wrong
- Wrong look entirely - if you're feeding a patched TwinFlow model into a stock Euler or DDIM sampler instead of this node, stop. The target-timestep conditioning never gets set, and you're just running the base model awkwardly.
- Chain misses a piece -
SamplerCustomneeds SIGMAS from the TwinFlow Scheduler, not a stock scheduler. The stock ones assume a different schedule and produce garbage at 2-4 steps. - Model unpatched - no sampler fixes a model that wasn't patched first. TwinFlow Model Patcher, then this, in that order.
If you just want an image without assembling a chain, the TwinFlow KSampler does all of this internally. Reach for this node when you want control, or plan to reuse the sampler in a bigger custom pipeline.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| sampling_method | COMBO | euler | 2 options: euler, heun |
| stochast_ratio | FLOAT | 1.000–1 | — |
| extrapol_ratio | FLOAT | 0.000–1 | — |
| sampling_style | COMBO | few | 3 options: few, any, mul |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAMPLER | SAMPLER | — |