Framework Inference
For text-to-image models, the inference script generates images from text prompts defined in the config file.
To enable the inference stage with Stable Diffusion, configure the configuration files:
In the
defaults
section ofconf/config.yaml
, update thefw_inference
field to point to the desired Stable Diffusion inference configuration file. For example, if you want to use thestable_diffusion/text2img.yaml
configuration, change thefw_inference
field tostable_diffusion/text2img
.defaults: - fw_inference: stable_diffusion/text2img ...
In the
stages
field ofconf/config.yaml
, make sure thefw_inference
stage is included. For example,stages: - fw_inference ...
Configure
prompts
andnum_images_per_prompt
fields ofconf/fw_inference/stable_diffusion/text2img.yaml
. Setmodel.restore_from_path
to the.nemo
ckpt you want generate images with.
Remarks:
We have supported three types of inference samplers, ‘DDIM’, ‘PLMS’ and ‘DPM’, which can be changed by from config files. ‘DPM’ sampler is added in recent updates and able to achieve similar image quality with half of steps needed for inference.