From 7eb30d00e5d1434ce36d3dffe8d32892800e3163 Mon Sep 17 00:00:00 2001 From: Wagner Bruna Date: Mon, 28 Jul 2025 11:00:27 -0300 Subject: [PATCH] feat: add missing models and parameters to image metadata (#743) * feat: add new scheduler types, clip skip and vae to image embedded params - If a non default scheduler is set, include it in the 'Sampler' tag in the data embedded into the final image. - If a custom VAE path is set, include the vae name (without path and extension) in embedded image params under a `VAE:` tag. - If a custom Clip skip is set, include that Clip skip value in embedded image params under a `Clip skip:` tag. * feat: add separate diffusion and text models to metadata --------- Co-authored-by: one-lithe-rune --- examples/cli/main.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/cli/main.cpp b/examples/cli/main.cpp index 27e3f78..140e384 100644 --- a/examples/cli/main.cpp +++ b/examples/cli/main.cpp @@ -677,10 +677,24 @@ std::string get_image_params(SDParams params, int64_t seed) { parameter_string += "Model: " + sd_basename(params.model_path) + ", "; parameter_string += "RNG: " + std::string(sd_rng_type_name(params.rng_type)) + ", "; parameter_string += "Sampler: " + std::string(sd_sample_method_name(params.sample_method)); - if (params.schedule == KARRAS) { - parameter_string += " karras"; + if (params.schedule != DEFAULT) { + parameter_string += " " + std::string(sd_schedule_name(params.schedule)); } parameter_string += ", "; + for (const auto& te : {params.clip_l_path, params.clip_g_path, params.t5xxl_path}) { + if (!te.empty()) { + parameter_string += "TE: " + sd_basename(te) + ", "; + } + } + if (!params.diffusion_model_path.empty()) { + parameter_string += "Unet: " + sd_basename(params.diffusion_model_path) + ", "; + } + if (!params.vae_path.empty()) { + parameter_string += "VAE: " + sd_basename(params.vae_path) + ", "; + } + if (params.clip_skip != -1) { + parameter_string += "Clip skip: " + std::to_string(params.clip_skip) + ", "; + } parameter_string += "Version: stable-diffusion.cpp"; return parameter_string; }