class_docstr: Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance.
  
  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.).
  
  The pipeline also inherits the following loading methods:
      - [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
      text_encoder ([`~transformers.CLIPTextModel`]):
          Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
      tokenizer ([`~transformers.CLIPTokenizer`]):
          A `CLIPTokenizer` to tokenize text.
      unet ([`UNet2DConditionModel`]):
          A `UNet2DConditionModel` to denoise the encoded image latents.
      controlnet ([`ControlNetModel`] or `List[ControlNetModel]`):
          Provides additional conditioning to the `unet` during the denoising process. If you set multiple
          ControlNets as a list, the outputs from each ControlNet are added together to create one combined
          additional conditioning.
      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`].
      safety_checker ([`StableDiffusionSafetyChecker`]):
          Classification module that estimates whether generated images could be considered offensive or harmful.
          Please refer to the [model card](https://huggingface.co/runwayml/stable-diffusion-v1-5) for more details
          about a model's potential harms.
      feature_extractor ([`~transformers.CLIPImageProcessor`]):
          A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
class_docstr_tok: ["Pipeline","for","text-to-image","generation","using","Stable","Diffusion","with","ControlNet","guidance",".","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.",")",".","The","pipeline","also","inherits","the","following","loading","methods",":","-","[","`","~loaders.TextualInversionLoaderMixin.load_textual_inversion","`","]","for","loading","textual","inversion","embeddings","Args",":","vae","(","[","`","AutoencoderKL","`","]",")",":","Variational","Auto-Encoder","(","VAE",")","model","to","encode","and","decode","images","to","and","from","latent","representations",".","text_encoder","(","[","`","~transformers.CLIPTextModel","`","]",")",":","Frozen","text-encoder","(","[","clip-vit-large-patch14","]","(","https",":","\/\/huggingface.co\/openai\/clip-vit-large-patch14",")",")",".","tokenizer","(","[","`","~transformers.CLIPTokenizer","`","]",")",":","A","`","CLIPTokenizer","`","to","tokenize","text",".","unet","(","[","`","UNet2DConditionModel","`","]",")",":","A","`","UNet2DConditionModel","`","to","denoise","the","encoded","image","latents",".","controlnet","(","[","`","ControlNetModel","`","]","or","`","List","[","ControlNetModel","]","`",")",":","Provides","additional","conditioning","to","the","`","unet","`","during","the","denoising","process",".","If","you","set","multiple","ControlNets","as","a","list",",","the","outputs","from","each","ControlNet","are","added","together","to","create","one","combined","additional","conditioning",".","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","`","]",".","safety_checker","(","[","`","StableDiffusionSafetyChecker","`","]",")",":","Classification","module","that","estimates","whether","generated","images","could","be","considered","offensive","or","harmful",".","Please","refer","to","the","[","model","card","]","(","https",":","\/\/huggingface.co\/runwayml\/stable-diffusion-v1-5",")","for","more","details","about","a","model","'s","potential","harms",".","feature_extractor","(","[","`","~transformers.CLIPImageProcessor","`","]",")",":","A","`","CLIPImageProcessor","`","to","extract","features","from","generated","images",";","used","as","inputs","to","the","`","safety_checker","`","."]
code: def check_image(self, image, prompt, prompt_embeds):
      image_is_pil = isinstance(image, PIL.Image.Image)
      image_is_tensor = isinstance(image, torch.Tensor)
      image_is_np = isinstance(image, np.ndarray)
      image_is_pil_list = isinstance(image, list) and isinstance(
          image[0], PIL.Image.Image
      )
      image_is_tensor_list = isinstance(image, list) and isinstance(
          image[0], torch.Tensor
      )
      image_is_np_list = isinstance(image, list) and isinstance(
          image[0], np.ndarray
      )
  
      if (
          not image_is_pil
          and not image_is_tensor
          and not image_is_np
          and not image_is_pil_list
          and not image_is_tensor_list
          and not image_is_np_list
      ):
          raise TypeError(
              f"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors, but is {type(image)}"
          )
  
      if image_is_pil:
          image_batch_size = 1
      else:
          image_batch_size = len(image)
  
      if prompt is not None and isinstance(prompt, str):
          prompt_batch_size = 1
      elif prompt is not None and isinstance(prompt, list):
          prompt_batch_size = len(prompt)
      elif prompt_embeds is not None:
          prompt_batch_size = prompt_embeds.shape[0]
  
      if (
          image_batch_size != 1
          and image_batch_size != prompt_batch_size
      ):
          raise ValueError(
              f"If image batch size is not 1, image batch size must be same as prompt batch size. image batch size: {image_batch_size}, prompt batch size: {prompt_batch_size}"
          )
  
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from ...image_processor import PipelineImageInput, VaeImageProcessor
  from ...loaders import FromSingleFileMixin, LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, ControlNetModel, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import USE_PEFT_BACKEND, deprecate, logging, replace_example_docstring, scale_lora_layers, unscale_lora_layers
  from ...utils.torch_utils import is_compiled_module, randn_tensor
  from ..pipeline_utils import DiffusionPipeline
  from ..stable_diffusion.pipeline_output import StableDiffusionPipelineOutput
  from ..stable_diffusion.safety_checker import StableDiffusionSafetyChecker
  from .multicontrolnet import MultiControlNetModel
label_desc: Use image node_id 12 for calling the StableDiffusionControlNetPipeline obj's underlying member method code with example usage: obj.check_image(image, prompt, prompt_embeds) without return types