class_docstr: Pipeline for text-to-image generation using PixArt-Alpha.
  
  This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
  library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
      text_encoder ([`T5EncoderModel`]):
          Frozen text-encoder. PixArt-Alpha uses
          [T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel), specifically the
          [t5-v1_1-xxl](https://huggingface.co/PixArt-alpha/PixArt-alpha/tree/main/t5-v1_1-xxl) variant.
      tokenizer (`T5Tokenizer`):
          Tokenizer of class
          [T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer).
      transformer ([`Transformer2DModel`]):
          A text conditioned `Transformer2DModel` to denoise the encoded image latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `transformer` to denoise the encoded image latents.
class_docstr_tok: ["Pipeline","for","text-to-image","generation","using","PixArt-Alpha",".","This","model","inherits","from","[","`","DiffusionPipeline","`","]",".","Check","the","superclass","documentation","for","the","generic","methods","the","library","implements","for","all","the","pipelines","(","such","as","downloading","or","saving",",","running","on","a","particular","device",",","etc",".",")","Args",":","vae","(","[","`","AutoencoderKL","`","]",")",":","Variational","Auto-Encoder","(","VAE",")","Model","to","encode","and","decode","images","to","and","from","latent","representations",".","text_encoder","(","[","`","T5EncoderModel","`","]",")",":","Frozen","text-encoder",".","PixArt-Alpha","uses","[","T5","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/t5","#","transformers.T5EncoderModel",")",",","specifically","the","[","t5-v1_1-xxl","]","(","https",":","\/\/huggingface.co\/PixArt-alpha\/PixArt-alpha\/tree\/main\/t5-v1_1-xxl",")","variant",".","tokenizer","(","`","T5Tokenizer","`",")",":","Tokenizer","of","class","[","T5Tokenizer","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/t5","#","transformers.T5Tokenizer",")",".","transformer","(","[","`","Transformer2DModel","`","]",")",":","A","text","conditioned","`","Transformer2DModel","`","to","denoise","the","encoded","image","latents",".","scheduler","(","[","`","SchedulerMixin","`","]",")",":","A","scheduler","to","be","used","in","combination","with","`","transformer","`","to","denoise","the","encoded","image","latents","."]
code: def prepare_latents(
      self,
      batch_size,
      num_channels_latents,
      height,
      width,
      dtype,
      device,
      generator,
      latents=None,
  ):
      shape = (
          batch_size,
          num_channels_latents,
          height // self.vae_scale_factor,
          width // self.vae_scale_factor,
      )
      if isinstance(generator, list) and len(generator) != batch_size:
          raise ValueError(
              f"You have passed a list of generators of length {len(generator)}, but requested an effective batch"
              f" size of {batch_size}. Make sure the batch size matches the length of the generators."
          )
  
      if latents is None:
          latents = randn_tensor(
              shape, generator=generator, device=device, dtype=dtype
          )
      else:
          latents = latents.to(device)
  
      # scale the initial noise by the standard deviation required by the scheduler
      latents = latents * self.scheduler.init_noise_sigma
      return latents
  
imports: import html
  import inspect
  import re
  import urllib.parse
  from typing import Callable, List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from transformers import T5EncoderModel, T5Tokenizer
  from ...image_processor import VaeImageProcessor
  from ...models import AutoencoderKL, Transformer2DModel
  from ...schedulers import DPMSolverMultistepScheduler
  from ...utils import BACKENDS_MAPPING, deprecate, is_bs4_available, is_ftfy_available, logging, replace_example_docstring
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
label_desc: Use image node_id 8 for calling the PixArtAlphaPipeline obj's underlying member method code with example usage: obj.prepare_latents(batch_size, num_channels_latents, height, width, dtype, device, generator, latents) and returns: latents