Skip to main content

Usage with Script Tag

View this page on the UpscalerJS website

Demonstrates installing UpscalerJS with a script tag.

Open example in Codesandbox.

Overview

This guide is identical to the basic NPM example, except that instead of UpscalerJS being installed via NPM, it is instead imported via a script tag.

Script tags can be added like this:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@upscalerjs/default-model@latest/dist/umd/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/upscaler@latest/dist/browser/umd/upscaler.min.js"></script>

When using UpscalerJS via a script tag, we must specify a model to use. In this example, we're using the default-model:

const upscaler = new Upscaler({
model: DefaultUpscalerJSModel,
})

Read more about models in the next guide.