code: def convsample_ddim(
      model,
      cond,
      steps,
      shape,
      eta=1.0,
      callback=None,
      normals_sequence=None,
      mask=None,
      x0=None,
      quantize_x0=False,
      temperature=1.0,
      score_corrector=None,
      corrector_kwargs=None,
      x_t=None,
  ):
      ddim = DDIMSampler(model)
      bs = shape[0]
      shape = shape[1:]
      print(f"Sampling with eta = {eta}; steps: {steps}")
      samples, intermediates = ddim.sample(
          steps,
          batch_size=bs,
          shape=shape,
          conditioning=cond,
          callback=callback,
          normals_sequence=normals_sequence,
          quantize_x0=quantize_x0,
          eta=eta,
          mask=mask,
          x0=x0,
          temperature=temperature,
          verbose=False,
          score_corrector=score_corrector,
          corrector_kwargs=corrector_kwargs,
          x_t=x_t,
      )
  
      return samples, intermediates
  
imports: import os
  import gc
  import time
  import numpy
  import torch
  import torchvision
  from PIL import Image
  from einops import rearrange, repeat
  from omegaconf import OmegaConf
  import safetensors.torch
  from ldm.models.diffusion.ddim import DDIMSampler
  from ldm.util import instantiate_from_config, ismap
  from modules import shared, sd_hijack, devices
label_desc: Use image node_id 2 for calling a global function with example usage: convsample_ddim(model, cond, steps, shape, eta, callback, normals_sequence, mask, x0, quantize_x0, temperature, score_corrector, corrector_kwargs, x_t) and returns: samples,  intermediates