Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

Tests: pin the upscaler model where they assume the PC default (Macs default to Lanczos)

Gabriele Lozupone8c08e7c9ddd6
diff --git a/crates/qls-core/src/config.rs b/crates/qls-core/src/config.rs
index 2c3bbc7..db2ecf6 100644
--- a/crates/qls-core/src/config.rs
+++ b/crates/qls-core/src/config.rs
@@ -764,6 +764,7 @@ mod tests {
let dir = tempfile::tempdir().unwrap();
let mut c = AppConfig::default();
c.sdcpp_dir = dir.path().to_path_buf();
+ c.upscaler_model = UPSCALER_CHOICES[0].0.into(); // the PC default (Macs: Lanczos)
assert!(c.upscaler_file().is_none());
std::fs::create_dir_all(c.upscalers_dir()).unwrap();
let f = c.upscalers_dir().join("4xNomos2_hq_mosr.pth");
diff --git a/crates/qls-core/src/diagnostics.rs b/crates/qls-core/src/diagnostics.rs
index cd45923..16c8348 100644
--- a/crates/qls-core/src/diagnostics.rs
+++ b/crates/qls-core/src/diagnostics.rs
@@ -297,6 +297,7 @@ mod tests {
fn checks_flag_missing_files() {
let mut cfg = AppConfig::default();
cfg.sdcpp_dir = std::env::temp_dir().join("qls-does-not-exist");
+ cfg.upscaler_model = crate::config::UPSCALER_CHOICES[0].0.into(); // the PC default (Macs: Lanczos)
cfg.profiles = vec![crate::config::ModelProfile::official(&cfg.sdcpp_dir, cfg.preset())];
let r = setup_checks(&cfg, None);
assert!(!r.ready);
@@ -313,6 +314,7 @@ mod tests {
let mut cfg = AppConfig::default();
cfg.sdcpp_dir = dir.path().to_path_buf();
cfg.gpu_backend = crate::config::GpuBackend::Cuda;
+ cfg.upscaler_model = crate::config::UPSCALER_CHOICES[0].0.into(); // the PC default (Macs: Lanczos)
assert!(!upscaler_check(&cfg).ok, "required");
let up = crate::catalog::UPSCALER;
std::fs::create_dir_all(up.path(dir.path()).parent().unwrap()).unwrap();
diff --git a/crates/qls-core/src/engine.rs b/crates/qls-core/src/engine.rs
index 271b4dc..2fdcdc8 100644
--- a/crates/qls-core/src/engine.rs
+++ b/crates/qls-core/src/engine.rs
@@ -1239,6 +1239,7 @@ mod tests {
let mut cfg = AppConfig::default();
cfg.gpu_backend = crate::config::GpuBackend::Cuda; // SageAttention is CUDA only
cfg.sdcpp_dir = dir.path().to_path_buf();
+ cfg.upscaler_model = crate::config::UPSCALER_CHOICES[0].0.into(); // the PC default (Macs: Lanczos)
let i = plan_inputs(&cfg, vec![], None, Some(16303));
assert_eq!(i.upscaler, None, "no model file -> Lanczos");
assert!(i.server_vae_tiling && i.sage_attention && !i.metal);