code: def perform_save_locally(save_path, samples):
      os.makedirs(os.path.join(save_path), exist_ok=True)
      base_count = len(os.listdir(os.path.join(save_path)))
      samples = embed_watermark(samples)
      for sample in samples:
          sample = 255.0 * rearrange(
              sample.cpu().numpy(), "c h w -> h w c"
          )
          Image.fromarray(sample.astype(np.uint8)).save(
              os.path.join(save_path, f"{base_count:09}.png")
          )
          base_count += 1
  
imports: import math
  import os
  from typing import List, Optional, Union
  import numpy
  import torch
  from einops import rearrange
  from imwatermark import WatermarkEncoder
  from omegaconf import ListConfig
  from PIL import Image
  from torch import autocast
  from sgm.util import append_dims
label_desc: Use image node_id 2 for calling a global function with example usage: perform_save_locally(save_path, samples) without return types