aboutsummaryrefslogtreecommitdiffstats
path: root/AGENTS.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-30 19:15:03 +0100
committerDanilo M. <danix@danix.xyz>2026-10-30 19:15:03 +0100
commit69810152d0dfedeaa02a96df73cbc184225a1278 (patch)
tree23b1f2c4cd3904831edccc942ab9277179f3121a /AGENTS.md
parent610bf7f3432037f7f8cfb641b05e39e48830f82a (diff)
downloadupscale-qt-69810152d0dfedeaa02a96df73cbc184225a1278.tar.gz
upscale-qt-69810152d0dfedeaa02a96df73cbc184225a1278.zip
Drop imajev suggestion, describe models from models.txt
The vision model picked the right upscaler about half the time on four test photos, and llama-mtmd-cli cannot turn its thinking off: greedy decoding loops, larger budgets cost seconds and still miss. The dropdown now shows a one-line description per model from an optional models.txt next to the models, so the choice stays with the user but is readable. Document usage, model descriptions and how to test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS.md')
-rw-r--r--AGENTS.md39
1 files changed, 28 insertions, 11 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 4f98245..2f270ce 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -7,10 +7,10 @@ Guidance for AI coding agents working in this repository.
`upscale-qt`: single-file PyQt6 desktop app (`upscale-qt`, no `.py`
extension) to upscale an image with an ESRGAN model through `sd-cli`
(stable-diffusion.cpp), compare before/after with a slider wipe, then save
-as a new file or overwrite the original. A small vision model (imajev, run
-one-shot through `llama-mtmd-cli`) suggests which upscaler to use. The only
-Python dependency is PyQt6; everything else is stdlib plus the two external
-binaries. Keep it a single file and do not add dependencies.
+as a new file or overwrite the original. The model dropdown shows a
+description per model from an optional `models.txt` in the upscalers
+folder. The only Python dependency is PyQt6; everything else is stdlib plus
+`sd-cli`. Keep it a single file and do not add dependencies.
Design spec: `docs/superpowers/specs/2026-10-30-upscale-qt-design.md`.
@@ -18,10 +18,12 @@ Design spec: `docs/superpowers/specs/2026-10-30-upscale-qt-design.md`.
- Upscale: `sd-cli -M upscale --upscale-model <model> -i <in> -o <out.png>`.
Models are `.pth`/`.safetensors`/`.gguf` files in the upscalers dir.
-- Suggestion: `llama-mtmd-cli -m <imajev gguf> --mmproj <mmproj gguf>
- --image <in> -p <prompt>`. Its answer is free text and gets matched to a
- filename from the upscalers dir; never trust it as a path.
-- Both run through `QProcess` so the UI never blocks.
+- `sd-cli` runs through `QProcess` so the UI never blocks.
+- sd-cli (stb_image) ignores EXIF orientation. `load()` applies it with
+ `QImageReader.setAutoTransform` and feeds sd-cli an upright temp PNG.
+- `models.txt` lives with the models, not in the repo: `filename = what it
+ is for`, `#` comments. Model names stay out of the repo on purpose, the
+ personal-data hook flags at least one of them as a real name.
- `sd-cli` loads ESRGAN (RRDBNet) and MoSR models only, detected from the
weights. SwinIR, HAT, DAT, SPAN, Compact and face restorers do not load.
- Model choice, measured on 4x crops of a clean portrait, a landscape and a
@@ -32,8 +34,15 @@ Design spec: `docs/superpowers/specs/2026-10-30-upscale-qt-design.md`.
blocks), 4xNomos8kSC (artifacts on noisy input), 4xLSDIRplusR (plastic
on clean input), 4xLSDIRplusC (close to the foolhardy model, not better).
- Timing: an RRDBNet model takes about 25 s per megapixel of input, so a
- 10 MP photo takes about 4 minutes and outputs a 160 MP image. imajev
- answers in about 7 s.
+ 10 MP photo takes about 4 minutes and outputs a 160 MP image.
+- Model suggestion by a local vision model (imajev 4B via
+ `llama-mtmd-cli`) was built and removed. Measured on four photos it
+ picked the right model about half the time. It is a thinking model and
+ `llama-mtmd-cli` has no switch to turn thinking off (no
+ `--chat-template-kwargs`, `/no_think` ignored); with `--temp 0` it loops
+ on `</think> <answer>` until `-n`, without `--jinja` it emits an empty
+ answer. Do not bring it back without a better model or a server that
+ can disable thinking.
## Conventions
@@ -46,7 +55,15 @@ Design spec: `docs/superpowers/specs/2026-10-30-upscale-qt-design.md`.
## Testing
-No test suite yet.
+ python3 test_upscale_qt.py
+
+Plain asserts for the helpers plus offscreen smoke tests of `CompareView`
+and `Main`. The test sets `XDG_CONFIG_HOME` to a temp dir, so it never
+touches the real settings. For an end-to-end check with the real
+`sd-cli`, load the script with `SourceFileLoader` under
+`QT_QPA_PLATFORM=offscreen`, call `load()` and `upscale()`, wait on
+`proc.finished` with a `QEventLoop`, and `grab()` a screenshot. Use a small
+image: about 25 s per input megapixel.
## Repo facts