code: def test_alt_diffusion(self):
      # make sure here that pndm scheduler skips prk
      alt_pipe = AltDiffusionPipeline.from_pretrained(
          "BAAI/AltDiffusion", safety_checker=None
      )
      alt_pipe = alt_pipe.to(torch_device)
      alt_pipe.set_progress_bar_config(disable=None)
  
      prompt = "A painting of a squirrel eating a burger"
      generator = torch.manual_seed(0)
      output = alt_pipe(
          [prompt],
          generator=generator,
          guidance_scale=6.0,
          num_inference_steps=20,
          output_type="np",
      )
  
      image = output.images
  
      image_slice = image[0, -3:, -3:, -1]
  
      assert image.shape == (1, 512, 512, 3)
      expected_slice = np.array(
          [
              0.1010,
              0.0800,
              0.0794,
              0.0885,
              0.0843,
              0.0762,
              0.0769,
              0.0729,
              0.0586,
          ]
      )
  
      assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
  
imports: import gc
  import unittest
  import numpy
  import torch
  from transformers import CLIPTextConfig, CLIPTextModel, XLMRobertaTokenizer
  from diffusers import AltDiffusionPipeline, AutoencoderKL, DDIMScheduler, PNDMScheduler, UNet2DConditionModel
  from diffusers.pipelines.alt_diffusion.modeling_roberta_series import RobertaSeriesConfig, RobertaSeriesModelWithTransformation
  from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, torch_device
  from ..pipeline_params import 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 2 for calling the AltDiffusionPipelineIntegrationTests obj's underlying member method code with example usage: obj.test_alt_diffusion() without return types