Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

510 B
Raw Blame
"""Tiny real Spandrel upscalers, for tests that identify or re-identify one from disk."""

from pathlib import Path

from safetensors.torch import save_file
from spandrel.architectures.Compact import Compact


def write_compact_upscaler(path: Path, scale: int) -> Path:
    """Save a minimal Compact (Real-ESRGAN SRVGG) model with the given native scale to `path`."""
    model = Compact(num_in_ch=3, num_out_ch=3, num_feat=8, num_conv=2, upscale=scale)
    save_file(model.state_dict(), path)
    return path