For InstructPix2Pix models, the export script generates four different optimized inference models. The first model is the VAE Decoder, the second model is the UNet, the third model is the CLIP Encoder, and the fourth model is the VAE Encoder.
In the
defaults
section ofconf/config.yaml
, update theexport
field to point to the desired Stable Diffusion inference configuration file. For example, if you want to use theinstruct_pix2pix/export_instruct_pix2pix.yaml
configuration, change theexport
field toinstruct_pix2pix/export_instruct_pix2pix
.defaults: - export: instruct_pix2pix/export_instruct_pix2pix ...
In the
stages
field ofconf/config.yaml
, make sure theexport
stage is included. For example,stages: - export ...
Configure
edit.num_images_per_prompt
of theconf/export/instruct_pix2pix/export_instruct_pix2pix.yaml
file to set the batch_size to use for the ONNX and NVIDIA TensorRT models.Set a path to an example image to use in
edit.input
.
Remarks:
To load a pretrained checkpoint for inference, set the
restore_from_path
field in themodel
section to the path of the pretrained checkpoint in.nemo
format in theconf/export/instruct_pix2pix/export_instruct_pix2pix.yaml
file.