@@ -71,6 +71,14 @@ void calculate_alphas_cumprod(float* alphas_cumprod,
7171 }
7272}
7373
74+ void suppress_pp (int step, int steps, float time, void * data) {
75+ (void )step;
76+ (void )steps;
77+ (void )time;
78+ (void )data;
79+ return ;
80+ }
81+
7482/* =============================================== StableDiffusionGGML ================================================*/
7583
7684class StableDiffusionGGML {
@@ -837,7 +845,16 @@ class StableDiffusionGGML {
837845 LOG_DEBUG (" computing svd condition graph completed, taking %" PRId64 " ms" , t1 - t0);
838846 return {c_crossattn, y, c_concat};
839847 }
840- void preview_image (ggml_context* work_ctx,
848+
849+ void silent_tiling (ggml_tensor* input, ggml_tensor* output, const int scale, const int tile_size, const float tile_overlap_factor, on_tile_process on_processing) {
850+ sd_progress_cb_t cb = sd_get_progress_callback ();
851+ void * cbd = sd_get_progress_callback_data ();
852+ sd_set_progress_callback ((sd_progress_cb_t )suppress_pp, NULL );
853+ sd_tiling (input, output, scale, tile_size, tile_overlap_factor, on_processing);
854+ sd_set_progress_callback (cb, cbd);
855+ }
856+
857+ void preview_image (ggml_context* work_ctx,
841858 int step,
842859 struct ggml_tensor * latents,
843860 enum SDVersion version,
@@ -898,7 +915,8 @@ void preview_image(ggml_context* work_ctx,
898915 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
899916 first_stage_model->compute (n_threads, in, true , &out);
900917 };
901- sd_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
918+ silent_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
919+
902920 } else {
903921 first_stage_model->compute (n_threads, latents, true , &result);
904922 }
@@ -916,7 +934,7 @@ void preview_image(ggml_context* work_ctx,
916934 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
917935 tae_first_stage->compute (n_threads, in, true , &out);
918936 };
919- sd_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
937+ silent_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
920938 } else {
921939 tae_first_stage->compute (n_threads, latents, true , &result);
922940 }
@@ -1194,6 +1212,10 @@ void preview_image(ggml_context* work_ctx,
11941212 }
11951213 }
11961214 }
1215+ if (step > 0 ) {
1216+ pretty_progress (step, (int )steps, (t1 - t0) / 1000000 .f );
1217+ // LOG_INFO("step %d sampling completed taking %.2fs", step, (t1 - t0) * 1.0f / 1000000);
1218+ }
11971219
11981220 if (step_callback != nullptr ) {
11991221 if (step % preview_interval == 0 ) {
0 commit comments