code: def log_local(
      self,
      save_dir,
      split,  # The split (train/val) on which to log the images
      images,  # A dictionary of images to log
      global_step,  # The global step
      current_epoch,  # The current epoch.
      batch_idx,
  ):
      # Method for saving image grids to local file system
      root = os.path.join(save_dir, "images", split)
      for k in images:
          grid = torchvision.utils.make_grid(images[k], nrow=4)
          if self.rescale:
              grid = (grid + 1.0) / 2.0  # -1,1 -> 0,1; c,h,w
          grid = grid.transpose(0, 1).transpose(1, 2).squeeze(-1)
          grid = grid.numpy()
          grid = (grid * 255).astype(np.uint8)
          filename = "{}_gs-{:06}_e-{:06}_b-{:06}.png".format(
              k, global_step, current_epoch, batch_idx
          )
          path = os.path.join(root, filename)
          os.makedirs(os.path.split(path)[0], exist_ok=True)
          # Save image grid as PNG file
          Image.fromarray(grid).save(path)
  
imports: import argparse
  import datetime
  import glob
  import os
  import sys
  import time
  from functools import partial
  import lightning.pytorch
  import numpy
  import torch
  import torchvision
  from ldm.models.diffusion.ddpm import LatentDiffusion
  from lightning.pytorch import seed_everything
  from lightning.pytorch.callbacks import Callback, LearningRateMonitor, ModelCheckpoint
  from lightning.pytorch.loggers import TensorBoardLogger, WandbLogger
  from lightning.pytorch.strategies import ColossalAIStrategy, DDPStrategy
  from lightning.pytorch.trainer import Trainer
  from lightning.pytorch.utilities import rank_zero_info, rank_zero_only
  from omegaconf import OmegaConf
  from packaging import version
  from PIL import Image
  from prefetch_generator import BackgroundGenerator
  from torch.utils.data import DataLoader, Dataset
  from ldm.data.base import Txt2ImgIterableBaseDataset
  from ldm.util import instantiate_from_config
label_desc: Use image node_id 3 for calling the ImageLogger obj's underlying member method code with example usage: obj.log_local(save_dir, split, images, global_step, current_epoch, batch_idx) without return types