code: def get_discretization_config(params: SamplingParams):
      if params.discretization == Discretization.LEGACY_DDPM:
          discretization_config = {
              "target": "sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization",
          }
      elif params.discretization == Discretization.EDM:
          discretization_config = {
              "target": "sgm.modules.diffusionmodules.discretizer.EDMDiscretization",
              "params": {
                  "sigma_min": params.sigma_min,
                  "sigma_max": params.sigma_max,
                  "rho": params.rho,
              },
          }
      else:
          raise ValueError(
              f"unknown discretization {params.discretization}"
          )
      return discretization_config
  
imports: import pathlib
  from dataclasses import asdict, dataclass
  from enum import Enum
  from typing import Optional
  from omegaconf import OmegaConf
  from sgm.inference.helpers import Img2ImgDiscretizationWrapper, do_img2img, do_sample
  from sgm.modules.diffusionmodules.sampling import DPMPP2MSampler, DPMPP2SAncestralSampler, EulerAncestralSampler, EulerEDMSampler, HeunEDMSampler, LinearMultistepSampler
  from sgm.util import load_model_from_config
label_desc: Use image node_id 2 for calling a global function with example usage: get_discretization_config(params) and returns: discretization_config