ModelSamplingDiscrete (Ray)
The Sampling-Type Switch Every Distilled Workflow Needs
- ray_actors
- ray_actors
Here's the boring truth about "my model generates garbage" posts: half the time the model is fine and the sampling type is wrong. A checkpoint trained to predict v (velocity) gets fed a scheduler expecting epsilon (noise), and the result looks like it was generated by a model having a stroke. On vanilla ComfyUI, ModelSamplingDiscrete is the node you reach for; RayModelSamplingDiscrete is the same node wearing a distributed hat, patching the model on your Ray workers instead of in the main process.
It's a simple patch with one genuinely important dropdown and one checkbox:
sampling- the prediction type.eps(classic noise prediction, SD 1.5/SDXL territory),v_prediction(used by many modern and video models),lcm(for LCM-distilled checkpoints),x0, and the two img2img variants (img_to_img,img_to_img_flow). The rule of thumb: match what the model card or the original workflow says. When in doubt,epsfor SD-family,v_predictionfor anything that mentions "v-pred", andlcmfor LCM/Lightning-style distills.zsnr- zero-SNR. Flip this on when your v-prediction model produces washed-out, low-contrast images. It shifts the noise schedule so the model starts from a properly noisy state instead of a "zero" state that bleaches the output. It's a fix with a very specific symptom: pale, gray, low-contrast generations. If your images are oversaturated instead, this isn't your knob.
Both of these map 1:1 to the ComfyUI core node's behavior, so any guidance you've read about ModelSamplingDiscrete applies here. The only Raylight-specific part is the plumbing: it takes ray_actors in, emits ray_actors out, and the patch gets applied on every worker via the @ray_patch decorator.
Where you'll actually use it
This is the one you reach for with Wan in Raylight. Wan 2.x weights are v-prediction models, and the distilled variants especially are picky about their sampling setup. The KB's Wan notes are unambiguous: match the checkpoint's training, or expect mush. It slots in right after Ray Init Actor and before the Ray KSampler.
Install
Standard Raylight install - no extras beyond the pack itself:
cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt
Restart ComfyUI. Or search "raylight" in ComfyUI Manager.
Gotchas
- This node does not take a
MODEL. If you wire a model loader into it, nothing connects. It patches through theray_actorsstream - the model is already inside the Ray workers. - Don't stack it with a second sampling patch expecting them to compose nicely. A model can only have one sampling type; the last patch wins, and the ordering of two competing patches is a coin flip you don't want to debug.
- If you're on one GPU and just need
ModelSamplingDiscrete, use the built-in ComfyUI node. The Ray version exists because the model lives on workers; on a single card it's pure overhead.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| sampling | COMBO | 6 options: eps, v_prediction, lcm, x0, img_to_img, img_to_img_flow | |
| zsnr | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ray_actors | RAY_ACTORS | — |