Refactor model path determination logic

This commit is contained in:
2026-05-07 15:14:52 +02:00
parent 2ad8d5e787
commit e235d914aa

View File

@@ -373,9 +373,7 @@ async fn generate_map(
let upscale = cfg.upscale.unwrap_or_else(|| "none".to_string()); let upscale = cfg.upscale.unwrap_or_else(|| "none".to_string());
let seam_inpaint = cfg.seam_inpaint.unwrap_or(false); let seam_inpaint = cfg.seam_inpaint.unwrap_or(false);
let local_model_path = root.join("models").join("sdxl360Diffusion_v10.safetensors"); let local_model_path = root.join("models").join("sdxl360Diffusion_v10.safetensors");
let model_path = cfg let model_path = cfg.model_path.unwrap_or_else(|| {
.model_path
.unwrap_or_else(|| {
if local_model_path.exists() { if local_model_path.exists() {
local_model_path.to_string_lossy().to_string() local_model_path.to_string_lossy().to_string()
} else { } else {