class_docstr: Pipeline for text based inpainting using Stable Diffusion.
  Uses CLIPSeg to get a mask from the given text, then calls the Inpainting pipeline with the generated mask
  
  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.)
  
  Args:
      segmentation_model ([`CLIPSegForImageSegmentation`]):
          CLIPSeg Model to generate mask from the given text. Please refer to the [model card]() for details.
      segmentation_processor ([`CLIPSegProcessor`]):
          CLIPSeg processor to get image, text features to translate prompt to English, if necessary. Please refer to the
          [model card](https://huggingface.co/docs/transformers/model_doc/clipseg) for details.
      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 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.
      tokenizer (`CLIPTokenizer`):
          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 latens. 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 details.
      feature_extractor ([`CLIPImageProcessor`]):
          Model that extracts features from generated images to be used as inputs for the `safety_checker`.
class_docstr_tok: ["Pipeline","for","text","based","inpainting","using","Stable","Diffusion",".","Uses","CLIPSeg","to","get","a","mask","from","the","given","text",",","then","calls","the","Inpainting","pipeline","with","the","generated","mask","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",".",")","Args",":","segmentation_model","(","[","`","CLIPSegForImageSegmentation","`","]",")",":","CLIPSeg","Model","to","generate","mask","from","the","given","text",".","Please","refer","to","the","[","model","card","]","(",")","for","details",".","segmentation_processor","(","[","`","CLIPSegProcessor","`","]",")",":","CLIPSeg","processor","to","get","image",",","text","features","to","translate","prompt","to","English",",","if","necessary",".","Please","refer","to","the","[","model","card","]","(","https",":","\/\/huggingface.co\/docs\/transformers\/model_doc\/clipseg",")","for","details",".","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","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",".","tokenizer","(","`","CLIPTokenizer","`",")",":","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","latens",".","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","details",".","feature_extractor","(","[","`","CLIPImageProcessor","`","]",")",":","Model","that","extracts","features","from","generated","images","to","be","used","as","inputs","for","the","`","safety_checker","`","."]
docstr: Returns the device on which the pipeline's models will be executed. After calling
  `pipeline.enable_sequential_cpu_offload()` the execution device can only be inferred from Accelerate's module
  hooks.
docstr_tok: ["Returns","the","device","on","which","the","pipeline","'s","models","will","be","executed",".","After","calling","`","pipeline.enable_sequential_cpu_offload","(",")","`","the","execution","device","can","only","be","inferred","from","Accelerate","'s","module","hooks","."]
code: def _execution_device(self):
      r"""
      Returns the device on which the pipeline's models will be executed. After calling
      `pipeline.enable_sequential_cpu_offload()` the execution device can only be inferred from Accelerate's module
      hooks.
      """
      if self.device != torch.device("meta") or not hasattr(
          self.unet, "_hf_hook"
      ):
          return self.device
      for module in self.unet.modules():
          if (
              hasattr(module, "_hf_hook")
              and hasattr(module._hf_hook, "execution_device")
              and module._hf_hook.execution_device is not None
          ):
              return torch.device(module._hf_hook.execution_device)
      return self.device
  
file_path: llmga/llmga/diffusers/examples/community/text_inpainting.py
imports: from typing import Callable, List, Optional, Union
  import PIL.Image
  import torch
  from transformers import CLIPImageProcessor, CLIPSegForImageSegmentation, CLIPSegProcessor, CLIPTextModel, CLIPTokenizer
  from diffusers import DiffusionPipeline
  from diffusers.configuration_utils import FrozenDict
  from diffusers.models import AutoencoderKL, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion import StableDiffusionInpaintPipeline
  from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
  from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
  from diffusers.utils import deprecate, is_accelerate_available, logging
label_desc: Use image node_id 5 for calling the TextInpainting obj's underlying member method code with example usage: obj._execution_device() and returns: self, self, torch