Important
NeMo 2.0 is an experimental feature and currently released in the dev container only:
nvcr.io/nvidia/nemo:dev. Please refer to NeMo 2.0 overview for information on getting started.
Run NeMo 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, change the settings in the configuration files:
In the
defaultssection ofconf/config.yaml, update thefw_inferencefield to point to the desired Stable Diffusion inference configuration file. For example, if you want to use thestable_diffusion/text2img.yamlconfiguration, change thefw_inferencefield tostable_diffusion/text2img. For sdxl inference, change the field tosdxl/sdxl_infer.defaults: - fw_inference: stable_diffusion/text2img ...
In the
stagesfield ofconf/config.yaml, make sure thefw_inferencestage is included. For example,stages: - fw_inference ...
Configure
promptsandnum_images_per_promptfields ofconf/fw_inference/stable_diffusion/text2img.yaml. Setmodel.restore_from_pathto the.nemockpt you want generate images with.
Remarks:
We support three types of inference samplers, ‘DDIM’, ‘PLMS’ and ‘DPM’, which can be changed in the config files. The ‘DPM’ sampler is added in recent updates. It is able to achieve similar image quality with half the number of steps needed for inference.