code: def test_stable_diffusion_xl_img2img_prompt_embeds_only(self):
      components = self.get_dummy_components()
      sd_pipe = StableDiffusionXLImg2ImgPipeline(**components)
      sd_pipe = sd_pipe.to(torch_device)
      sd_pipe.set_progress_bar_config(disable=None)
  
      # forward without prompt embeds
      generator_device = "cpu"
      inputs = self.get_dummy_inputs(generator_device)
      inputs["prompt"] = 3 * [inputs["prompt"]]
  
      output = sd_pipe(**inputs)
      image_slice_1 = output.images[0, -3:, -3:, -1]
  
      # forward with prompt embeds
      generator_device = "cpu"
      inputs = self.get_dummy_inputs(generator_device)
      prompt = 3 * [inputs.pop("prompt")]
  
      (
          prompt_embeds,
          _,
          pooled_prompt_embeds,
          _,
      ) = sd_pipe.encode_prompt(prompt)
  
      output = sd_pipe(
          **inputs,
          prompt_embeds=prompt_embeds,
          pooled_prompt_embeds=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 random
  import unittest
  import numpy
  import torch
  from transformers import CLIPTextConfig, CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
  from diffusers import AutoencoderKL, EulerDiscreteScheduler, StableDiffusionXLImg2ImgPipeline, UNet2DConditionModel
  from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, require_torch_gpu, torch_device
  from ..pipeline_params import IMAGE_TO_IMAGE_IMAGE_PARAMS, TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS, TEXT_GUIDED_IMAGE_VARIATION_PARAMS
  from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin
label_desc: Use image node_id 8 for calling the StableDiffusionXLImg2ImgRefinerOnlyPipelineFastTests obj's underlying member method code with example usage: obj.test_stable_diffusion_xl_img2img_prompt_embeds_only() without return types