Skip to content

Stability-AI/ReSWD

Repository files navigation

ReSWD: ReSTIR‘d, not shaken. Combining Reservoir Sampling and Sliced Wasserstein Distance for Variance Reduction.

This is the official codebase for ReSWD, a state-of-the-art algorithm for distribution matching with reduced variance. It has several applications (such as diffusion guidance or color matching).

Installation

The project uses uv for package management. Install it via pip install uv if not installed.

Then run

uv sync

Running

We support a CLI and gradio demo. The cli can be run with:

uv run -m src

It will then guide you through the different modes

The gradio demo can be executed with

uv run -m src.gradio_demo

Evaluation data for color matching

In example/test_frames_with_color_patches we have uploaded the test frames, including the mean swatch values from a color checker for error calculations.

Citation

@article{boss2025reswd,
  title={ReSWD: ReSTIR‘d, not shaken. Combining Reservoir Sampling and Sliced Wasserstein Distance for Variance Reduction.},
  author={Boss, Mark and Engelhardt, Andreas and Donné, Simon and Jampani, Varun},
  journal={arXiv preprint},
  year={2025}
}

About

Variance reduction for Sliced Wasserstein Distance using Reservoir Sampling.

Resources

License

Stars

Watchers

Forks

Languages