Image-to-Image Models
This notebook will go over image-to-image models, which are diffusion models that take in text as input and output image(s)
Base Models
Let’s first see how we can generate images with Stable Diffusion XL:
All parameters are optional other than prompt
. For more information on base models offered, see here.
Custom Models
Next, let’s see how we can generate images with custom models made on Flush:
We get an array of image links as output.
All parameters are optional other than prompt
and model_id
. For more information on how to create custom models to deploy, see here.
Upscalers
Now, let’s see how we can use upscalers to improve the quality of images in Flush. Currently, we only support the REALEsrgan upscaler. This can be initialized as follows:
The RealESRGAN upscaler supports scales of either 2, 4, or 8. We can then call the model with the following:
We get an array of one image as output (to keep consistency). image
is the only parameter in the generate function for upscalers.
DALLE
Flush also supports interaction with DALLE-2. In this case, we use DALLE’s image generation endpoint. We show an example of this below:
It is important to note that DALLE only supports image sizes 256x256, 512x512, or 1024x1024. All parameters are optional other than prompt
.