Skip to content

Commit cca89ed

Browse files
committed
Remove sd_set_progress_callback in favor of sd_set_result_callback and sd_set_result_step_callback
1 parent 4e32f34 commit cca89ed

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

stable-diffusion.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ enum sd_log_level_t {
106106
};
107107

108108
typedef void (*sd_log_cb_t)(enum sd_log_level_t level, const char* text, void* data);
109-
typedef void (*sd_progress_cb_t)(int step, int steps, float time, void* data);
110109
typedef void (*sd_result_cb_t)(size_t number, uint8_t* image_data, void* data);
111110
typedef void (*sd_result_step_cb_t)(size_t number, size_t step, uint8_t* image_data, void* data);
112111

113112
SD_API void sd_set_log_callback(sd_log_cb_t sd_log_cb, void* data);
114-
SD_API void sd_set_progress_callback(sd_progress_cb_t cb, void* data);
115113
SD_API int32_t get_num_physical_cores();
116114
SD_API const char* sd_get_system_info();
117115

util.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ int32_t get_num_physical_cores() {
230230
return n_threads > 0 ? (n_threads <= 4 ? n_threads : n_threads / 2) : 4;
231231
}
232232

233-
static sd_progress_cb_t sd_progress_cb = NULL;
234-
void* sd_progress_cb_data = NULL;
235-
236233
std::u32string utf8_to_utf32(const std::string& utf8_str) {
237234
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
238235
return converter.from_bytes(utf8_str);
@@ -310,10 +307,6 @@ sd_image_t* preprocess_id_image(sd_image_t* img) {
310307
}
311308

312309
void pretty_progress(int step, int steps, float time) {
313-
if (sd_progress_cb) {
314-
sd_progress_cb(step, steps, time, sd_progress_cb_data);
315-
return;
316-
}
317310
if (step == 0) {
318311
return;
319312
}
@@ -385,10 +378,6 @@ void sd_set_log_callback(sd_log_cb_t cb, void* data) {
385378
sd_log_cb = cb;
386379
sd_log_cb_data = data;
387380
}
388-
void sd_set_progress_callback(sd_progress_cb_t cb, void* data) {
389-
sd_progress_cb = cb;
390-
sd_progress_cb_data = data;
391-
}
392381
const char* sd_get_system_info() {
393382
static char buffer[1024];
394383
std::stringstream ss;

0 commit comments

Comments
 (0)