code: def test_sdxl_with_refiner(
      self,
      sdxl_pipelines: Tuple[SamplingPipeline, SamplingPipeline],
      sampler_enum,
      use_init_image,
  ):
      base_pipeline, refiner_pipeline = sdxl_pipelines
      if use_init_image:
          output = base_pipeline.image_to_image(
              params=SamplingParams(
                  sampler=sampler_enum.value, steps=10
              ),
              image=self.create_init_image(
                  base_pipeline.specs.height, base_pipeline.specs.width
              ),
              prompt="A professional photograph of an astronaut riding a pig",
              negative_prompt="",
              samples=1,
              return_latents=True,
          )
      else:
          output = base_pipeline.text_to_image(
              params=SamplingParams(
                  sampler=sampler_enum.value, steps=10
              ),
              prompt="A professional photograph of an astronaut riding a pig",
              negative_prompt="",
              samples=1,
              return_latents=True,
          )
  
      assert isinstance(output, (tuple, list))
      samples, samples_z = output
      assert samples is not None
      assert samples_z is not None
      refiner_pipeline.refiner(
          params=SamplingParams(sampler=sampler_enum.value, steps=10),
          image=samples_z,
          prompt="A professional photograph of an astronaut riding a pig",
          negative_prompt="",
          samples=1,
      )
  
file_path: generative-models/tests/inference/test_inference.py
imports: import numpy
  from PIL import Image
  import pytest
  from pytest import fixture
  import torch
  from typing import Tuple
  from sgm.inference.api import model_specs, SamplingParams, SamplingPipeline, Sampler, ModelArchitecture
  import sgm.inference.helpers
label_desc: Use image node_id 6 for calling the TestInference obj's underlying member method code with example usage: obj.test_sdxl_with_refiner(sdxl_pipelines, sampler_enum, use_init_image) without return types