mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-02-04 19:03:35 +00:00
feat: support random seed flag (#1163)
This commit is contained in:
parent
4ff2c8c74b
commit
6eefd2d49a
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user