@@ -2586,7 +2586,7 @@ static sd::Tensor<float> sample_lms(denoise_cb_t model,
25862586 // modified with "history shift" value, which seemingly needs less steps
25872587 int divisions = 1000 ;
25882588 int max_order = 4 ;
2589- int shift = 1 ; // 4, 0 - original; 4, 1 - PR #1843; 3, 1 - smoother image
2589+ int shift = 1 ; // 4, 0 - original; 4, 1 - PR #1843; 3, 1 - smoother image
25902590 for (const auto & [key, value] : extra_sample_args) {
25912591 int parsed = 0 ;
25922592 if (key == " lms_max_order" ) {
@@ -2624,7 +2624,7 @@ static sd::Tensor<float> sample_lms(denoise_cb_t model,
26242624 auto linear_multistep_coeff = [=](const int order, const int m, const int j) -> float {
26252625 if (!divisions)
26262626 return sigmas[m + 1 ] - sigmas[m]; // delta / 0 * 0
2627- #define LMS_PRECISION float // when divisions > 30 millions, the double precision fixes noise
2627+ #define LMS_PRECISION float // when divisions > 30 millions, the double precision fixes noise
26282628 const LMS_PRECISION a = sigmas[m], dx = (sigmas[m + 1 ] - a) / divisions, s = sigmas[m - j];
26292629 const LMS_PRECISION b0 = a + 0 .5f * dx; // using Riemann middle integral
26302630 LMS_PRECISION sum = 0 .0f ;
@@ -2672,8 +2672,8 @@ static sd::Tensor<float> sample_lms(denoise_cb_t model,
26722672 int hist_max = hist.size () - 1 ;
26732673 for (int c = 2 ; c <= order; c++)
26742674 x += hist[std::min (hist_max, hist_size_p1 - c + shift)] * lms_coeff[c - 1 ];
2675- // max_order == 4 => hist[] index = 2, 1, 0
2676- // shift == 1 => hist[] index = 2, 2, 1
2675+ // max_order == 4 => hist[] index = 2, 1, 0
2676+ // shift == 1 => hist[] index = 2, 2, 1
26772677 }
26782678 if (hist_size_p1 == max_order) {
26792679 hist.erase (hist.begin ());
0 commit comments