diff --git a/koboldcpp.py b/koboldcpp.py index 1c28d3045..304243970 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -540,8 +540,8 @@ def sd_generate(genparams): biggest = max(width,height) if biggest > reslimit: scaler = biggest / reslimit - width = width / scaler - height = height / scaler + width = int(width / scaler) + height = int(height / scaler) width = width - (width%64) height = height - (height%64) diff --git a/otherarch/sdcpp/sdtype_adapter.cpp b/otherarch/sdcpp/sdtype_adapter.cpp index 6baca190e..14b76d8a8 100644 --- a/otherarch/sdcpp/sdtype_adapter.cpp +++ b/otherarch/sdcpp/sdtype_adapter.cpp @@ -142,7 +142,7 @@ std::string base64_encode(const unsigned char* data, unsigned int data_length) { static std::string sdplatformenv, sddeviceenv, sdvulkandeviceenv; bool sdtype_load_model(const sd_load_model_inputs inputs) { - printf("\nImage Generation Init - Load Safetensors Model: %s\n",inputs.model_filename); + printf("\nImageGen Init - Load Model: %s\n",inputs.model_filename); //duplicated from expose.cpp int cl_parseinfo = inputs.clblast_info; //first digit is whether configured, second is platform, third is devices @@ -273,6 +273,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) { printf("\nGenerating Image (%d steps)\n",inputs.sample_steps); } + fflush(stdout); std::string sampler = inputs.sample_method; diff --git a/otherarch/sdcpp/util.cpp b/otherarch/sdcpp/util.cpp index 6c5f4b52b..55c4adea8 100644 --- a/otherarch/sdcpp/util.cpp +++ b/otherarch/sdcpp/util.cpp @@ -211,6 +211,10 @@ void pretty_progress(int step, int steps, float time) { if (step == 0) { return; } + if(!do_log) + { + return; + } std::string progress = " |"; int max_progress = 50; int32_t current = (int32_t)(step * 1.f * max_progress / steps); @@ -271,6 +275,10 @@ void set_log_message(bool log) { do_log = log; } +bool get_log_message() +{ + return do_log; +} void log_printf(sd_log_level_t level, const char* file, int line, const char* format, ...) { va_list args; diff --git a/otherarch/sdcpp/util.h b/otherarch/sdcpp/util.h index 4ba74b4ba..e5f070b5a 100644 --- a/otherarch/sdcpp/util.h +++ b/otherarch/sdcpp/util.h @@ -46,6 +46,7 @@ std::string trim(const std::string& s); void log_message(const char* format, ...); void set_log_message(bool log); +bool get_log_message(); #define LOG_DEBUG(...) log_message(__VA_ARGS__) #define LOG_INFO(...) log_message(__VA_ARGS__) #define LOG_WARN(...) log_message(__VA_ARGS__)