code: def sample(
      self,
      p,
      x,
      conditioning,
      unconditional_conditioning,
      steps=None,
      image_conditioning=None,
  ):
      steps = steps or p.steps
  
      sigmas = self.get_sigmas(p, steps)
  
      if opts.sgm_noise_multiplier:
          p.extra_generation_params["SGM noise multiplier"] = True
          x = x * torch.sqrt(1.0 + sigmas[0] ** 2.0)
      else:
          x = x * sigmas[0]
  
      extra_params_kwargs = self.initialize(p)
      parameters = inspect.signature(self.func).parameters
  
      if "n" in parameters:
          extra_params_kwargs["n"] = steps
  
      if "sigma_min" in parameters:
          extra_params_kwargs["sigma_min"] = self.model_wrap.sigmas[
              0
          ].item()
          extra_params_kwargs["sigma_max"] = self.model_wrap.sigmas[
              -1
          ].item()
  
      if "sigmas" in parameters:
          extra_params_kwargs["sigmas"] = sigmas
  
      if self.config.options.get("brownian_noise", False):
          noise_sampler = self.create_noise_sampler(x, sigmas, p)
          extra_params_kwargs["noise_sampler"] = noise_sampler
  
      if self.config.options.get("solver_type", None) == "heun":
          extra_params_kwargs["solver_type"] = "heun"
  
      self.last_latent = x
      self.sampler_extra_args = {
          "cond": conditioning,
          "image_cond": image_conditioning,
          "uncond": unconditional_conditioning,
          "cond_scale": p.cfg_scale,
          "s_min_uncond": self.s_min_uncond,
      }
  
      samples = self.launch_sampling(
          steps,
          lambda: self.func(
              self.model_wrap_cfg,
              x,
              extra_args=self.sampler_extra_args,
              disable=False,
              callback=self.callback_state,
              **extra_params_kwargs,
          ),
      )
  
      if self.model_wrap_cfg.padded_cond_uncond:
          p.extra_generation_params["Pad conds"] = True
  
      return samples
  
file_path: stable-diffusion-webui/modules/sd_samplers_kdiffusion.py
imports: import torch
  import inspect
  import k_diffusion.sampling
  from modules import sd_samplers_common, sd_samplers_extra, sd_samplers_cfg_denoiser
  from modules.sd_samplers_cfg_denoiser import CFGDenoiser
  from modules.script_callbacks import ExtraNoiseParams, extra_noise_callback
  from modules.shared import opts
  import modules.shared
label_desc: Use image node_id 4 for calling the KDiffusionSampler obj's underlying member method code with example usage: obj.sample(p, x, conditioning, unconditional_conditioning, steps, image_conditioning) and returns: samples