Thread

A small image processing project. It splits images into tiles, upscales them, and stitches them back together. The CPU path works by default. GPU paths are optional.

What it does

Local first

Build and test the CPU path without CUDA or Metal.

GPU when ready

CUDA and Metal code live in the repo, but they are optional.

Simple tools

The C preprocessor uses stb_image. The Python flow uses OpenCV.

REST API

Upload images, create tiles, upscale, stitch, and download results.

How it works

1

Split

Tile images locally with preprocess tool

2

Transfer

Send tiles to a GPU machine when needed

3

Process

Upscale or filter on GPU

4

Stitch

Combine tiles into final image

Status

The local CPU path is the stable path. GPU work is kept separate so the app still runs on a plain machine.

API

POST /v1/images Upload image
GET /v1/images List images
POST /v1/images/:id/tiles Create tiles
POST /v1/tiles/:id/upscale Upscale tile
POST /v1/stitch Combine tiles
GET /health Status check

Install

Quick start

./scripts/setup.sh
./scripts/run.sh

Docker

docker build -t thread .
docker run --rm thread

macOS

brew install cmake ninja
bash scripts/setup.sh
cmake -S . -B build -DWITH_METAL=OFF

Ubuntu

sudo apt install cmake ninja-build python3-venv
bash scripts/setup.sh
cmake -S . -B build -DUSE_CUDA=OFF

Documentation

Notes

Thread is still small. The goal is to keep the working path clear before adding more moving parts.

Join the discussion →