docstr: For DPM++ SDE: manually create noise sampler to enable deterministic results across different batch sizes
docstr_tok: ["For","DPM++","SDE",":","manually","create","noise","sampler","to","enable","deterministic","results","across","different","batch","sizes"]
code: def create_noise_sampler(self, x, sigmas, p):
      """For DPM++ SDE: manually create noise sampler to enable deterministic results across different batch sizes"""
      if shared.opts.no_dpmpp_sde_batch_determinism:
          return None
  
      from k_diffusion.sampling import BrownianTreeNoiseSampler
  
      sigma_min, sigma_max = sigmas[sigmas > 0].min(), sigmas.max()
      current_iter_seeds = p.all_seeds[
          p.iteration * p.batch_size : (p.iteration + 1) * p.batch_size
      ]
      return BrownianTreeNoiseSampler(
          x, sigma_min, sigma_max, seed=current_iter_seeds
      )
  
imports: import inspect
  from collections import namedtuple
  import numpy
  import torch
  from PIL import Image
  from modules import devices, images, sd_vae_approx, sd_samplers, sd_vae_taesd, shared, sd_models
  from modules.shared import opts, state
  import k_diffusion.sampling
label_desc: Use image node_id 6 for calling the Sampler obj's underlying member method code with example usage: obj.create_noise_sampler(x, sigmas, p) and returns: BrownianTreeNoiseSampler, None