code: def main(cfg):
      def model_cfg_modifier(model_cfg):
          model_cfg.precision = cfg.trainer.precision
          model_cfg.ckpt_path = None
          model_cfg.inductor = False
          model_cfg.unet_config.from_pretrained = None
          model_cfg.first_stage_config.from_pretrained = None
          model_cfg.control_stage_config.from_pretrained_unet = None
          model_cfg.channels_last = True
          model_cfg.capture_cudagraph_iters = -1
  
      torch.backends.cuda.matmul.allow_tf32 = True
      (
          trainer,
          megatron_diffusion_model,
      ) = setup_trainer_and_model_for_inference(
          model_provider=MegatronControlNet,
          cfg=cfg,
          model_cfg_modifier=model_cfg_modifier,
      )
      model = megatron_diffusion_model.model
      model.cuda().eval()
  
      guess_mode = cfg.model.guess_mode
      model.contol_scales = (
          [
              cfg.model.strength * (0.825 ** float(12 - i))
              for i in range(13)
          ]
          if guess_mode
          else ([cfg.model.strength] * 13)
      )
  
      rng = torch.Generator().manual_seed(cfg.infer.seed)
      pipeline(model, cfg, rng=rng)
  
file_path: NeMo/examples/multimodal/text_to_image/controlnet/controlnet_infer.py
imports: import os
  import time
  import cv2
  import einops
  import torch
  from PIL import Image
  from nemo.collections.multimodal.models.text_to_image.controlnet import get_preprocessing_function
  from nemo.collections.multimodal.models.text_to_image.controlnet.controlnet import MegatronControlNet
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.ddim import DDIMSampler
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.plms import PLMSSampler
  from nemo.collections.multimodal.parts.utils import setup_trainer_and_model_for_inference
  from nemo.core.config import hydra_runner
label_desc: Use image node_id 8 for calling a global function with example usage: main(cfg) without return types