class_docstr: Pipeline for image-to-image generation using a latent consistency model.
  
  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
      - [`~loaders.IPAdapterMixin.load_ip_adapter`] for loading IP Adapters
  
  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.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image latents. Currently only
          supports [`LCMScheduler`].
      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`.
      requires_safety_checker (`bool`, *optional*, defaults to `True`):
          Whether the pipeline requires a safety checker component.
docstr: The call function to the pipeline for generation.
  
  Args:
      prompt (`str` or `List[str]`, *optional*):
          The prompt or prompts to guide image generation. If not defined, you need to pass `prompt_embeds`.
      height (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
          The height in pixels of the generated image.
      width (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
          The width in pixels of the generated image.
      num_inference_steps (`int`, *optional*, defaults to 50):
          The number of denoising steps. More denoising steps usually lead to a higher quality image at the
          expense of slower inference.
      original_inference_steps (`int`, *optional*):
          The original number of inference steps use to generate a linearly-spaced timestep schedule, from which
          we will draw `num_inference_steps` evenly spaced timesteps from as our final timestep schedule,
          following the Skipping-Step method in the paper (see Section 4.3). If not set this will default to the
          scheduler's `original_inference_steps` attribute.
      timesteps (`List[int]`, *optional*):
          Custom timesteps to use for the denoising process. If not defined, equal spaced `num_inference_steps`
          timesteps on the original LCM training/distillation timestep schedule are used. Must be in descending
          order.
      guidance_scale (`float`, *optional*, defaults to 7.5):
          A higher guidance scale value encourages the model to generate images closely linked to the text
          `prompt` at the expense of lower image quality. Guidance scale is enabled when `guidance_scale > 1`.
          Note that the original latent consistency models paper uses a different CFG formulation where the
          guidance scales are decreased by 1 (so in the paper formulation CFG is enabled when `guidance_scale >
          0`).
      num_images_per_prompt (`int`, *optional*, defaults to 1):
          The number of images to generate per prompt.
      generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
          A [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make
          generation deterministic.
      latents (`torch.FloatTensor`, *optional*):
          Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
          generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
          tensor is generated by sampling using the supplied random `generator`.
      prompt_embeds (`torch.FloatTensor`, *optional*):
          Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
          provided, text embeddings are generated from the `prompt` input argument.
      ip_adapter_image: (`PipelineImageInput`, *optional*):
          Optional image input to work with IP Adapters.
      output_type (`str`, *optional*, defaults to `"pil"`):
          The output format of the generated image. Choose between `PIL.Image` or `np.array`.
      return_dict (`bool`, *optional*, defaults to `True`):
          Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
          plain tuple.
      cross_attention_kwargs (`dict`, *optional*):
          A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
          [`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
      clip_skip (`int`, *optional*):
          Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
          the output of the pre-final layer will be used for computing the prompt embeddings.
      callback_on_step_end (`Callable`, *optional*):
          A function that calls at the end of each denoising steps during the inference. The function is called
          with the following arguments: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int,
          callback_kwargs: Dict)`. `callback_kwargs` will include a list of all tensors as specified by
          `callback_on_step_end_tensor_inputs`.
      callback_on_step_end_tensor_inputs (`List`, *optional*):
          The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list
          will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the
          `._callback_tensor_inputs` attribute of your pipeline class.
  
  Examples:
  
  Returns:
      [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] or `tuple`:
          If `return_dict` is `True`, [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] is returned,
          otherwise a `tuple` is returned where the first element is a list with the generated images and the
          second element is a list of `bool`s indicating whether the corresponding generated image contains
          "not-safe-for-work" (nsfw) content.
docstr_tok: ["The","call","function","to","the","pipeline","for","generation",".","Args",":","prompt","(","`","str","`","or","`","List","[","str","]","`",",","*","optional","*",")",":","The","prompt","or","prompts","to","guide","image","generation",".","If","not","defined",",","you","need","to","pass","`","prompt_embeds","`",".","height","(","`","int","`",",","*","optional","*",",","defaults","to","`","self.unet.config.sample_size","*","self.vae_scale_factor","`",")",":","The","height","in","pixels","of","the","generated","image",".","width","(","`","int","`",",","*","optional","*",",","defaults","to","`","self.unet.config.sample_size","*","self.vae_scale_factor","`",")",":","The","width","in","pixels","of","the","generated","image",".","num_inference_steps","(","`","int","`",",","*","optional","*",",","defaults","to","50",")",":","The","number","of","denoising","steps",".","More","denoising","steps","usually","lead","to","a","higher","quality","image","at","the","expense","of","slower","inference",".","original_inference_steps","(","`","int","`",",","*","optional","*",")",":","The","original","number","of","inference","steps","use","to","generate","a","linearly-spaced","timestep","schedule",",","from","which","we","will","draw","`","num_inference_steps","`","evenly","spaced","timesteps","from","as","our","final","timestep","schedule",",","following","the","Skipping-Step","method","in","the","paper","(","see","Section","4.3",")",".","If","not","set","this","will","default","to","the","scheduler","'s","`","original_inference_steps","`","attribute",".","timesteps","(","`","List","[","int","]","`",",","*","optional","*",")",":","Custom","timesteps","to","use","for","the","denoising","process",".","If","not","defined",",","equal","spaced","`","num_inference_steps","`","timesteps","on","the","original","LCM","training\/distillation","timestep","schedule","are","used",".","Must","be","in","descending","order",".","guidance_scale","(","`","float","`",",","*","optional","*",",","defaults","to","7.5",")",":","A","higher","guidance","scale","value","encourages","the","model","to","generate","images","closely","linked","to","the","text","`","prompt","`","at","the","expense","of","lower","image","quality",".","Guidance","scale","is","enabled","when","`","guidance_scale",">","1","`",".","Note","that","the","original","latent","consistency","models","paper","uses","a","different","CFG","formulation","where","the","guidance","scales","are","decreased","by","1","(","so","in","the","paper","formulation","CFG","is","enabled","when","`","guidance_scale",">","0","`",")",".","num_images_per_prompt","(","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","The","number","of","images","to","generate","per","prompt",".","generator","(","`","torch.Generator","`","or","`","List","[","torch.Generator","]","`",",","*","optional","*",")",":","A","[","`","torch.Generator","`","]","(","https",":","\/\/pytorch.org\/docs\/stable\/generated\/torch.Generator.html",")","to","make","generation","deterministic",".","latents","(","`","torch.FloatTensor","`",",","*","optional","*",")",":","Pre-generated","noisy","latents","sampled","from","a","Gaussian","distribution",",","to","be","used","as","inputs","for","image","generation",".","Can","be","used","to","tweak","the","same","generation","with","different","prompts",".","If","not","provided",",","a","latents","tensor","is","generated","by","sampling","using","the","supplied","random","`","generator","`",".","prompt_embeds","(","`","torch.FloatTensor","`",",","*","optional","*",")",":","Pre-generated","text","embeddings",".","Can","be","used","to","easily","tweak","text","inputs","(","prompt","weighting",")",".","If","not","provided",",","text","embeddings","are","generated","from","the","`","prompt","`","input","argument",".","ip_adapter_image",":","(","`","PipelineImageInput","`",",","*","optional","*",")",":","Optional","image","input","to","work","with","IP","Adapters",".","output_type","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","pil","''","`",")",":","The","output","format","of","the","generated","image",".","Choose","between","`","PIL.Image","`","or","`","np.array","`",".","return_dict","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","return","a","[","`","~pipelines.stable_diffusion.StableDiffusionPipelineOutput","`","]","instead","of","a","plain","tuple",".","cross_attention_kwargs","(","`","dict","`",",","*","optional","*",")",":","A","kwargs","dictionary","that","if","specified","is","passed","along","to","the","[","`","AttentionProcessor","`","]","as","defined","in","[","`","self.processor","`","]","(","https",":","\/\/github.com\/huggingface\/diffusers\/blob\/main\/src\/diffusers\/models\/attention_processor.py",")",".","clip_skip","(","`","int","`",",","*","optional","*",")",":","Number","of","layers","to","be","skipped","from","CLIP","while","computing","the","prompt","embeddings",".","A","value","of","1","means","that","the","output","of","the","pre-final","layer","will","be","used","for","computing","the","prompt","embeddings",".","callback_on_step_end","(","`","Callable","`",",","*","optional","*",")",":","A","function","that","calls","at","the","end","of","each","denoising","steps","during","the","inference",".","The","function","is","called","with","the","following","arguments",":","`","callback_on_step_end","(","self",":","DiffusionPipeline",",","step",":","int",",","timestep",":","int",",","callback_kwargs",":","Dict",")","`",".","`","callback_kwargs","`","will","include","a","list","of","all","tensors","as","specified","by","`","callback_on_step_end_tensor_inputs","`",".","callback_on_step_end_tensor_inputs","(","`","List","`",",","*","optional","*",")",":","The","list","of","tensor","inputs","for","the","`","callback_on_step_end","`","function",".","The","tensors","specified","in","the","list","will","be","passed","as","`","callback_kwargs","`","argument",".","You","will","only","be","able","to","include","variables","listed","in","the","`","._callback_tensor_inputs","`","attribute","of","your","pipeline","class",".","Examples",":","Returns",":","[","`","~pipelines.stable_diffusion.StableDiffusionPipelineOutput","`","]","or","`","tuple","`",":","If","`","return_dict","`","is","`","True","`",",","[","`","~pipelines.stable_diffusion.StableDiffusionPipelineOutput","`","]","is","returned",",","otherwise","a","`","tuple","`","is","returned","where","the","first","element","is","a","list","with","the","generated","images","and","the","second","element","is","a","list","of","`","bool","`","s","indicating","whether","the","corresponding","generated","image","contains","``","not-safe-for-work","''","(","nsfw",")","content","."]
code: def __call__(
      self,
      prompt: Union[str, List[str]] = None,
      image: PipelineImageInput = None,
      num_inference_steps: int = 4,
      strength: float = 0.8,
      original_inference_steps: int = None,
      timesteps: List[int] = None,
      guidance_scale: float = 8.5,
      num_images_per_prompt: Optional[int] = 1,
      generator: Optional[
          Union[torch.Generator, List[torch.Generator]]
      ] = None,
      latents: Optional[torch.FloatTensor] = None,
      prompt_embeds: Optional[torch.FloatTensor] = None,
      ip_adapter_image: Optional[PipelineImageInput] = None,
      output_type: Optional[str] = "pil",
      return_dict: bool = True,
      cross_attention_kwargs: Optional[Dict[str, Any]] = None,
      clip_skip: Optional[int] = None,
      callback_on_step_end: Optional[
          Callable[[int, int, Dict], None]
      ] = None,
      callback_on_step_end_tensor_inputs: List[str] = ["latents"],
      **kwargs,
  ):
      r"""
      The call function to the pipeline for generation.
  
      Args:
          prompt (`str` or `List[str]`, *optional*):
              The prompt or prompts to guide image generation. If not defined, you need to pass `prompt_embeds`.
          height (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
              The height in pixels of the generated image.
          width (`int`, *optional*, defaults to `self.unet.config.sample_size * self.vae_scale_factor`):
              The width in pixels of the generated image.
          num_inference_steps (`int`, *optional*, defaults to 50):
              The number of denoising steps. More denoising steps usually lead to a higher quality image at the
              expense of slower inference.
          original_inference_steps (`int`, *optional*):
              The original number of inference steps use to generate a linearly-spaced timestep schedule, from which
              we will draw `num_inference_steps` evenly spaced timesteps from as our final timestep schedule,
              following the Skipping-Step method in the paper (see Section 4.3). If not set this will default to the
              scheduler's `original_inference_steps` attribute.
          timesteps (`List[int]`, *optional*):
              Custom timesteps to use for the denoising process. If not defined, equal spaced `num_inference_steps`
              timesteps on the original LCM training/distillation timestep schedule are used. Must be in descending
              order.
          guidance_scale (`float`, *optional*, defaults to 7.5):
              A higher guidance scale value encourages the model to generate images closely linked to the text
              `prompt` at the expense of lower image quality. Guidance scale is enabled when `guidance_scale > 1`.
              Note that the original latent consistency models paper uses a different CFG formulation where the
              guidance scales are decreased by 1 (so in the paper formulation CFG is enabled when `guidance_scale >
              0`).
          num_images_per_prompt (`int`, *optional*, defaults to 1):
              The number of images to generate per prompt.
          generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
              A [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make
              generation deterministic.
          latents (`torch.FloatTensor`, *optional*):
              Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
              generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
              tensor is generated by sampling using the supplied random `generator`.
          prompt_embeds (`torch.FloatTensor`, *optional*):
              Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
              provided, text embeddings are generated from the `prompt` input argument.
          ip_adapter_image: (`PipelineImageInput`, *optional*):
              Optional image input to work with IP Adapters.
          output_type (`str`, *optional*, defaults to `"pil"`):
              The output format of the generated image. Choose between `PIL.Image` or `np.array`.
          return_dict (`bool`, *optional*, defaults to `True`):
              Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
              plain tuple.
          cross_attention_kwargs (`dict`, *optional*):
              A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
              [`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
          clip_skip (`int`, *optional*):
              Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
              the output of the pre-final layer will be used for computing the prompt embeddings.
          callback_on_step_end (`Callable`, *optional*):
              A function that calls at the end of each denoising steps during the inference. The function is called
              with the following arguments: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int,
              callback_kwargs: Dict)`. `callback_kwargs` will include a list of all tensors as specified by
              `callback_on_step_end_tensor_inputs`.
          callback_on_step_end_tensor_inputs (`List`, *optional*):
              The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list
              will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the
              `._callback_tensor_inputs` attribute of your pipeline class.
  
      Examples:
  
      Returns:
          [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] or `tuple`:
              If `return_dict` is `True`, [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] is returned,
              otherwise a `tuple` is returned where the first element is a list with the generated images and the
              second element is a list of `bool`s indicating whether the corresponding generated image contains
              "not-safe-for-work" (nsfw) content.
      """
      callback = kwargs.pop("callback", None)
      callback_steps = kwargs.pop("callback_steps", None)
  
      if callback is not None:
          deprecate(
              "callback",
              "1.0.0",
              "Passing `callback` as an input argument to `__call__` is deprecated, consider use `callback_on_step_end`",
          )
      if callback_steps is not None:
          deprecate(
              "callback_steps",
              "1.0.0",
              "Passing `callback_steps` as an input argument to `__call__` is deprecated, consider use `callback_on_step_end`",
          )
  
      # 1. Check inputs. Raise error if not correct
      self.check_inputs(
          prompt,
          strength,
          callback_steps,
          prompt_embeds,
          callback_on_step_end_tensor_inputs,
      )
      self._guidance_scale = guidance_scale
      self._clip_skip = clip_skip
      self._cross_attention_kwargs = cross_attention_kwargs
  
      # 2. Define call parameters
      if prompt is not None and isinstance(prompt, str):
          batch_size = 1
      elif prompt is not None and isinstance(prompt, list):
          batch_size = len(prompt)
      else:
          batch_size = prompt_embeds.shape[0]
  
      device = self._execution_device
      # do_classifier_free_guidance = guidance_scale > 1.0
  
      if ip_adapter_image is not None:
          output_hidden_state = (
              False
              if isinstance(self.unet.encoder_hid_proj, ImageProjection)
              else True
          )
          image_embeds, negative_image_embeds = self.encode_image(
              ip_adapter_image,
              device,
              num_images_per_prompt,
              output_hidden_state,
          )
  
      # 3. Encode input prompt
      lora_scale = (
          self.cross_attention_kwargs.get("scale", None)
          if self.cross_attention_kwargs is not None
          else None
      )
  
      # NOTE: when a LCM is distilled from an LDM via latent consistency distillation (Algorithm 1) with guided
      # distillation, the forward pass of the LCM learns to approximate sampling from the LDM using CFG with the
      # unconditional prompt "" (the empty string). Due to this, LCMs currently do not support negative prompts.
      prompt_embeds, _ = self.encode_prompt(
          prompt,
          device,
          num_images_per_prompt,
          False,
          negative_prompt=None,
          prompt_embeds=prompt_embeds,
          negative_prompt_embeds=None,
          lora_scale=lora_scale,
          clip_skip=self.clip_skip,
      )
  
      # 4. Encode image
      image = self.image_processor.preprocess(image)
  
      # 5. Prepare timesteps
      timesteps, num_inference_steps = retrieve_timesteps(
          self.scheduler,
          num_inference_steps,
          device,
          timesteps,
          original_inference_steps=original_inference_steps,
          strength=strength,
      )
  
      # 6. Prepare latent variables
      original_inference_steps = (
          original_inference_steps
          if original_inference_steps is not None
          else self.scheduler.config.original_inference_steps
      )
      latent_timestep = timesteps[:1]
      latents = self.prepare_latents(
          image,
          latent_timestep,
          batch_size,
          num_images_per_prompt,
          prompt_embeds.dtype,
          device,
          generator,
      )
      bs = batch_size * num_images_per_prompt
  
      # 6. Get Guidance Scale Embedding
      # NOTE: We use the Imagen CFG formulation that StableDiffusionPipeline uses rather than the original LCM paper
      # CFG formulation, so we need to subtract 1 from the input guidance_scale.
      # LCM CFG formulation:  cfg_noise = noise_cond + cfg_scale * (noise_cond - noise_uncond), (cfg_scale > 0.0 using CFG)
      w = torch.tensor(self.guidance_scale - 1).repeat(bs)
      w_embedding = self.get_guidance_scale_embedding(
          w, embedding_dim=self.unet.config.time_cond_proj_dim
      ).to(device=device, dtype=latents.dtype)
  
      # 7. Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline
      extra_step_kwargs = self.prepare_extra_step_kwargs(
          generator, None
      )
  
      # 7.1 Add image embeds for IP-Adapter
      added_cond_kwargs = (
          {"image_embeds": image_embeds}
          if ip_adapter_image is not None
          else None
      )
  
      # 8. LCM Multistep Sampling Loop
      num_warmup_steps = (
          len(timesteps) - num_inference_steps * self.scheduler.order
      )
      self._num_timesteps = len(timesteps)
      with self.progress_bar(total=num_inference_steps) as progress_bar:
          for i, t in enumerate(timesteps):
              latents = latents.to(prompt_embeds.dtype)
  
              # model prediction (v-prediction, eps, x)
              model_pred = self.unet(
                  latents,
                  t,
                  timestep_cond=w_embedding,
                  encoder_hidden_states=prompt_embeds,
                  cross_attention_kwargs=self.cross_attention_kwargs,
                  added_cond_kwargs=added_cond_kwargs,
                  return_dict=False,
              )[0]
  
              # compute the previous noisy sample x_t -> x_t-1
              latents, denoised = self.scheduler.step(
                  model_pred,
                  t,
                  latents,
                  **extra_step_kwargs,
                  return_dict=False,
              )
              if callback_on_step_end is not None:
                  callback_kwargs = {}
                  for k in callback_on_step_end_tensor_inputs:
                      callback_kwargs[k] = locals()[k]
                  callback_outputs = callback_on_step_end(
                      self, i, t, callback_kwargs
                  )
  
                  latents = callback_outputs.pop("latents", latents)
                  prompt_embeds = callback_outputs.pop(
                      "prompt_embeds", prompt_embeds
                  )
                  w_embedding = callback_outputs.pop(
                      "w_embedding", w_embedding
                  )
                  denoised = callback_outputs.pop("denoised", denoised)
  
              # call the callback, if provided
              if i == len(timesteps) - 1 or (
                  (i + 1) > num_warmup_steps
                  and (i + 1) % self.scheduler.order == 0
              ):
                  progress_bar.update()
                  if callback is not None and i % callback_steps == 0:
                      step_idx = i // getattr(
                          self.scheduler, "order", 1
                      )
                      callback(step_idx, t, latents)
  
      denoised = denoised.to(prompt_embeds.dtype)
      if not output_type == "latent":
          image = self.vae.decode(
              denoised / self.vae.config.scaling_factor,
              return_dict=False,
          )[0]
          image, has_nsfw_concept = self.run_safety_checker(
              image, device, prompt_embeds.dtype
          )
      else:
          image = denoised
          has_nsfw_concept = None
  
      if has_nsfw_concept is None:
          do_denormalize = [True] * image.shape[0]
      else:
          do_denormalize = [
              not has_nsfw for has_nsfw in has_nsfw_concept
          ]
  
      image = self.image_processor.postprocess(
          image, output_type=output_type, do_denormalize=do_denormalize
      )
  
      # Offload all models
      self.maybe_free_model_hooks()
  
      if not return_dict:
          return (image, has_nsfw_concept)
  
      return StableDiffusionPipelineOutput(
          images=image, nsfw_content_detected=has_nsfw_concept
      )
  
imports: import inspect
  from typing import Any, Callable, Dict, List, Optional, Union
  import PIL.Image
  import torch
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
  from ...image_processor import PipelineImageInput, VaeImageProcessor
  from ...loaders import FromSingleFileMixin, IPAdapterMixin, LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, ImageProjection, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import LCMScheduler
  from ...utils import 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 import StableDiffusionPipelineOutput, StableDiffusionSafetyChecker
label_desc: Use image node_id 20 for calling the LatentConsistencyModelImg2ImgPipeline obj's underlying member method code with example usage: obj.__call__(prompt, image, num_inference_steps, strength, original_inference_steps, timesteps, guidance_scale, num_images_per_prompt, generator, latents, prompt_embeds, ip_adapter_image, output_type, return_dict, cross_attention_kwargs, clip_skip, callback_on_step_end, callback_on_step_end_tensor_inputs) and returns: StableDiffusionPipelineOutput, image,  has_nsfw_concept