code: def main(cfg):
      callbacks = []
  
      if cfg.model.get("image_logger", None):
          callbacks.append(ImageLogger(**cfg.model.image_logger))
  
      trainer = MegatronControlNetTrainerBuilder(cfg).create_trainer(
          callbacks=callbacks
      )
  
      exp_manager(trainer, cfg.get("exp_manager", None))
  
      model = MegatronControlNet(cfg.model, trainer)
  
      trainer.fit(model)
  
file_path: NeMo/examples/multimodal/text_to_image/controlnet/controlnet_train.py
imports: from pytorch_lightning import Trainer
  from nemo.collections.multimodal.models.text_to_image.controlnet.controlnet import MegatronControlNet
  from nemo.collections.multimodal.models.text_to_image.controlnet.util import ImageLogger
  from nemo.collections.nlp.parts.megatron_trainer_builder import MegatronTrainerBuilder
  from nemo.core.config import hydra_runner
  from nemo.utils.exp_manager import exp_manager
label_desc: Use image node_id 1 for calling a global function with example usage: main(cfg) without return types