From 6fd4c6640c4dcdc963fffb53fbe74eafa0e64dcb Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 28 Dec 2025 01:27:18 +0200 Subject: [PATCH] Adjust scheduler graph drawing --- nodes_sampler.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nodes_sampler.py b/nodes_sampler.py index 57b73e8..d054b90 100644 --- a/nodes_sampler.py +++ b/nodes_sampler.py @@ -2777,8 +2777,13 @@ class WanVideoScheduler: handles, labels = ax.get_legend_handles_labels() if labels: ax.legend() - if start_idx < end_idx and 0 <= start_idx < len(sigmas_np) and 0 < end_idx < len(sigmas_np): - ax.axvspan(start_idx, end_idx, color='lightblue', alpha=0.1, label='Sampled Range') + # Draw shaded range + range_start_idx = start_idx if start_idx > 0 else 0 + range_end_idx = end_idx if end_idx > 0 and end_idx < len(sigmas_np) else len(sigmas_np) - 1 + if range_start_idx < range_end_idx: + ax.axvspan(range_start_idx, range_end_idx, color='lightblue', alpha=0.1, label='Sampled Range') + + plt.tight_layout() plt.savefig(buf, format='png') plt.close(fig)