mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-17 04:19:40 +00:00
improve quiet mode for SD
This commit is contained in:
parent
60d234550b
commit
88705cb89a
3 changed files with 10 additions and 1 deletions
|
@ -256,6 +256,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
||||||
sd_image_t* control_image = NULL;
|
sd_image_t* control_image = NULL;
|
||||||
|
|
||||||
bool is_quiet = inputs.quiet;
|
bool is_quiet = inputs.quiet;
|
||||||
|
set_sd_quiet(is_quiet);
|
||||||
|
|
||||||
//sanitize prompts, remove quotes and limit lengths
|
//sanitize prompts, remove quotes and limit lengths
|
||||||
std::string cleanprompt = clean_input_prompt(inputs.prompt);
|
std::string cleanprompt = clean_input_prompt(inputs.prompt);
|
||||||
|
@ -272,6 +273,8 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
||||||
if(!is_quiet)
|
if(!is_quiet)
|
||||||
{
|
{
|
||||||
printf("\nGenerating Image (%d steps)\n",inputs.sample_steps);
|
printf("\nGenerating Image (%d steps)\n",inputs.sample_steps);
|
||||||
|
}else{
|
||||||
|
printf("\nGenerating (%d st.)\n",inputs.sample_steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
|
@ -208,11 +208,12 @@ std::string path_join(const std::string& p1, const std::string& p2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sdloglevel = 0; //-1 = hide all, 0 = normal, 1 = showall
|
static int sdloglevel = 0; //-1 = hide all, 0 = normal, 1 = showall
|
||||||
|
static bool sdquiet = false;
|
||||||
void pretty_progress(int step, int steps, float time) {
|
void pretty_progress(int step, int steps, float time) {
|
||||||
if (step == 0) {
|
if (step == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(sdloglevel<0)
|
if(sdloglevel<0 || sdquiet)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -279,6 +280,10 @@ bool get_sd_log_level()
|
||||||
{
|
{
|
||||||
return sdloglevel;
|
return sdloglevel;
|
||||||
}
|
}
|
||||||
|
void set_sd_quiet(bool quiet)
|
||||||
|
{
|
||||||
|
sdquiet = quiet;
|
||||||
|
}
|
||||||
|
|
||||||
void log_printf(sd_log_level_t level, const char* file, int line, const char* format, ...) {
|
void log_printf(sd_log_level_t level, const char* file, int line, const char* format, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
|
@ -47,6 +47,7 @@ std::string trim(const std::string& s);
|
||||||
void log_message(const char* format, ...);
|
void log_message(const char* format, ...);
|
||||||
void set_sd_log_level(int log);
|
void set_sd_log_level(int log);
|
||||||
bool get_sd_log_level();
|
bool get_sd_log_level();
|
||||||
|
void set_sd_quiet(bool quiet);
|
||||||
#define LOG_DEBUG(...) log_message(__VA_ARGS__)
|
#define LOG_DEBUG(...) log_message(__VA_ARGS__)
|
||||||
#define LOG_INFO(...) log_message(__VA_ARGS__)
|
#define LOG_INFO(...) log_message(__VA_ARGS__)
|
||||||
#define LOG_WARN(...) log_message(__VA_ARGS__)
|
#define LOG_WARN(...) log_message(__VA_ARGS__)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue