@@ -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 {
@@ -788,6 +796,14 @@ class StableDiffusionGGML {
788796 return {c_crossattn, y, c_concat};
789797 }
790798
799+ 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) {
800+ sd_progress_cb_t cb = sd_get_progress_callback ();
801+ void * cbd = sd_get_progress_callback_data ();
802+ sd_set_progress_callback ((sd_progress_cb_t )suppress_pp, NULL );
803+ sd_tiling (input, output, scale, tile_size, tile_overlap_factor, on_processing);
804+ sd_set_progress_callback (cb, cbd);
805+ }
806+
791807 void preview_image (ggml_context* work_ctx,
792808 int step,
793809 struct ggml_tensor * latents,
@@ -849,7 +865,8 @@ class StableDiffusionGGML {
849865 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
850866 first_stage_model->compute (n_threads, in, true , &out);
851867 };
852- sd_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
868+ silent_tiling (latents, result, 8 , 32 , 0 .5f , on_tiling);
869+
853870 } else {
854871 first_stage_model->compute (n_threads, latents, true , &result);
855872 }
@@ -867,7 +884,7 @@ class StableDiffusionGGML {
867884 auto on_tiling = [&](ggml_tensor* in, ggml_tensor* out, bool init) {
868885 tae_first_stage->compute (n_threads, in, true , &out);
869886 };
870- sd_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
887+ silent_tiling (latents, result, 8 , 64 , 0 .5f , on_tiling);
871888 } else {
872889 tae_first_stage->compute (n_threads, latents, true , &result);
873890 }
@@ -1073,10 +1090,6 @@ class StableDiffusionGGML {
10731090 vec_denoised[i] = latent_result * c_out + vec_input[i] * c_skip;
10741091 }
10751092 int64_t t1 = ggml_time_us ();
1076- if (step > 0 ) {
1077- pretty_progress (step, (int )steps, (t1 - t0) / 1000000 .f );
1078- // LOG_INFO("step %d sampling completed taking %.2fs", step, (t1 - t0) * 1.0f / 1000000);
1079- }
10801093 if (noise_mask != nullptr ) {
10811094 for (int64_t x = 0 ; x < denoised->ne [0 ]; x++) {
10821095 for (int64_t y = 0 ; y < denoised->ne [1 ]; y++) {
@@ -1089,6 +1102,10 @@ class StableDiffusionGGML {
10891102 }
10901103 }
10911104 }
1105+ if (step > 0 ) {
1106+ pretty_progress (step, (int )steps, (t1 - t0) / 1000000 .f );
1107+ // LOG_INFO("step %d sampling completed taking %.2fs", step, (t1 - t0) * 1.0f / 1000000);
1108+ }
10921109
10931110 if (step_callback != nullptr ) {
10941111 if (step % preview_interval == 0 ) {
0 commit comments