class_docstr: Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
class_docstr_tok: ["Inspired","by",":","https",":","\/\/github.com\/haofanwang\/ControlNet-for-Diffusers\/"]
code: def check_controlnet_conditioning_image(
      self, image, prompt, prompt_embeds
  ):
      image_is_pil = isinstance(image, PIL.Image.Image)
      image_is_tensor = isinstance(image, torch.Tensor)
      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
      )
  
      if (
          not image_is_pil
          and not image_is_tensor
          and not image_is_pil_list
          and not image_is_tensor_list
      ):
          raise TypeError(
              "image must be passed and be one of PIL image, torch tensor, list of PIL images, or list of torch tensors"
          )
  
      if image_is_pil:
          image_batch_size = 1
      elif image_is_tensor:
          image_batch_size = image.shape[0]
      elif image_is_pil_list:
          image_batch_size = len(image)
      elif image_is_tensor_list:
          image_batch_size = len(image)
      else:
          raise ValueError("controlnet condition image is not valid")
  
      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]
      else:
          raise ValueError("prompt or prompt_embeds are not valid")
  
      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 diffusers import AutoencoderKL, ControlNetModel, DiffusionPipeline, UNet2DConditionModel, logging
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput, StableDiffusionSafetyChecker
  from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
  from diffusers.schedulers import KarrasDiffusionSchedulers
  from diffusers.utils import PIL_INTERPOLATION, is_accelerate_available, is_accelerate_version, replace_example_docstring
  from diffusers.utils.torch_utils import randn_tensor
label_desc: Use image node_id 11 for calling the StableDiffusionControlNetInpaintPipeline obj's underlying member method code with example usage: obj.check_controlnet_conditioning_image(image, prompt, prompt_embeds) without return types