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.
Framework Inference
For ControlNet, the inference script generates images from text prompts defined in the config file. Note that, an image conditioning is required besides text prompt.
To enable the inference stage with ControlNet, configure the configuration files:
In the
defaultssection ofconf/config.yaml, update thefw_inferencefield to point to the desired DreamBooth inference configuration file. For example, if you want to use thecontrolnet/controlnet_infer.yamlconfiguration, change thefw_inferencefield tocontrolnet/controlnet_infer.defaults: - fw_inference: controlnet/controlnet_infer ...
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/controlnet/controlnet_infer.yaml. Setmodel.restore_from_pathto the ckpt generated from dreambooth training.
Remarks:
We have implemented an example processing function to extract segmentation map from a target image, and use that as the
conditioning to generate images. To utilize that function, please specify infer.control_image_preprocess=seg2img. In other use cases, the input image specified at infer.control should be the conditioning image
instead of target image, and set infer.control_image_preprocess=null.