From ec408a29666ee884dba9bfd22ff56f2f1dd60d61 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 16:43:33 +0000 Subject: [PATCH] Turbo sampler: polish step is on by default at 0.25 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Tw9fjUCoaPNZ8uLoL2xACR --- modules/sampling/turbo/__init__.py | 6 +++--- modules/sampling/turbo/tests/test_turbo.py | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/sampling/turbo/__init__.py b/modules/sampling/turbo/__init__.py index 290c0f9c..8f1d20d8 100644 --- a/modules/sampling/turbo/__init__.py +++ b/modules/sampling/turbo/__init__.py @@ -12,7 +12,7 @@ flow step that has three dials: stage, because a Two stages hand-over changes the size. * Step spacing per stage: the steps inside a stage are moved earlier or later while the stage's first and last sigma stay put, so the hand-over point never moves. 1 = the schedule as given. -* Polish step (optional): after the last step, noise the finished picture back to a small sigma and let the +* Polish step (on by default at 0.25): after the last step, noise the finished picture back to a small sigma and let the model answer once more at full size. One extra model call, in the last stage only. The sound is stepped without fresh noise and without second order. Samplers that call the model twice per @@ -78,9 +78,9 @@ SETTINGS = { "when": {"enabled": True}, }, "polish": { - "type": "float", "default": 0.0, "min": 0.0, "max": 0.6, "step": 0.01, + "type": "float", "default": 0.25, "min": 0.0, "max": 0.6, "step": 0.01, "label": "Polish step sigma", "ui": "slider", - "hint": "0 = off. Otherwise one extra full-size model call after the last step, from this small noise " + "hint": "0 = off. Default 0.25. Otherwise one extra full-size model call after the last step, from this small noise " "level. Costs one step (about 15 to 25% of a run). Around 0.25 to 0.3 has given more natural motion on a rental.", "when": {"enabled": True}, }, diff --git a/modules/sampling/turbo/tests/test_turbo.py b/modules/sampling/turbo/tests/test_turbo.py index 1261bfb8..2eb10da0 100644 --- a/modules/sampling/turbo/tests/test_turbo.py +++ b/modules/sampling/turbo/tests/test_turbo.py @@ -147,7 +147,7 @@ def test_runs_through_two_stages_with_any_split(model, sigmas, cut): def test_without_two_stages_and_without_polish(model): - values = {"enabled": True, **_settings()} + values = {"enabled": True, **_settings(polish=0.0)} _, out, calls = _guided(model, values, (1.0, 0.7, 0.3, 0.0)) assert len(calls) == 3 and torch.isfinite(out.unbind()[0]).all() @@ -167,3 +167,9 @@ def test_registered_in_comfys_lists_and_runs_like_the_module(model): latent = NestedTensor((torch.zeros(1, 24, 2, 8, 8), torch.zeros(1, 32, 2, 3))) out = guider.sample(noise, latent, comfy.samplers.sampler_object("funui_turbo"), sigmas, seed=1, disable_pbar=True) assert torch.isfinite(out.unbind()[0]).all() + + +def test_polish_is_on_by_default_at_a_quarter(model): + assert SETTINGS["polish"]["default"] == 0.25 + _, _, calls = _guided(model, {"enabled": True, **_settings()}, (1.0, 0.7, 0.3, 0.0)) + assert len(calls) == 4 and calls[-1] == pytest.approx(0.25)