code: def test_stable_diffusion_two_xl_mixture_of_denoiser(self):
      components = self.get_dummy_components()
      pipe_1 = StableDiffusionXLInpaintPipeline(**components).to(
          torch_device
      )
      pipe_1.unet.set_default_attn_processor()
      pipe_2 = StableDiffusionXLInpaintPipeline(**components).to(
          torch_device
      )
      pipe_2.unet.set_default_attn_processor()
  
      def assert_run_mixture(
          num_steps,
          split,
          scheduler_cls_orig,
          num_train_timesteps=pipe_1.scheduler.config.num_train_timesteps,
      ):
          inputs = self.get_dummy_inputs(torch_device)
          inputs["num_inference_steps"] = num_steps
  
          class scheduler_cls(scheduler_cls_orig):
              pass
  
          pipe_1.scheduler = scheduler_cls.from_config(
              pipe_1.scheduler.config
          )
          pipe_2.scheduler = scheduler_cls.from_config(
              pipe_2.scheduler.config
          )
  
          # Let's retrieve the number of timesteps we want to use
          pipe_1.scheduler.set_timesteps(num_steps)
          expected_steps = pipe_1.scheduler.timesteps.tolist()
  
          split_ts = num_train_timesteps - int(
              round(num_train_timesteps * split)
          )
  
          if pipe_1.scheduler.order == 2:
              expected_steps_1 = list(
                  filter(lambda ts: ts >= split_ts, expected_steps)
              )
              expected_steps_2 = expected_steps_1[-1:] + list(
                  filter(lambda ts: ts < split_ts, expected_steps)
              )
              expected_steps = expected_steps_1 + expected_steps_2
          else:
              expected_steps_1 = list(
                  filter(lambda ts: ts >= split_ts, expected_steps)
              )
              expected_steps_2 = list(
                  filter(lambda ts: ts < split_ts, expected_steps)
              )
  
          # now we monkey patch step `done_steps`
          # list into the step function for testing
          done_steps = []
          old_step = copy.copy(scheduler_cls.step)
  
          def new_step(self, *args, **kwargs):
              done_steps.append(
                  args[1].cpu().item()
              )  # args[1] is always the passed `t`
              return old_step(self, *args, **kwargs)
  
          scheduler_cls.step = new_step
  
          inputs_1 = {
              **inputs,
              **{"denoising_end": split, "output_type": "latent"},
          }
          latents = pipe_1(**inputs_1).images[0]
  
          assert (
              expected_steps_1 == done_steps
          ), f"Failure with {scheduler_cls.__name__} and {num_steps} and {split}"
  
          inputs_2 = {
              **inputs,
              **{"denoising_start": split, "image": latents},
          }
          pipe_2(**inputs_2).images[0]
  
          assert expected_steps_2 == done_steps[len(expected_steps_1) :]
          assert (
              expected_steps == done_steps
          ), f"Failure with {scheduler_cls.__name__} and {num_steps} and {split}"
  
      for steps in [5, 8, 20]:
          for split in [0.33, 0.49, 0.71]:
              for scheduler_cls in [
                  DDIMScheduler,
                  EulerDiscreteScheduler,
                  DPMSolverMultistepScheduler,
                  UniPCMultistepScheduler,
                  HeunDiscreteScheduler,
              ]:
                  assert_run_mixture(steps, split, scheduler_cls)
  
imports: import copy
  import random
  import unittest
  import numpy
  import torch
  from PIL import Image
  from transformers import CLIPImageProcessor, CLIPTextConfig, CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer, CLIPVisionConfig, CLIPVisionModelWithProjection
  from diffusers import AutoencoderKL, DDIMScheduler, DPMSolverMultistepScheduler, EulerDiscreteScheduler, HeunDiscreteScheduler, LCMScheduler, StableDiffusionXLInpaintPipeline, UNet2DConditionModel, UniPCMultistepScheduler
  from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, require_torch_gpu, slow, torch_device
  from ..pipeline_params import TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS, TEXT_GUIDED_IMAGE_INPAINTING_PARAMS, TEXT_TO_IMAGE_CALLBACK_CFG_PARAMS
  from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin
label_desc: Use image node_id 15 for calling the StableDiffusionXLInpaintPipelineFastTests obj's underlying member method code with example usage: obj.test_stable_diffusion_two_xl_mixture_of_denoiser() and returns: old_step