class_docstr: Pipeline for text-to-image generation using Stable Diffusion XL and k-diffusion.
  
  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.)
  
  The pipeline also inherits the following loading methods:
      - [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
      - [`~loaders.FromSingleFileMixin.from_single_file`] for loading `.ckpt` files
      - [`~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights`] for loading LoRA weights
      - [`~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights`] for saving LoRA weights
      - [`~loaders.IPAdapterMixin.load_ip_adapter`] for loading IP Adapters
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
      text_encoder ([`CLIPTextModel`]):
          Frozen text-encoder. Stable Diffusion XL uses the text portion of
          [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), specifically
          the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
      text_encoder_2 ([` CLIPTextModelWithProjection`]):
          Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
          [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection),
          specifically the
          [laion/CLIP-ViT-bigG-14-laion2B-39B-b160k](https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k)
          variant.
      tokenizer (`CLIPTokenizer`):
          Tokenizer of class
          [CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
      tokenizer_2 (`CLIPTokenizer`):
          Second Tokenizer of class
          [CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
      unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
          [`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
      force_zeros_for_empty_prompt (`bool`, *optional*, defaults to `"True"`):
          Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
          `stabilityai/stable-diffusion-xl-base-1-0`.
class_docstr_tok: ["Pipeline","for","text-to-image","generation","using","Stable","Diffusion","XL","and","k-diffusion",".","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",".",")","The","pipeline","also","inherits","the","following","loading","methods",":","-","[","`","~loaders.TextualInversionLoaderMixin.load_textual_inversion","`","]","for","loading","textual","inversion","embeddings","-","[","`","~loaders.FromSingleFileMixin.from_single_file","`","]","for","loading","`",".ckpt","`","files","-","[","`","~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights","`","]","for","loading","LoRA","weights","-","[","`","~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights","`","]","for","saving","LoRA","weights","-","[","`","~loaders.IPAdapterMixin.load_ip_adapter","`","]","for","loading","IP","Adapters","Args",":","vae","(","[","`","AutoencoderKL","`","]",")",":","Variational","Auto-Encoder","(","VAE",")","Model","to","encode","and","decode","images","to","and","from","latent","representations",".","text_encoder","(","[","`","CLIPTextModel","`","]",")",":","Frozen","text-encoder",".","Stable","Diffusion","XL","uses","the","text","portion","of","[","CLIP","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/clip","#","transformers.CLIPTextModel",")",",","specifically","the","[","clip-vit-large-patch14","]","(","https",":","\/\/huggingface.co\/openai\/clip-vit-large-patch14",")","variant",".","text_encoder_2","(","[","`","CLIPTextModelWithProjection","`","]",")",":","Second","frozen","text-encoder",".","Stable","Diffusion","XL","uses","the","text","and","pool","portion","of","[","CLIP","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/clip","#","transformers.CLIPTextModelWithProjection",")",",","specifically","the","[","laion\/CLIP-ViT-bigG-14-laion2B-39B-b160k","]","(","https",":","\/\/huggingface.co\/laion\/CLIP-ViT-bigG-14-laion2B-39B-b160k",")","variant",".","tokenizer","(","`","CLIPTokenizer","`",")",":","Tokenizer","of","class","[","CLIPTokenizer","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/v4.21.0\/en\/model_doc\/clip","#","transformers.CLIPTokenizer",")",".","tokenizer_2","(","`","CLIPTokenizer","`",")",":","Second","Tokenizer","of","class","[","CLIPTokenizer","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/v4.21.0\/en\/model_doc\/clip","#","transformers.CLIPTokenizer",")",".","unet","(","[","`","UNet2DConditionModel","`","]",")",":","Conditional","U-Net","architecture","to","denoise","the","encoded","image","latents",".","scheduler","(","[","`","SchedulerMixin","`","]",")",":","A","scheduler","to","be","used","in","combination","with","`","unet","`","to","denoise","the","encoded","image","latents",".","Can","be","one","of","[","`","DDIMScheduler","`","]",",","[","`","LMSDiscreteScheduler","`","]",",","or","[","`","PNDMScheduler","`","]",".","force_zeros_for_empty_prompt","(","`","bool","`",",","*","optional","*",",","defaults","to","`","``","True","''","`",")",":","Whether","the","negative","prompt","embeddings","shall","be","forced","to","always","be","set","to","0",".","Also","see","the","config","of","`","stabilityai\/stable-diffusion-xl-base-1-0","`","."]
code: def check_inputs(
      self,
      prompt,
      prompt_2,
      height,
      width,
      negative_prompt=None,
      negative_prompt_2=None,
      prompt_embeds=None,
      negative_prompt_embeds=None,
      pooled_prompt_embeds=None,
      negative_pooled_prompt_embeds=None,
  ):
      if height % 8 != 0 or width % 8 != 0:
          raise ValueError(
              f"`height` and `width` have to be divisible by 8 but are {height} and {width}."
          )
  
      if prompt is not None and prompt_embeds is not None:
          raise ValueError(
              f"Cannot forward both `prompt`: {prompt} and `prompt_embeds`: {prompt_embeds}. Please make sure to"
              " only forward one of the two."
          )
      elif prompt_2 is not None and prompt_embeds is not None:
          raise ValueError(
              f"Cannot forward both `prompt_2`: {prompt_2} and `prompt_embeds`: {prompt_embeds}. Please make sure to"
              " only forward one of the two."
          )
      elif prompt is None and prompt_embeds is None:
          raise ValueError(
              "Provide either `prompt` or `prompt_embeds`. Cannot leave both `prompt` and `prompt_embeds` undefined."
          )
      elif prompt is not None and (
          not isinstance(prompt, str) and not isinstance(prompt, list)
      ):
          raise ValueError(
              f"`prompt` has to be of type `str` or `list` but is {type(prompt)}"
          )
      elif prompt_2 is not None and (
          not isinstance(prompt_2, str)
          and not isinstance(prompt_2, list)
      ):
          raise ValueError(
              f"`prompt_2` has to be of type `str` or `list` but is {type(prompt_2)}"
          )
  
      if (
          negative_prompt is not None
          and negative_prompt_embeds is not None
      ):
          raise ValueError(
              f"Cannot forward both `negative_prompt`: {negative_prompt} and `negative_prompt_embeds`:"
              f" {negative_prompt_embeds}. Please make sure to only forward one of the two."
          )
      elif (
          negative_prompt_2 is not None
          and negative_prompt_embeds is not None
      ):
          raise ValueError(
              f"Cannot forward both `negative_prompt_2`: {negative_prompt_2} and `negative_prompt_embeds`:"
              f" {negative_prompt_embeds}. Please make sure to only forward one of the two."
          )
  
      if (
          prompt_embeds is not None
          and negative_prompt_embeds is not None
      ):
          if prompt_embeds.shape != negative_prompt_embeds.shape:
              raise ValueError(
                  "`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but"
                  f" got: `prompt_embeds` {prompt_embeds.shape} != `negative_prompt_embeds`"
                  f" {negative_prompt_embeds.shape}."
              )
  
      if prompt_embeds is not None and pooled_prompt_embeds is None:
          raise ValueError(
              "If `prompt_embeds` are provided, `pooled_prompt_embeds` also have to be passed. Make sure to generate `pooled_prompt_embeds` from the same text encoder that was used to generate `prompt_embeds`."
          )
  
      if (
          negative_prompt_embeds is not None
          and negative_pooled_prompt_embeds is None
      ):
          raise ValueError(
              "If `negative_prompt_embeds` are provided, `negative_pooled_prompt_embeds` also have to be passed. Make sure to generate `negative_pooled_prompt_embeds` from the same text encoder that was used to generate `negative_prompt_embeds`."
          )
  
imports: import importlib
  import inspect
  from typing import List, Optional, Tuple, Union
  import torch
  from k_diffusion.external import CompVisDenoiser, CompVisVDenoiser
  from k_diffusion.sampling import BrownianTreeNoiseSampler, get_sigmas_karras
  from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
  from ...image_processor import VaeImageProcessor
  from ...loaders import FromSingleFileMixin, IPAdapterMixin, StableDiffusionXLLoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...models.attention_processor import AttnProcessor2_0, FusedAttnProcessor2_0, LoRAAttnProcessor2_0, LoRAXFormersAttnProcessor, XFormersAttnProcessor
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers, LMSDiscreteScheduler
  from ...utils import USE_PEFT_BACKEND, logging, replace_example_docstring, scale_lora_layers, unscale_lora_layers
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline
  from ..stable_diffusion_xl.pipeline_output import StableDiffusionXLPipelineOutput
label_desc: Use image node_id 8 for calling the StableDiffusionXLKDiffusionPipeline obj's underlying member method code with example usage: obj.check_inputs(prompt, prompt_2, height, width, negative_prompt, negative_prompt_2, prompt_embeds, negative_prompt_embeds, pooled_prompt_embeds, negative_pooled_prompt_embeds) without return types