code: def __init__(self, models: List[Imagen], text_encoder, cfg, device):
      self.models = [model.to(device) for model in models]
      self.text_encoder = text_encoder.to(device)
      self.cfg = cfg
      self.device = device
  
imports: import os
  import time
  from dataclasses import dataclass, field
  from typing import Callable, List, Optional, Union
  import torch
  from omegaconf.omegaconf import OmegaConf
  from pytorch_lightning import Trainer
  from torch.cuda.amp import autocast
  from nemo.collections.multimodal.models.text_to_image.imagen.imagen import Imagen, MegatronImagen
  from nemo.collections.multimodal.parts.utils import numpy_to_pil, setup_trainer_and_models_for_inference
label_desc: Use image node_id 1 to create a new ImagenPipeline object from inherited base classes: Callable with example: obj = ImagenPipeline(models, text_encoder, cfg, device)