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,15 +373,13 @@ async fn generate_map(
let upscale = cfg.upscale.unwrap_or_else(|| "none".to_string());
let seam_inpaint = cfg.seam_inpaint.unwrap_or(false);
let local_model_path = root.join("models").join("sdxl360Diffusion_v10.safetensors");
let model_path = cfg
.model_path
.unwrap_or_else(|| {
if local_model_path.exists() {
local_model_path.to_string_lossy().to_string()
} else {
"ProGamerGov/sdxl-360-diffusion".to_string()
}
});
let model_path = cfg.model_path.unwrap_or_else(|| {
if local_model_path.exists() {
local_model_path.to_string_lossy().to_string()
} else {
"ProGamerGov/sdxl-360-diffusion".to_string()
}
});
let base_model = cfg
.base_model
.unwrap_or_else(|| "stabilityai/stable-diffusion-xl-base-1.0".to_string());