code: def test_mlsd(self):
      controlnet = ControlNetModel.from_pretrained(
          "lllyasviel/sd-controlnet-mlsd"
      )
  
      pipe = StableDiffusionControlNetPipeline.from_pretrained(
          "runwayml/stable-diffusion-v1-5",
          safety_checker=None,
          controlnet=controlnet,
      )
      pipe.enable_model_cpu_offload()
      pipe.set_progress_bar_config(disable=None)
  
      generator = torch.Generator(device="cpu").manual_seed(0)
      prompt = "room"
      image = load_image(
          "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/room_mlsd.png"
      )
  
      output = pipe(
          prompt,
          image,
          generator=generator,
          output_type="np",
          num_inference_steps=3,
      )
  
      image = output.images[0]
  
      assert image.shape == (704, 512, 3)
  
      expected_image = load_numpy(
          "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/room_mlsd_out.npy"
      )
  
      assert np.abs(expected_image - image).max() < 5e-2
  
imports: import gc
  import tempfile
  import traceback
  import unittest
  import numpy
  import torch
  from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
  from diffusers import AutoencoderKL, ControlNetModel, DDIMScheduler, EulerDiscreteScheduler, StableDiffusionControlNetPipeline, UNet2DConditionModel
  from diffusers.pipelines.controlnet.pipeline_controlnet import MultiControlNetModel
  from diffusers.utils.import_utils import is_xformers_available
  from diffusers.utils.testing_utils import enable_full_determinism, load_image, load_numpy, require_python39_or_higher, require_torch_2, require_torch_gpu, run_test_in_subprocess, slow, torch_device
  from diffusers.utils.torch_utils import randn_tensor
  from ..pipeline_params import IMAGE_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
  from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin
label_desc: Use image node_id 5 for calling the ControlNetPipelineSlowTests obj's underlying member method code with example usage: obj.test_mlsd() without return types