class_docstr: Pipeline for text-guided image-to-image generation using Alt Diffusion.
  
  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
      - [`~loaders.LoraLoaderMixin.load_lora_weights`] for loading LoRA weights
      - [`~loaders.LoraLoaderMixin.save_lora_weights`] for saving LoRA weights
      - [`~loaders.FromSingleFileMixin.from_single_file`] for loading `.ckpt` files
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
      text_encoder ([`~transformers.RobertaSeriesModelWithTransformation`]):
          Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
      tokenizer ([`~transformers.XLMRobertaTokenizer`]):
          A `XLMRobertaTokenizer` to tokenize text.
      unet ([`UNet2DConditionModel`]):
          A `UNet2DConditionModel` 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`].
      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 run_safety_checker(self, image, device, dtype):
      if self.safety_checker is None:
          has_nsfw_concept = None
      else:
          if torch.is_tensor(image):
              feature_extractor_input = (
                  self.image_processor.postprocess(
                      image, output_type="pil"
                  )
              )
          else:
              feature_extractor_input = (
                  self.image_processor.numpy_to_pil(image)
              )
          safety_checker_input = self.feature_extractor(
              feature_extractor_input, return_tensors="pt"
          ).to(device)
          image, has_nsfw_concept = self.safety_checker(
              images=image,
              clip_input=safety_checker_input.pixel_values.to(dtype),
          )
      return image, has_nsfw_concept
  
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  from packaging import version
  from transformers import CLIPImageProcessor, XLMRobertaTokenizer
  from ...configuration_utils import FrozenDict
  from ...image_processor import PipelineImageInput, VaeImageProcessor
  from ...loaders import FromSingleFileMixin, LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import PIL_INTERPOLATION, USE_PEFT_BACKEND, deprecate, 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.safety_checker import StableDiffusionSafetyChecker
  from .modeling_roberta_series import RobertaSeriesModelWithTransformation
  from .pipeline_output import AltDiffusionPipelineOutput
label_desc: Use image node_id 4 for calling the AltDiffusionImg2ImgPipeline obj's underlying member method code with example usage: obj.run_safety_checker(image, device, dtype) and returns: image,  has_nsfw_concept