Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.55 KB

File metadata and controls

47 lines (30 loc) · 1.55 KB

Latent Diffusion - Inpainting

Input

(Image from https://github.com/CompVis/latent-diffusion/tree/main/data/inpainting_examples)

Output

Usage

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.

Reference

Framework

Pytorch

Model Format

ONNX opset=12

Netron

cond_stage_model.onnx.prototxt
diffusion_model.onnx.prototxt
autoencoder.onnx.prototxt