Refactor model path determination logic
This commit is contained in:
@@ -373,15 +373,13 @@ 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
|
if local_model_path.exists() {
|
||||||
.unwrap_or_else(|| {
|
local_model_path.to_string_lossy().to_string()
|
||||||
if local_model_path.exists() {
|
} else {
|
||||||
local_model_path.to_string_lossy().to_string()
|
"ProGamerGov/sdxl-360-diffusion".to_string()
|
||||||
} else {
|
}
|
||||||
"ProGamerGov/sdxl-360-diffusion".to_string()
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
let base_model = cfg
|
let base_model = cfg
|
||||||
.base_model
|
.base_model
|
||||||
.unwrap_or_else(|| "stabilityai/stable-diffusion-xl-base-1.0".to_string());
|
.unwrap_or_else(|| "stabilityai/stable-diffusion-xl-base-1.0".to_string());
|
||||||
|
|||||||
Reference in New Issue
Block a user