Skip to content

Advanced Configuration

k4yt3x edited this page Feb 11, 2022 · 1 revision

This page will cover how Video2X reads the configuration file (video2x.json), how Video2X parses the configuration file, and how to modify the configuration file to suit your needs.

How Video2X Reads the Configuration File

Video2X simply loads the entire configuration JSON file into the program as a dictionary, and passes the sub-dictionary of each component to different modules. For example, /waifu2x_caffe dictionary will be passed to Waifu2xCaffe class if an object of it were to be created.

How Video2X Parse the Configuration File

Video2X converts the configuration file keys and values directly into options or arguments. For example, in the following sample config, --scale_width 1920 will be passed to waifu2x.

"waifu2x_caffe": {
  ...
  "scale_width": null,
  ...
}
  • Keys having a value of null (or false, not recommended as it can mean different things in the future) means to ignore this key, thus ignoring both the key and the value.
  • Keys having a value of true means that this is an option. Only the key will be passed to waifu2x, not the value (e.g. --quiet).

Modifying the Video2X Configuration File

If there are any arguments, options or switches that are not included with Video2X, you can just add a new set of key and value into the configuration file following the format above.

For example, if --waifu [your favorite waifu] has been added to, say, waifu2x-converter-cpp, you can append the following into the configuration file to pass --waifu "Gasai Yuno" to waifu2x-converter-cpp.

"waifu2x_converter": {
  ...
  "waifu": "Gasai Yuno",
  ...
}