Commit History
-
Enforce strict typing on Python code with mypy (#20)
Unverified signature* Enforce strict typing on Python code with mypy Adds mypy --strict configuration scoped to the project's own code (app.py, inference.py, model_loading.py, logging_utils.py, dimensions.py, mode.py, image_codec.py, examples_ui.py, tests/), excluding qwenimage/ since it's vendored from HuggingFace diffusers rather than code we own. Fully annotates the in-scope modules and tests, and enforces the check going forward via a GitHub Actions workflow and a local pre-commit hook. Fixes #19 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Move mypy's scoped file list into pyproject.toml CI and pre-commit invoked mypy with the same long, repeated list of files on the command line. mypy already supports a `files` setting in [tool.mypy], so both call sites now just run `uv run mypy` with no args. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>698eb37
-
Skip text_encoder CPU offload in fast mode; type mode as an enum
Logged phase timing showed the text_encoder-to-CPU offload before VAE decode costs ~9.7s, while decode itself takes ~113ms. That offload was freeing memory decode never needed at fast mode's small resolution (measured peak stayed well under the MIG slice's headroom) — it exists to prevent OOM at high-detail's much larger 2048px decode, so it's kept there and only skipped for fast mode. Replaced the raw "fast"/"high_detail" string comparisons scattered across dimensions.py and app.py with a Mode enum (mode.py) that owns both behaviors (max_dim, offloads_text_encoder_before_decode) as properties on the variant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>39867e3