@@ -68,6 +68,14 @@ void calculate_alphas_cumprod(float* alphas_cumprod,
6868 }
6969}
7070
71+ void suppress_pp (int step, int steps, float time, void * data) {
72+ (void )step;
73+ (void )steps;
74+ (void )time;
75+ (void )data;
76+ return ;
77+ }
78+
7179/* =============================================== StableDiffusionGGML ================================================*/
7280
7381class StableDiffusionGGML {
@@ -782,6 +790,14 @@ class StableDiffusionGGML {
782790 return {c_crossattn, y, c_concat};
783791 }
784792
793+ 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) {
794+ sd_progress_cb_t cb = sd_get_progress_callback ();
795+ void * cbd = sd_get_progress_callback_data ();
796+ sd_set_progress_callback ((sd_progress_cb_t )suppress_pp, NULL );
797+ sd_tiling (input, output, scale, tile_size, tile_overlap_factor, on_processing);
798+ sd_set_progress_callback (cb, cbd);
799+ }
800+
785801 void preview_image (ggml_context* work_ctx,
786802 int step,
787803 struct ggml_tensor * latents,
@@ -843,7 +859,8 @@ class StableDiffusionGGML {
843859 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
844860 first_stage_model->compute (n_threads, in, true , &out);
845861 };
846- sd_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
862+ silent_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
863+
847864 } else {
848865 first_stage_model->compute (n_threads, latents, true , &result);
849866 }
@@ -861,7 +878,7 @@ class StableDiffusionGGML {
861878 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
862879 tae_first_stage->compute (n_threads, in, true , &out);
863880 };
864- sd_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
881+ silent_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
865882 } else {
866883 tae_first_stage->compute (n_threads, latents, true , &result);
867884 }
@@ -1067,10 +1084,6 @@ class StableDiffusionGGML {
10671084 vec_denoised[i] = latent_result * c_out + vec_input[i] * c_skip;
10681085 }
10691086 int64_t t1 = ggml_time_us ();
1070- if (step > 0 ) {
1071- pretty_progress (step, (int )steps, (t1 - t0) / 1000000 .f );
1072- // LOG_INFO("step %d sampling completed taking %.2fs", step, (t1 - t0) * 1.0f / 1000000);
1073- }
10741087 if (noise_mask != nullptr ) {
10751088 for (int64_t x = 0 ; x < denoised->ne [0 ]; x++) {
10761089 for (int64_t y = 0 ; y < denoised->ne [1 ]; y++) {
@@ -1083,6 +1096,10 @@ class StableDiffusionGGML {
10831096 }
10841097 }
10851098 }
1099+ if (step > 0 ) {
1100+ pretty_progress (step, (int )steps, (t1 - t0) / 1000000 .f );
1101+ // LOG_INFO("step %d sampling completed taking %.2fs", step, (t1 - t0) * 1.0f / 1000000);
1102+ }
10861103
10871104 if (step_callback != nullptr ) {
10881105 if (step % preview_interval == 0 ) {
0 commit comments