feat: support random seed flag (#1163)

This commit is contained in:
Jay4242 2026-01-04 05:57:50 -08:00 committed by GitHub
parent 4ff2c8c74b
commit 6eefd2d49a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -202,12 +202,18 @@ void parse_args(int argc, const char** argv, SDSvrParams& svr_params, SDContextP
exit(svr_params.normal_exit ? 0 : 1); exit(svr_params.normal_exit ? 0 : 1);
} }
const bool random_seed_requested = default_gen_params.seed < 0;
if (!svr_params.process_and_check() || if (!svr_params.process_and_check() ||
!ctx_params.process_and_check(IMG_GEN) || !ctx_params.process_and_check(IMG_GEN) ||
!default_gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) { !default_gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) {
print_usage(argc, argv, options_vec); print_usage(argc, argv, options_vec);
exit(1); exit(1);
} }
if (random_seed_requested) {
default_gen_params.seed = -1;
}
} }
std::string extract_and_remove_sd_cpp_extra_args(std::string& text) { std::string extract_and_remove_sd_cpp_extra_args(std::string& text) {