ModelSamplingFlux (Ray)
Shift the Schedule, Save Your Flux Runs
- ray_actors
- ray_actors
Flux runs on a straight-line (flow matching) trajectory, and that's mostly great - fewer steps, no need for clever schedulers. But it introduces a new knob you don't have on SD: shift. Shift controls how sampling effort is distributed across the denoising trajectory - high shift spends more steps on structure and composition early, low shift favors the detail-end. Get it wrong and Flux either blows out early structure or never lands the fine texture. RayModelSamplingFlux is the Flux-specific shift patch, applied to the model on your Raylight workers.
The inputs are the ones you know from ComfyUI's own Flux sampling node:
max_shift(default 1.15) andbase_shift(default 0.5) - the two ends of the shift curve. The model interpolates between them based on how many tokens you're feeding it.widthandheight(default 1024 × 1024) - this is the part people forget. The shift is resolution-aware: bigger images have more tokens, so the schedule stretches. If your workflow generates at 768×512 and you leave width/height at 1024, the shift is computed for the wrong token count and the schedule is subtly off. Set them to match the actual generation resolution.
That last point is the one that burns people. The node has no idea what resolution your KSampler will use - it's a patch, not a watcher - so if you change resolution, change these numbers too. It's the distributed port of ModelSamplingFlux; everything that node does on a single GPU, this does on every Ray worker via the ray_actors stream.
Where it fits
Chain it right after Ray Init Actor and before your Ray KSampler, in any Flux workflow (dev, kontext, krea - all covered in the Raylight README's supported-models table). Flux runs at CFG 1 with its baked-in guidance, so don't pair this with a CFG-raising node expecting more adherence; it won't cooperate. If you're fighting undercooked or overcooked Flux generations on a single GPU, ComfyUI's built-in node is the same medicine without the Ray plumbing.
Install
Nothing special - this is part of raylight:
cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt
Restart, or install via ComfyUI Manager ("raylight").
Gotchas
The width/height trap is the whole story here. If your Flux output looks structurally off after you changed resolution, nine times out of ten it's the stale shift values. The defaults are tuned for 1024×1024 - which is also why they're the defaults. Change one, change the other. And remember: no Ray Init Actor upstream, no patch. This is a worker-side node; on a normal single-GPU graph it's the wrong tool entirely.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| max_shift | FLOAT | 1.150–100 | — |
| base_shift | FLOAT | 0.500–100 | — |
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ray_actors | RAY_ACTORS | — |