class_docstr: Pipeline for a bimodal image-text model which supports unconditional text and image generation, text-conditioned
  image generation, image-conditioned text generation, and joint image-text generation.
  
  This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
  implemented for all pipelines (downloading, 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. This
          is part of the UniDiffuser image representation along with the CLIP vision encoding.
      text_encoder ([`CLIPTextModel`]):
          Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
      image_encoder ([`CLIPVisionModel`]):
          A [`~transformers.CLIPVisionModel`] to encode images as part of its image representation along with the VAE
          latent representation.
      image_processor ([`CLIPImageProcessor`]):
          [`~transformers.CLIPImageProcessor`] to preprocess an image before CLIP encoding it with `image_encoder`.
      clip_tokenizer ([`CLIPTokenizer`]):
           A [`~transformers.CLIPTokenizer`] to tokenize the prompt before encoding it with `text_encoder`.
      text_decoder ([`UniDiffuserTextDecoder`]):
          Frozen text decoder. This is a GPT-style model which is used to generate text from the UniDiffuser
          embedding.
      text_tokenizer ([`GPT2Tokenizer`]):
          A [`~transformers.GPT2Tokenizer`] to decode text for text generation; used along with the `text_decoder`.
      unet ([`UniDiffuserModel`]):
          A [U-ViT](https://github.com/baofff/U-ViT) model with UNNet-style skip connections between transformer
          layers to denoise the encoded image latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image and/or text latents. The
          original UniDiffuser paper uses the [`DPMSolverMultistepScheduler`] scheduler.
class_docstr_tok: ["Pipeline","for","a","bimodal","image-text","model","which","supports","unconditional","text","and","image","generation",",","text-conditioned","image","generation",",","image-conditioned","text","generation",",","and","joint","image-text","generation",".","This","model","inherits","from","[","`","DiffusionPipeline","`","]",".","Check","the","superclass","documentation","for","the","generic","methods","implemented","for","all","pipelines","(","downloading",",","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",".","This","is","part","of","the","UniDiffuser","image","representation","along","with","the","CLIP","vision","encoding",".","text_encoder","(","[","`","CLIPTextModel","`","]",")",":","Frozen","text-encoder","(","[","clip-vit-large-patch14","]","(","https",":","\/\/huggingface.co\/openai\/clip-vit-large-patch14",")",")",".","image_encoder","(","[","`","CLIPVisionModel","`","]",")",":","A","[","`","~transformers.CLIPVisionModel","`","]","to","encode","images","as","part","of","its","image","representation","along","with","the","VAE","latent","representation",".","image_processor","(","[","`","CLIPImageProcessor","`","]",")",":","[","`","~transformers.CLIPImageProcessor","`","]","to","preprocess","an","image","before","CLIP","encoding","it","with","`","image_encoder","`",".","clip_tokenizer","(","[","`","CLIPTokenizer","`","]",")",":","A","[","`","~transformers.CLIPTokenizer","`","]","to","tokenize","the","prompt","before","encoding","it","with","`","text_encoder","`",".","text_decoder","(","[","`","UniDiffuserTextDecoder","`","]",")",":","Frozen","text","decoder",".","This","is","a","GPT-style","model","which","is","used","to","generate","text","from","the","UniDiffuser","embedding",".","text_tokenizer","(","[","`","GPT2Tokenizer","`","]",")",":","A","[","`","~transformers.GPT2Tokenizer","`","]","to","decode","text","for","text","generation",";","used","along","with","the","`","text_decoder","`",".","unet","(","[","`","UniDiffuserModel","`","]",")",":","A","[","U-ViT","]","(","https",":","\/\/github.com\/baofff\/U-ViT",")","model","with","UNNet-style","skip","connections","between","transformer","layers","to","denoise","the","encoded","image","latents",".","scheduler","(","[","`","SchedulerMixin","`","]",")",":","A","scheduler","to","be","used","in","combination","with","`","unet","`","to","denoise","the","encoded","image","and\/or","text","latents",".","The","original","UniDiffuser","paper","uses","the","[","`","DPMSolverMultistepScheduler","`","]","scheduler","."]
docstr: Combines a latent image img_vae of shape (B, C, H, W), a CLIP-embedded image img_clip of shape (B, L_img,
  clip_img_dim), and a text embedding text of shape (B, L_text, text_dim) into a single embedding x of shape (B,
  C * H * W + L_img * clip_img_dim + L_text * text_dim).
docstr_tok: ["Combines","a","latent","image","img_vae","of","shape","(","B",",","C",",","H",",","W",")",",","a","CLIP-embedded","image","img_clip","of","shape","(","B",",","L_img",",","clip_img_dim",")",",","and","a","text","embedding","text","of","shape","(","B",",","L_text",",","text_dim",")","into","a","single","embedding","x","of","shape","(","B",",","C","*","H","*","W","+","L_img","*","clip_img_dim","+","L_text","*","text_dim",")","."]
code: def _combine_joint(self, img_vae, img_clip, text):
      r"""
      Combines a latent image img_vae of shape (B, C, H, W), a CLIP-embedded image img_clip of shape (B, L_img,
      clip_img_dim), and a text embedding text of shape (B, L_text, text_dim) into a single embedding x of shape (B,
      C * H * W + L_img * clip_img_dim + L_text * text_dim).
      """
      img_vae = torch.reshape(img_vae, (img_vae.shape[0], -1))
      img_clip = torch.reshape(img_clip, (img_clip.shape[0], -1))
      text = torch.reshape(text, (text.shape[0], -1))
      return torch.concat([img_vae, img_clip, text], dim=-1)
  
imports: import inspect
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection, GPT2Tokenizer
  from ...image_processor import VaeImageProcessor
  from ...loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import USE_PEFT_BACKEND, deprecate, logging, scale_lora_layers, unscale_lora_layers
  from ...utils.outputs import BaseOutput
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline
  from .modeling_text_decoder import UniDiffuserTextDecoder
  from .modeling_uvit import UniDiffuserModel
label_desc: Use image node_id 26 for calling the UniDiffuserPipeline obj's underlying member method code with example usage: obj._combine_joint(img_vae, img_clip, text) and returns: torch