Skip to content

Commit e466ce6

Browse files
committed
updated sd metadata
1 parent 8708403 commit e466ce6

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

otherarch/sdcpp/sdtype_adapter.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <inttypes.h>
1010
#include <cinttypes>
1111
#include <algorithm>
12+
#include <filesystem>
1213

1314
#include "model_adapter.h"
1415

@@ -116,6 +117,7 @@ static uint8_t * input_image_buffer = NULL;
116117
static std::string sdplatformenv, sddeviceenv, sdvulkandeviceenv;
117118
static bool notiling = false;
118119
static bool sd_is_quiet = false;
120+
static std::string sdmodelfilename = "";
119121

120122
bool sdtype_load_model(const sd_load_model_inputs inputs) {
121123
sd_is_quiet = inputs.quiet;
@@ -129,6 +131,7 @@ bool sdtype_load_model(const sd_load_model_inputs inputs) {
129131
std::string clipg_filename = inputs.clipg_filename;
130132
notiling = inputs.notile;
131133
printf("\nImageGen Init - Load Model: %s\n",inputs.model_filename);
134+
132135
if(lorafilename!="")
133136
{
134137
printf("With LoRA: %s at %f power\n",lorafilename.c_str(),inputs.lora_multiplier);
@@ -253,6 +256,9 @@ bool sdtype_load_model(const sd_load_model_inputs inputs) {
253256
return false;
254257
}
255258

259+
std::filesystem::path mpath(inputs.model_filename);
260+
sdmodelfilename = mpath.filename().string();
261+
256262
if(lorafilename!="" && inputs.lora_multiplier>0)
257263
{
258264
printf("\nApply LoRA...\n");
@@ -279,14 +285,16 @@ std::string clean_input_prompt(const std::string& input) {
279285
}
280286

281287
static std::string get_image_params(const SDParams& params) {
282-
std::string parameter_string = "Prompt: " + params.prompt + ", ";
283-
parameter_string += "NegativePrompt: " + params.negative_prompt + ", ";
284-
parameter_string += "Steps: " + std::to_string(params.sample_steps) + ", ";
285-
parameter_string += "CFGScale: " + std::to_string(params.cfg_scale) + ", ";
286-
parameter_string += "Guidance: " + std::to_string(params.guidance) + ", ";
287-
parameter_string += "Seed: " + std::to_string(params.seed) + ", ";
288-
parameter_string += "Size: " + std::to_string(params.width) + "x" + std::to_string(params.height) + ", ";
289-
parameter_string += "Sampler: " + std::to_string((int)sd_params->sample_method) + ", ";
288+
std::string parameter_string = "";
289+
parameter_string += "Prompt: " + params.prompt + " | ";
290+
parameter_string += "NegativePrompt: " + params.negative_prompt + " | ";
291+
parameter_string += "Steps: " + std::to_string(params.sample_steps) + " | ";
292+
parameter_string += "CFGScale: " + std::to_string(params.cfg_scale) + " | ";
293+
parameter_string += "Guidance: " + std::to_string(params.guidance) + " | ";
294+
parameter_string += "Seed: " + std::to_string(params.seed) + " | ";
295+
parameter_string += "Size: " + std::to_string(params.width) + "x" + std::to_string(params.height) + " | ";
296+
parameter_string += "Sampler: " + std::to_string((int)sd_params->sample_method) + " | ";
297+
parameter_string += "Model: " + sdmodelfilename + " | ";
290298
parameter_string += "Version: KoboldCpp";
291299
return parameter_string;
292300
}

0 commit comments

Comments
 (0)