(Image from https://github.com/CompVis/latent-diffusion/tree/main/data/inpainting_examples)
Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.
For the sample image,
$ python3 latent-diffusion-inpainting.py
If you want to specify the input image, put the image path after the --input
option.
You can use --savepath
option to change the name of the output file to save.
$ python3 latent-diffusion-inpainting.py --input IMAGE_PATH --savepath SAVE_IMAGE_PATH
The inpainting sample code requires two input files, image file *.png
and mask file <image_fname>_mask.png
.
The mask file is automatically selected depending on the filename of the image file.
Pytorch
ONNX opset=12
cond_stage_model.onnx.prototxt
diffusion_model.onnx.prototxt
autoencoder.onnx.prototxt