code: def test_stable_diffusion_xl_prompt_embeds(self):
      components = self.get_dummy_components()
      sd_pipe = self.pipeline_class(**components)
      sd_pipe = sd_pipe.to(torch_device)
      sd_pipe = sd_pipe.to(torch_device)
      sd_pipe.set_progress_bar_config(disable=None)
  
      # forward without prompt embeds
      inputs = self.get_dummy_inputs(torch_device)
      inputs["prompt"] = 2 * [inputs["prompt"]]
      inputs["num_images_per_prompt"] = 2
  
      output = sd_pipe(**inputs)
      image_slice_1 = output.images[0, -3:, -3:, -1]
  
      # forward with prompt embeds
      inputs = self.get_dummy_inputs(torch_device)
      prompt = 2 * [inputs.pop("prompt")]
  
      (
          prompt_embeds,
          negative_prompt_embeds,
          pooled_prompt_embeds,
          negative_pooled_prompt_embeds,
      ) = sd_pipe.encode_prompt(prompt)
  
      output = sd_pipe(
          **inputs,
          prompt_embeds=prompt_embeds,
          negative_prompt_embeds=negative_prompt_embeds,
          pooled_prompt_embeds=pooled_prompt_embeds,
          negative_pooled_prompt_embeds=negative_pooled_prompt_embeds,
      )
      image_slice_2 = output.images[0, -3:, -3:, -1]
  
      # make sure that it's equal
      assert (
          np.abs(
              image_slice_1.flatten() - image_slice_2.flatten()
          ).max()
          < 1e-4
      )
  
imports: import gc
  import unittest
  import numpy
  import torch
  from transformers import CLIPTextConfig, CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
  from diffusers import AutoencoderKL, ControlNetModel, EulerDiscreteScheduler, LCMScheduler, StableDiffusionXLControlNetPipeline, UNet2DConditionModel
  from diffusers.models.unet_2d_blocks import UNetMidBlock2D
  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, require_torch_gpu, 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, SDXLOptionalComponentsTesterMixin
label_desc: Use image node_id 9 for calling the StableDiffusionXLControlNetPipelineFastTests obj's underlying member method code with example usage: obj.test_stable_diffusion_xl_prompt_embeds() without return types