Giter Site home page Giter Site logo

esrgan-bot's Introduction

ESRGAN-Bot

NOTE: This hasn't been super actively maintained for a while. If you plan on running this yourself keep in mind that I have a few things hardcoded and once discord enforces slash commands, this bot will no longer work.

A Discord bot for upscaling images with ESRGAN (and variations including ESRGAN+, RealSR, BSRGAN, Real-ESRGAN), plus a little more.

This version of the bot is a complete rewrite in python using Discord.py and the original source code by Xinntao, along with modifications from BlueAmulet's fork.

All credit to the original ESRGAN repository goes to Xinntao, and all credit to the original modifications goes to BlueAmulet.

Also many thanks to the GameUpscale Discord server for helping me test out this rewrite and for using the bot every day :)

You can see a working version of this bot in the GameUpscale discord server here: https://discord.gg/VR9SzTT

Setup

Installation

Extract this repo to a directory of your choice, open powershell/cmd in that directory.

OPTIONAL: Setup a python virtual environment: py -m venv venv

OPTIONAL: Enable the virtual environment:

  • Windows: venv/scripts/activate
  • Linux: source venv/bin/activate

Install requirements: pip install -r requirements.txt If not using a virtual environment, use pip3 instead of pip.

Visit the PyTorch website and generate the correct command for your system. For Package hit "Pip", for Language hit "Python". If you are using a modern Nvidia card with up-to-date drivers select the latest CUDA for Compute Platform. If using AMD or no GPU at all, hit CPU instead. Copy the command generated (change pip3 to pip if using virtual environment), run it in terminal, installation complete!

Configuration

Rename or copy the "config.yml.dist" file to "config.yml".

Edit this file appropriately:

  • bot_token is the client token of your Discord bot.
  • bot_prefix is the prefix that will be used on all the bot's commands.
  • img_size_cutoff is the maximum resolution that you will allow someone to submit to the bot to avoid extended upscaling times.
  • moderator_role_id is the role id (can also be the name of the role) that will be allowed to run certain restricted commands.
  • global_guild_block, keep this false if you want the bot to be able to run in any server.

Models

Create a directory called models inside this directory, and place any models you want accessible to the bot in this folder.

Running the bot

Run testbot.py like you would any other python script.

esrgan-bot's People

Contributors

joeyballentine avatar investigamer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.