Files
kohya-ssandClaude Fable 5.1 9fefacba21 Fix the dpmsolver / dpmsingle samplers and give a clear error for lms without scipy
`get_my_scheduler` (sample image generation during training) failed for two
of the `--sample_sampler` choices with recent versions of diffusers:

- `dpmsolver`: diffusers rejects its default `final_sigmas_type="zero"` for
  the non-++ algorithm. Pass `final_sigmas_type="sigma_min"` for this case
  (`dpmsolver++` keeps the default, so its output is unchanged). The same
  fix is applied to `--sampler dpmsolver` of gen_img.py / sdxl_gen_img.py.
- `dpmsingle`: `DPMSolverSinglestepScheduler` has no `steps_offset`
  argument. Do not pass it, as gen_img.py already does.

`lms` / `k_lms` need scipy, which is not in requirements.txt. Instead of
failing at the first sample generation after the models are loaded, a new
`check_sampler_requirements` raises a clear ImportError (with the pip
command) at startup: in `verify_training_args` when `--sample_prompts` is
set, and at the top of `main` of gen_img.py / sdxl_gen_img.py.

tests/test_sampling_scheduler.py builds every sampler choice and checks the
new behavior. The other samplers were verified to be unchanged with the
local regression harness (tests/local, schedulers entry).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-24 18:27:07 +09:00
..
2024-12-02 13:51:57 -05:00

Tests

Install

pip install pytest

Usage

pytest

Contribution

Pytest is configured to run tests in this directory. It might be a good idea to add tests closer in the code, as well as doctests.

Tests are functions starting with test_ and files with the pattern test_*.py.

def test_x():
    assert 1 == 2, "Invalid test response"

Resources

pytest

PyTorch testing