Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7eb30d0

Browse files
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 <[email protected]>
1 parent 59080d3 commit 7eb30d0

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

examples/cli/main.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,24 @@ std::string get_image_params(SDParams params, int64_t seed) {
677677
parameter_string += "Model: " + sd_basename(params.model_path) + ", ";
678678
parameter_string += "RNG: " + std::string(sd_rng_type_name(params.rng_type)) + ", ";
679679
parameter_string += "Sampler: " + std::string(sd_sample_method_name(params.sample_method));
680-
if (params.schedule == KARRAS) {
681-
parameter_string += " karras";
680+
if (params.schedule != DEFAULT) {
681+
parameter_string += " " + std::string(sd_schedule_name(params.schedule));
682682
}
683683
parameter_string += ", ";
684+
for (const auto& te : {params.clip_l_path, params.clip_g_path, params.t5xxl_path}) {
685+
if (!te.empty()) {
686+
parameter_string += "TE: " + sd_basename(te) + ", ";
687+
}
688+
}
689+
if (!params.diffusion_model_path.empty()) {
690+
parameter_string += "Unet: " + sd_basename(params.diffusion_model_path) + ", ";
691+
}
692+
if (!params.vae_path.empty()) {
693+
parameter_string += "VAE: " + sd_basename(params.vae_path) + ", ";
694+
}
695+
if (params.clip_skip != -1) {
696+
parameter_string += "Clip skip: " + std::to_string(params.clip_skip) + ", ";
697+
}
684698
parameter_string += "Version: stable-diffusion.cpp";
685699
return parameter_string;
686700
}

0 commit comments

Comments
 (0)