{"id":48924089,"url":"https://github.com/joaodotwork/metalgrow","last_synced_at":"2026-04-17T06:03:50.682Z","repository":{"id":351026540,"uuid":"1209192745","full_name":"joaodotwork/metalgrow","owner":"joaodotwork","description":"AI-powered image upscaler accelerated on Apple Metal (MPS).","archived":false,"fork":false,"pushed_at":"2026-04-13T09:56:43.000Z","size":17,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T10:31:44.445Z","etag":null,"topics":["apple-silicon","image-upscaling","machine-learning","mps","python","pytorch","real-esrgan","super-resolution"],"latest_commit_sha":null,"homepage":"https://github.com/joaodotwork/metalgrow","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joaodotwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T07:23:53.000Z","updated_at":"2026-04-13T08:36:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/joaodotwork/metalgrow","commit_stats":null,"previous_names":["joaodotwork/metalgrow"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/joaodotwork/metalgrow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaodotwork%2Fmetalgrow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaodotwork%2Fmetalgrow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaodotwork%2Fmetalgrow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaodotwork%2Fmetalgrow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaodotwork","download_url":"https://codeload.github.com/joaodotwork/metalgrow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaodotwork%2Fmetalgrow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31917372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-silicon","image-upscaling","machine-learning","mps","python","pytorch","real-esrgan","super-resolution"],"created_at":"2026-04-17T06:03:49.906Z","updated_at":"2026-04-17T06:03:50.673Z","avatar_url":"https://github.com/joaodotwork.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metalgrow\n\n\u003e AI-powered image upscaler accelerated on Apple Metal (MPS).\n\n[![CI](https://github.com/joaodotwork/metalgrow/actions/workflows/ci.yml/badge.svg)](https://github.com/joaodotwork/metalgrow/actions/workflows/ci.yml)\n[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)\n[![PyTorch](https://img.shields.io/badge/PyTorch-2.3%2B-ee4c2c.svg?logo=pytorch\u0026logoColor=white)](https://pytorch.org/)\n[![Apple Silicon](https://img.shields.io/badge/Apple%20Silicon-MPS-000000.svg?logo=apple\u0026logoColor=white)](https://developer.apple.com/metal/pytorch/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Status](https://img.shields.io/badge/status-alpha-orange.svg)](#roadmap)\n[![Ruff](https://img.shields.io/badge/lint-ruff-261230.svg)](https://github.com/astral-sh/ruff)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](#contributing)\n\n`metalgrow` runs super-resolution on Apple Silicon GPUs through PyTorch's MPS\nbackend, with graceful fallbacks to CUDA and CPU. It ships with a bicubic\nbaseline so the pipeline is runnable end-to-end, and exposes a clean seam for\nplugging in a learned backbone (Real-ESRGAN, SwinIR, etc.).\n\n---\n\n## Table of contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Install](#install)\n- [Usage](#usage)\n- [Project layout](#project-layout)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- 🍎 **Apple Metal first** — PyTorch MPS backend, zero config on Apple Silicon\n- 🔁 **Portable** — automatic fallback to CUDA / CPU when MPS isn't available\n- 🧩 **Pluggable backbones** — bicubic, Real-ESRGAN (x2/x4), SwinIR (x2/x4)\n- 🧱 **Tiled inference** — process arbitrarily large images with feathered overlap blending\n- 📂 **Batch mode** — upscale whole directories or globs with a progress bar\n- 📦 **Model registry** — `metalgrow models` manages cached weights with sha256 verification\n- 🧪 **Tested** — pytest suite covering the CPU baseline, tiling, batch mode, and registry\n\n## Requirements\n\n- Python **3.11+**\n- macOS with Apple Silicon for MPS acceleration (optional — CPU/CUDA also work)\n\n## Install\n\n```bash\ngit clone https://github.com/joaodotwork/metalgrow.git\ncd metalgrow\nuv venv \u0026\u0026 source .venv/bin/activate\nuv pip install -e .\n```\n\nOr with plain pip:\n\n```bash\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -e .\n```\n\n## Usage\n\n### CLI\n\nSingle file:\n\n```bash\nmetalgrow info\nmetalgrow upscale input.jpg out.png --scale 2\nmetalgrow upscale input.jpg out.png --scale 4 --device mps --backbone realesrgan-x4\n```\n\nWhole directory or glob (writes to a target directory, mirroring filenames):\n\n```bash\nmetalgrow upscale ./photos ./photos-upscaled --scale 2 --backbone realesrgan-x2\nmetalgrow upscale \"./photos/*.png\" ./out --scale 2 --skip-existing\n```\n\n| Flag                  | Default       | Description                                                     |\n| --------------------- | ------------- | --------------------------------------------------------------- |\n| `--scale`, `-s`       | `2.0`         | Upscale factor (1.01–8.0)                                       |\n| `--device`, `-d`      | `auto`        | `auto` \\| `mps` \\| `cuda` \\| `cpu`                              |\n| `--backbone`, `-b`    | `bicubic`     | `bicubic` \\| `realesrgan-x{2,4}` \\| `swinir-x{2,4}`             |\n| `--dtype`             | `fp32`        | `fp32` \\| `fp16` (fp16 is MPS-only and noisier)                 |\n| `--tile`              | backbone hint | Tile size in input px for tiled inference (`0` disables)        |\n| `--tile-pad`          | backbone hint | Context padding per tile edge (covers backbone receptive field) |\n| `--skip-existing`     | off           | Batch mode: skip outputs that already exist                     |\n| `--workers`, `-j`     | `4`           | Batch mode: parallel I/O workers (inference stays serial)       |\n\n#### Manage cached model weights\n\n```bash\nmetalgrow models list\nmetalgrow models download realesrgan-x4\nmetalgrow models rm realesrgan-x4\n```\n\nWeights cache to `~/.cache/metalgrow/` by default; override with the\n`METALGROW_CACHE_DIR` env var. Every download is sha256-verified.\n\nSee [`docs/models.md`](./docs/models.md) for a quality / speed / memory\ncomparison (with benchmark numbers) and guidance on which backbone to pick,\nor [`docs/usage.md`](./docs/usage.md) for the full CLI / library reference.\n\n### Library\n\n```python\nfrom PIL import Image\nfrom metalgrow import Upscaler\n\nupscaler = Upscaler(backbone=\"realesrgan-x2\", device=\"auto\")  # auto | mps | cuda | cpu\nresult = upscaler.upscale(\n    Image.open(\"input.jpg\").convert(\"RGB\"),\n    scale=2.0,\n    tile=256,        # optional — backbone has sensible defaults\n    tile_pad=16,\n)\nresult.save(\"out.png\")\n```\n\n## Project layout\n\n```\nsrc/metalgrow/\n  device.py            # device auto-selection (MPS → CUDA → CPU)\n  upscaler.py          # Upscaler class + tiled inference with overlap blending\n  batch.py             # directory / glob batch mode\n  weights.py           # weight registry, sha256 verification, cache management\n  cli.py               # typer CLI (upscale, info, models)\n  backbones/           # bicubic, realesrgan, swinir; plugin registry\ntests/\ndocs/\n  usage.md             # CLI recipes, library API, env vars, pitfalls\n  models.md            # backbone comparison, benchmark snapshot, tiling\n  benchmarks.md        # full (device × backbone × scale) tables\n  architecture.md      # module layout, data flow, extension points\n```\n\n## Roadmap\n\n- [x] Integrate a learned SR backbone (Real-ESRGAN default)\n- [x] Tiled inference for large images\n- [x] Batch / directory mode\n- [x] Model registry + weight download\n- [x] Second backbone family (SwinIR)\n- [x] GitHub Actions CI (lint + test on macOS + Linux)\n- [x] Benchmarks: MPS vs CPU (CUDA pending GPU runner)\n- [ ] v0.1.0 release\n\n## Contributing\n\nIssues and PRs are welcome. Please run `ruff` and `pytest` before opening a PR.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n---\n\n\u003csub\u003eMade with 🔩 on Apple Silicon.\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaodotwork%2Fmetalgrow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaodotwork%2Fmetalgrow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaodotwork%2Fmetalgrow/lists"}