Image & Video

Flux2Klein Ksampler Soon!

Developer's custom sampler eliminates gray washout in AI image renders by correcting a core mathematical error.

Deep Dive

A developer known as Capitan01R has released a custom Ksampler for the Flux2Klein AI image generation model, directly addressing a widespread issue of color desaturation and 'gray washout' in renders created through ComfyUI. The core problem was traced to an incorrect mathematical formula in the default sampling process. The flawed equation, x_new = x + dt * (x + v), was found to introduce a color-drift error at every denoising step. The new Ksampler implements the correct raw formula, x_new = x + dt * v, which uses a clean velocity update to preserve color integrity.

Beyond the core formula fix, the developer identified that ComfyUI's default sampling path includes extra internal transforms for sigma handling and latent normalization. These stabilizing layers, while intended for consistency, cumulatively bias the image trajectory toward lower variance, manifesting as visual desaturation. The new Ksampler strips out these extra transforms, keeping the update path direct. Additionally, it employs a custom timestep schedule dependent on image size, which further improves color stability across the denoising process. Benchmarked against the standard ModelSamplingFlux, the new sampler reportedly wins every time, delivering accurate colors with zero washout.

Key Points
  • Fixes a flawed ODE formula (x_new = x + dt * (x + v)) that caused color drift at every denoising step.
  • Eliminates extra stabilizing transforms in ComfyUI's default sampler that cumulatively desaturate images.
  • Uses a custom image-size-dependent timestep schedule for improved color stability across the generation process.

Why It Matters

This fix is crucial for AI artists and professionals who rely on accurate color output for commercial and creative work, eliminating a major quality barrier.