Skip to content

[OLD] How to Upscale a Video Using chaiNNer (Step by Step)

Sirosky edited this page Jan 14, 2024 · 1 revision

Introduction

This guide is directed towards complete beginners that have never upscaled a video in their life. The objective of this guide is to keep things as simple as possible. As a result, there will be more complicated concepts and methodologies that are out of scope here.

This guide only covers the use of chaiNNer for upscaling. enhancr is a great option as well. Refer to the Picking Between chaiNNer and enhancr page for a discussion of which to pick.

Prerequisites

A computer not from the stone ages. That being said, having a good GPU, especially a modern nvidia GPU, will help substantially with the inference speed.

Setup

  1. Download and install chaiNNer from chainner.app.
  2. Once installed, launch chaiNNer and hit the Manage Dependencies button. image
  3. Download any missing dependencies. image
  4. Open Settings (right next to the Manage Dependencies button) > Python > Pytorch > turn on FP16 if isn't on already. Do the same in the ONNX tab. image

Create a Chain

  1. chaiNNer has a node-based interface. While it's not too hard to get started, we already have pre-made chains (chains are for upscaling videos so why reinvent the wheel? We'll be downloading chains created by fellow community member Kim2091. If you have a nvidia GPU, download this chain. If you have an AMD GPU or Intel GPU, download this chain. To download, just hit the button on the top right. image

  2. Open the chain in chaiNNer, or drag in the .chn file into chaiNNer.

  3. You should be greeted with something like this. image

  4. The next step is to actually find a model to upscale with!

Finding the Right Model

  • A quick, oversimplified primer on models. Models are essentially instructions that tell the computer how to upscale or restore an image. All models are locked in scale, with most video models being 2x (that is, doubling the video resolution), and some being 4x.
  • Selecting a good model for the source is very important. For example, if you instructed someone on how to draw a cartoon, you wouldn't give them those same instructions to draw a realistic image.
  1. The vast majority of models can be found on OpenModelDB. You can filter and sort to your heart's content. But for simplicity's sake, I'll assume you're upscaling a modern anime. To that end, download Ani4K.
  2. The download should be a file with the extension .pth. If you have a nvidia GPU, you can continue to the next step. If you have an AMD GPU or Intel GPU, please refer to the Converting the Model section first.

Actually Upscaling!

  1. Remember the chain that we downloaded and opened in chaiNNer? Well we're in the final stage now. Return to the chain you opened up in chaiNNer.
  2. First, select the video you actually want to upscale. Then drag in the model file into the Load Model node. The Load Model node might be a different color depending on which chain you downloaded. image
  3. If the model is loaded, it should look something like this. image
  4. Feel free to tweak the encoding options in the Write Output Frame node, but encoding is a whole other can of worms I don't want to get into here. Hit the big green button on the top, and it'll begin upscaling if everything was set up properly. image
  5. Wait for it to finish processing, and once it's done, you should see the output in the base directory the original video was located at.

Converting the Model (for AMD GPUs or Intel GPUs)

  1. AMD GPUs and Intel GPUs do not work with Pytorch models in chaiNNer, and as most models are distributed in Pytorch form (.pth extension) AMD / Intel GPU users will have to use NCNN.
  2. Fortunately, converting a Pytorch model to NCNN is easily done in chaiNNer, as shown below. Simply download this chain, and drag in the .pth model for conversion.
  3. Hit the big green button to proceed with the conversion. image
  4. Once converted, return to the Actually Upscaling! section and we can get to to the fun part. :)