Can I run upscales with the python script

I want to bypass UI and run upscale directly through a script or a python command. That way I can implement it in my image generation process and send them to upscale right away. Can I do this somehow?