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 __init__(
      self,
      vae: AutoencoderKL,
      text_encoder: CLIPTextModel,
      tokenizer: CLIPTokenizer,
      unet: UNet2DConditionModel,
      controlnet: Union[
          ControlNetModel,
          List[ControlNetModel],
          Tuple[ControlNetModel],
          MultiControlNetModel,
      ],
      scheduler: KarrasDiffusionSchedulers,
      safety_checker: StableDiffusionSafetyChecker,
      feature_extractor: CLIPImageProcessor,
      requires_safety_checker: bool = True,
  ):
      super().__init__()
  
      if safety_checker is None and requires_safety_checker:
          logger.warning(
              f"You have disabled the safety checker for {self.__class__} by passing `safety_checker=None`. Ensure"
              " that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered"
              " results in services or applications open to the public. Both the diffusers team and Hugging Face"
              " strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling"
              " it only for use-cases that involve analyzing network behavior or auditing its results. For more"
              " information, please have a look at https://github.com/huggingface/diffusers/pull/254 ."
          )
  
      if safety_checker is not None and feature_extractor is None:
          raise ValueError(
              "Make sure to define a feature extractor when loading {self.__class__} if you want to use the safety"
              " checker. If you do not want to use the safety checker, you can pass `'safety_checker=None'` instead."
          )
  
      if isinstance(controlnet, (list, tuple)):
          controlnet = MultiControlNetModel(controlnet)
  
      self.register_modules(
          vae=vae,
          text_encoder=text_encoder,
          tokenizer=tokenizer,
          unet=unet,
          controlnet=controlnet,
          scheduler=scheduler,
          safety_checker=safety_checker,
          feature_extractor=feature_extractor,
      )
  
      self.vae_scale_factor = 2 ** (
          len(self.vae.config.block_out_channels) - 1
      )
      self.register_to_config(
          requires_safety_checker=requires_safety_checker
      )
  
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 1 to create a new StableDiffusionControlNetInpaintPipeline object from inherited base classes: DiffusionPipeline with example: obj = StableDiffusionControlNetInpaintPipeline(vae, text_encoder, tokenizer, unet, controlnet, scheduler, safety_checker, feature_extractor, requires_safety_checker)