Skip to content
Eclipse Foundation edited this page Mar 27, 2023 · 6 revisions

Running waifu2x server

Installing waifu2x

Download

See README.md.

Upstart Settings

See appendix/waifu2x.upstart.conf

  1. sudo cp appendix/waifu2x.upstart.conf /etc/init/waifu2x_1
  2. sudo initctl \<start|stop|restart\> waifu2x_1

This upstart script calls /home/ubuntu/waifu2x/appendix/run-web.sh.

run-web.sh <GPU Device ID (start from 0)> <TCP Port Number>.

And, run-web.sh loads ~/.zshrc at first line. If you are using bash or any other shell, please edit that line.

CRON Settings

  1. crontab -e
  2. add */30 * * * * /home/ubuntu/waifu2x/appendix/purge_cache.sh

purge_cache.sh removes image cache in ./cache/. If cache is older than 4 hours, that cache will remove. And, purge_cache.sh loads ~/.zshrc at first line. If you are using bash or any other shell, please edit that line.

nginx Settings

See appendix/waifu2x.nginx.conf.

  1. sudo cp appendix/waifu2x.nginx.conf /etc/nginx/sites-available/waifu2x.udp.jp (fill your domain)
  2. sudo ln -s /etc/nginx/sites-available/waifu2x.udp.jp /etc/nginx/sites-enabled/
  3. sudo service nginx restart

Edit /etc/nginx/sites-available/waifu2x.udp.jp for your env. I recommend to add client_max_body_size 5242880 to nginx.conf. It is file size limits.

Customizing web pages

  1. Edit webgen/templates/index.html.erb
  2. Run ruby webgen/gen.rb
  3. See ./appendix/*.html