fix: add lora info to image metadata (#1086)

This commit is contained in:
leejet 2025-12-14 01:24:15 +08:00 committed by GitHub
parent 614f8736df
commit 43a70e819b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -232,7 +232,7 @@ static std::string sd_basename(const std::string& path) {
}
std::string get_image_params(const SDCliParams& cli_params, const SDContextParams& ctx_params, const SDGenerationParams& gen_params, int64_t seed) {
std::string parameter_string = gen_params.prompt + "\n";
std::string parameter_string = gen_params.prompt_with_lora + "\n";
if (gen_params.negative_prompt.size() != 0) {
parameter_string += "Negative prompt: " + gen_params.negative_prompt + "\n";
}

View File

@ -863,6 +863,7 @@ static bool is_absolute_path(const std::string& p) {
struct SDGenerationParams {
std::string prompt;
std::string prompt_with_lora; // for metadata record only
std::string negative_prompt;
int clip_skip = -1; // <= 0 represents unspecified
int width = 512;
@ -1476,6 +1477,7 @@ struct SDGenerationParams {
}
bool process_and_check(SDMode mode, const std::string& lora_model_dir) {
prompt_with_lora = prompt;
if (width <= 0) {
fprintf(stderr, "error: the width must be greater than 0\n");
return false;