(click image to enlarge)
This project provides the 2x_AnimeJaNai ONNX upscaling models, along with a custom build of the mpv video player for Windows and Linux. The player upscales 1080p content to 4K in real time by running these models with TensorRT (NVIDIA) or, on Windows, DirectML (AMD or Intel Arc). While the default configuration upscales using the 2x_AnimeJaNai models, it can be customized to use other ONNX upscaling models.
Join the JaNai Discord server to get the latest news, download pre-release and experimental models, get support and ask questions, share your screenshots (use the s key in mpv), or share your feedback. 日本語も大丈夫です。
Ensure your NVIDIA graphics drivers are up to date. Download and extract the latest release archive of mpv-AnimeJaNai. Open the video player at mpvnet.exe. On Linux, download the AppImage or the linux-x64 archive from the same release instead (NVIDIA GPUs only, since DirectML is Windows-only).
On Windows, AMD and Intel Arc GPUs upscale with DirectML, which ships with every install. The player switches to it by itself when TensorRT can't run on your PC; you can also choose the backend in the AnimeJaNai Manager (Ctrl+E).
When playing a video for the first time, a TensorRT engine file will be created for the selected ONNX model. Playback will be paused and a command prompt box will open. Please make sure to wait while the engine is created. Engine creation only needs to happen once per model. Playback will resume on its own when finished.
To confirm upscaling status, press ctrl+J to view upscaling stats. This shows the current profile, and the currently running upscaling models if any.
The player is preconfigured to upscale with the 2x_AnimeJaNai V3.1 models, and makes 3 upscaling profiles available by default. The available profiles are described in more detail below. Any of these profiles can be selected on the fly using the keybinding listed below.
| Profile | Description | Keybinding | Minimum recommended GPU for upscaling 1080p to 4k |
|---|---|---|---|
| Quality | Highest quality model | Shift+1 |
RTX 4090 |
| Balanced | High quality model which trades slight quality for major performance gains | Shift+2 |
RTX 3080 |
| Performance | Fastest performance model which sacrifices a bit more quality | Shift+3 |
RTX 3060 |
The default upscaling profile is the Balanced profile which is recommended for users running an NVIDIA RTX 3080 or higher.
mpv-AnimeJaNai checks for updates on startup. When a newer version is available, an
on-screen message appears; press Ctrl+U (or use the AnimeJaNai > Install Update menu) to install
it. mpv closes, the update is applied in place, and mpv reopens automatically.
Your customizations are preserved across updates: your profiles (animejanai.conf), your mpv
settings in mpv-user.conf, and any ONNX models you added to animejanai/onnx/ are never
overwritten. Most updates are small because the large GPU runtime is only re-downloaded when it
actually changes. (Your previous input.conf is backed up to input.conf.bak-<version> before the
shipped keybindings are refreshed.)
Note for users upgrading from a version before this updater existed: download the latest release once manually; from then on updates are handled in place.
Enable this option in Manager's Profiles tab and restart the player. With a compatible AJN player build, it scans local video timestamps before playback and chooses one display refresh for the whole episode, including across seeks. Fixed-rate videos prefer an exact or near supported multiple. Mixed-rate videos prefer a common multiple of all measured cadences; otherwise, AJN minimizes estimated timing error weighted by each cadence's duration. Unverified inputs use the highest supported progressive refresh at the current resolution.
Playback pauses with a notice before a needed switch and resumes after the
settling interval; manual pauses are preserved. Matching consecutive episodes
retain their rate. Scanning can add startup time, and your TV may briefly go
black during a change. The original refresh is restored at playback end or
normal player exit. The feature is off by default, does not
interpolate video, and does not change your video-sync setting. A display limited
to 60 Hz is supported, though arbitrary VFR cannot always have perfectly even
presentation on a fixed-refresh display. Windows driver/TV switching behavior
still needs testing on your hardware.
The setting requires all three updated components: Manager, the native mpv
player with display-rate-match, and scripts/animejanai_backend.lua.
Upscaling can be further customized using the AnimeJaNai Manager which can be launched by pressing ctrl+E from mpvnet. The Manager allows the setup of up to 9 custom slots and also the use of custom chains, conditional settings based on video resolution and framerate, downscaling to improve performance, and more. The default upscaling profile can also be set in the Manager.
All other mpv settings can be configured by adding them to mpv-upscale-2x_animejanai/portable_config/mpv-user.conf (see the mpv manual for all options). Put your custom mpv options in mpv-user.conf rather than mpv.conf — mpv-user.conf is applied last (so it overrides the defaults) and is never overwritten when you update, so your settings survive upgrades. Likewise, add custom keybindings to mpv-upscale-2x_animejanai/portable_config/input-user.conf (same syntax as input.conf); they override the shipped bindings and are also preserved across updates.
By default, screenshots can be taken with the s key and are stored in mpv-upscale-2x_animejanai/portable_config/screenshots.
The 2x_AnimeJaNai models are a collection of real-time 2x models designed specifically for doubling the resolution of HD and SD anime. The current HD models (V3.1) use the SPAN architecture; the SD V1 beta is a Real-ESRGAN Compact model.
Most HD anime are not produced in native 1080p resolution but rather have a production resolution between 720p and 1080p. When the anime is distributed to consumers via TV broadcast, web streaming, or home video, the video is scaled up to 1080p, leading to scaling artifacts and a loss of image clarity in the source video. The aim of these models is to address these scaling and blur-related issues while upscaling to deliver a result that appears as if the anime was originally mastered in 4K resolution.
The development of the V3 models spanned over seven months, during which over 100 release candidate models were trained and meticulously refined. The V3 models introduce several notable improvements compared to their V2 counterparts, including:
- More faithful appearance to original source
- Improved handling of oversharpening artifacts, ringing, aliasing
- Better at preserving intentional blur in scenes using depth of field
- More accurate line colors, darkness, and thickness
- Better preservation of soft shadow edges
Overall, the V3 models yield significantly more natural and faithful results compared to the V2 models.
2x_AnimeJaNai SD V1 models are in development. The latest release of mpv-AnimeJaNai includes an early beta model for 2x_AnimeJaNai SD V1. While the 2xAnimeJaNai HD models can also work well for some SD sources, those models were specifically trained to upscale HD anime and don't always work well for SD sources. The SD models are designed to upscale SD anime to appear as if the anime was mastered in HD resolution. With sufficient hardware, these models can be stacked with the HD models to upscale SD anime to 4k resolution.
Community benchmarks for many GPUs are at benchmarks.animejan.ai. You can add your own from the AnimeJaNai Manager with Run Benchmarks. Older results are on the wiki.
The 2x_AnimeJaNai ONNX models can be used on a PC with any graphics card to render upscaled videos, even when using graphics cards not fast enough for realtime playback. Please see VideoJaNai to create upscaled video files with a GUI on Windows and Linux. Other options include chaiNNer or VSGAN-tensorrt-docker, which are multiplatform options for Windows and non-Windows users.
- VideoJaNai: Upscale video files
- MangaJaNai GUI: Upscale manga and images
- yosh: Fast manga, comic and image reader
- traiNNer-redux: Train your own upscaling models
- Upscale Wiki and associated Discord server
- 422415 for significant assistance in dataset preparation and continuous feedback during development of V2 models
- Community feedback on V1 models
- MPV_lazy and vs-mlrt
- traiNNer-redux
- Dataset Destroyer
- Real-ESRGAN
- OpenModelDB
- getnative and anibin
- vs_temporalfix by pifroggi: temporal fix models

