Sign inSign up

ivanmicai/anime-upscaling-api

By ivanmicai

•Updated about 2 months ago

Go API and GPU workers for Anime Upscaling — video2x + FFmpeg job orchestration

Image
Machine learning & AI
0

3.4K

ivanmicai/anime-upscaling-api repository overview

⁠Anime Upscaling — API and workers

Go HTTP API for Anime Upscaling⁠, a self-hosted app for anime video restoration. This image does the actual work: it orchestrates video2x⁠ and FFmpeg subprocesses on your GPU and streams progress back to the dashboard.

Pair it with the dashboard — ivanmicai/anime-upscaling-app⁠ — which is the only container you publish a port for.

Everything stays on your machine — no cloud, no telemetry, no per-minute pricing.

Website: https://ivanmicai.github.io/anime-upscaling/⁠

⁠What it does

Four operations, usable on their own or chained into a saved pipeline:

OperationWhat it does
upscaleRuns video2x with the chosen processor, model and scale.
interpolateRuns RIFE to multiply the frame rate.
optimizeRe-encodes with the chosen codec, CRF preset and audio settings.
integrity checkProbes the file with FFmpeg to confirm it decodes end to end.

Bundled model families: RealESRGAN, Anime4K v4 (libplacebo shaders), RealCUGAN, and the full RIFE line through rife-v4.26.

It also runs a GPU health monitor that detects a wedged NVIDIA driver, and two independent worker queues — one for GPU work, one for FFmpeg — so re-encodes do not sit behind upscales.

⁠Image details

  • Go API on the video2x base image, with FFmpeg and the ncnn/Vulkan runtimes
  • Listens on API_PORT (default 4751) — keep it on the internal Compose network
  • linux/amd64 (the video2x base is amd64-only)
  • Large by design: it carries the model weights and GPU runtimes

⁠Quick start

services:
  api:
    image: ivanmicai/anime-upscaling-api:latest
    container_name: anime-upscaling-api
    environment:
      API_PORT: 4751
      PROCESS_DIR: /data
      GPU_COUNT: 1
      STREAMS_PER_GPU: 1
      FFMPEG_STREAMS: 1
    expose: ["4751"]
    volumes:
      - ./data:/data
    restart: unless-stopped
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

  web:
    image: ivanmicai/anime-upscaling-app:latest
    container_name: anime-upscaling-app
    environment:
      PORT: 4750
      API_URL: http://api:4751
      PROCESS_DIR: /data
      AUTH_PASSWORD: replace-this-password
      AUTH_SECRET: replace-with-openssl-rand-hex-32
    ports:
      - "4750:4750"
    volumes:
      - ./data:/data:ro
    depends_on: [api]
    restart: unless-stopped
mkdir -p data/input data/output data/optimized data/interpolated data/temp
docker compose up -d

The GPU reservation needs the NVIDIA Container Toolkit⁠ on the host. Drop it to run on CPU.

Or clone the repository and run make quickstart, which generates the secrets, creates the folders and starts both containers for you.

⁠Environment variables

VariableDefaultDescription
API_PORT4751Port the API listens on.
PROCESS_DIR/dataContainer path where the media tree is mounted.
GPU_COUNT1Number of GPU slots exposed to the worker queue.
STREAMS_PER_GPU1Concurrent video2x streams per GPU.
FFMPEG_STREAMS1Concurrent FFmpeg workers. On automatic thread count, each encode gets the host's core count divided by this value.
GPU_VENDORemptyHardware encoder for optimize jobs: nvidia, amd, intel, or empty for software encoding.

Mount the media tree read-write here — this is the container that writes the output.

⁠Tags

TagMeaning
latestMost recent release
X.Y.ZExact release, matching the GitHub release
X.YLatest patch of that minor
XLatest release of that major

Keep this image and anime-upscaling-app on the same tag — they are released together.

⁠Security

Do not publish this port. The API has no authentication of its own: the login gate lives in the dashboard, and the API is meant to be reachable only from the internal Compose network.

Tag summary

Content type

Image

Digest

sha256:226959a59…

Size

1.9 GB

Last updated

about 2 months ago

docker pull ivanmicai/anime-upscaling-api