Skip to content

Commit 43a70e8

Browse files
authored
fix: add lora info to image metadata (#1086)
1 parent 614f873 commit 43a70e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

examples/cli/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static std::string sd_basename(const std::string& path) {
232232
}
233233

234234
std::string get_image_params(const SDCliParams& cli_params, const SDContextParams& ctx_params, const SDGenerationParams& gen_params, int64_t seed) {
235-
std::string parameter_string = gen_params.prompt + "\n";
235+
std::string parameter_string = gen_params.prompt_with_lora + "\n";
236236
if (gen_params.negative_prompt.size() != 0) {
237237
parameter_string += "Negative prompt: " + gen_params.negative_prompt + "\n";
238238
}

examples/common/common.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ static bool is_absolute_path(const std::string& p) {
863863

864864
struct SDGenerationParams {
865865
std::string prompt;
866+
std::string prompt_with_lora; // for metadata record only
866867
std::string negative_prompt;
867868
int clip_skip = -1; // <= 0 represents unspecified
868869
int width = 512;
@@ -1476,6 +1477,7 @@ struct SDGenerationParams {
14761477
}
14771478

14781479
bool process_and_check(SDMode mode, const std::string& lora_model_dir) {
1480+
prompt_with_lora = prompt;
14791481
if (width <= 0) {
14801482
fprintf(stderr, "error: the width must be greater than 0\n");
14811483
return false;

0 commit comments

Comments
 (0)