Exploring model deployment
In this section, we’ll discuss two basic model deployment examples. They’ll help you create simple, yet functional, proof-of-concept apps for your experiments. Let’s start.
Deploying NN models with Flask
In our first example, we’ll use Google Colab in combination with Flask (https://github.com/pallets/flask) to create a simple hosted REST API service, which will expose our model to the outside world. For the sake of simplicity, we’ll use a stable diffusion (SD) model: it will accept a textual prompt
parameter, generate an image with it, and return the image as a result.
According to its home page, Flask is a lightweight WSGI (https://wsgi.readthedocs.io/) web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. In our case, it will start a development web server, which will process the requests for the SD model. Although this server will...