Stash Performer Image Upscaler

:placard: Summary Adds an upscale button on the performer page, that upon clicking allows you to select an appriate upcaling model then upscale and update the image.
:link: Repository https://github.com/elkorol/Stash-Userscript-Upscaler/blob/master/upscale.user.js

Stash Userscript Performer Image Upscaler

INSTALL USERSCRIPT

This is a userscript for Stash App, that adds an upscale button on the performer page, that upon clicking allows you to select an appriate upcaling model then upscale and update the image.

It uses UpscalerJS

Upon upscaling please be patient if upscaling an already large image, it may freeze or crash.

Prequisites

Stash updated it’s security policy so it doesn’t work anymore with require lines in the userscript from an external source to the model files. You need to host them yourself using the Custom Served Folders feature in Stash.

Copy the repository with

git clone https://github.com/elkorol/Stash-Userscript-Upscaler.git

I’ve included the model files in this repo for you to use, otherwise you can install the most up to date versions with NPM. I.e.

npm install @upscalerjs/esrgan-slim
npm install @upscalerjs/esrgan-medium
npm install @upscalerjs/esrgan-thick

If using NPM, once you have installed the modules, go into the node_modules folder in the @upscalerjs, copy over the ergsan folders to the models folder for your custom served folders. If needed change the modelNames variable in the script to point to the model.jsons for each model.

Example Add this to config.yml

custom_served_folders:
  /models: {Including drive letter, Path to Stash installation}\custom\models

I.E.

custom_served_folders:
  /models: B:\Stash\custom\models

Usage

Open and copy or load the Javascript into your favourite Userscript Manager, like Tampermonkey or Violent Monkey and change @match to point to the URL of your Stash configuration.