class_docstr: Pipeline for text-guided image-to-image generation using stable unCLIP.
  
  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.).
  
  Args:
      feature_extractor ([`CLIPImageProcessor`]):
          Feature extractor for image pre-processing before being encoded.
      image_encoder ([`CLIPVisionModelWithProjection`]):
          CLIP vision model for encoding images.
      image_normalizer ([`StableUnCLIPImageNormalizer`]):
          Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
          embeddings after the noise has been applied.
      image_noising_scheduler ([`KarrasDiffusionSchedulers`]):
          Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
          by the `noise_level`.
      tokenizer (`~transformers.CLIPTokenizer`):
          A [`~transformers.CLIPTokenizer`)].
      text_encoder ([`~transformers.CLIPTextModel`]):
          Frozen [`~transformers.CLIPTextModel`] text-encoder.
      unet ([`UNet2DConditionModel`]):
          A [`UNet2DConditionModel`] to denoise the encoded image latents.
      scheduler ([`KarrasDiffusionSchedulers`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image latents.
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
class_docstr_tok: ["Pipeline","for","text-guided","image-to-image","generation","using","stable","unCLIP",".","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.",")",".","Args",":","feature_extractor","(","[","`","CLIPImageProcessor","`","]",")",":","Feature","extractor","for","image","pre-processing","before","being","encoded",".","image_encoder","(","[","`","CLIPVisionModelWithProjection","`","]",")",":","CLIP","vision","model","for","encoding","images",".","image_normalizer","(","[","`","StableUnCLIPImageNormalizer","`","]",")",":","Used","to","normalize","the","predicted","image","embeddings","before","the","noise","is","applied","and","un-normalize","the","image","embeddings","after","the","noise","has","been","applied",".","image_noising_scheduler","(","[","`","KarrasDiffusionSchedulers","`","]",")",":","Noise","schedule","for","adding","noise","to","the","predicted","image","embeddings",".","The","amount","of","noise","to","add","is","determined","by","the","`","noise_level","`",".","tokenizer","(","`","~transformers.CLIPTokenizer","`",")",":","A","[","`","~transformers.CLIPTokenizer","`",")","]",".","text_encoder","(","[","`","~transformers.CLIPTextModel","`","]",")",":","Frozen","[","`","~transformers.CLIPTextModel","`","]","text-encoder",".","unet","(","[","`","UNet2DConditionModel","`","]",")",":","A","[","`","UNet2DConditionModel","`","]","to","denoise","the","encoded","image","latents",".","scheduler","(","[","`","KarrasDiffusionSchedulers","`","]",")",":","A","scheduler","to","be","used","in","combination","with","`","unet","`","to","denoise","the","encoded","image","latents",".","vae","(","[","`","AutoencoderKL","`","]",")",":","Variational","Auto-Encoder","(","VAE",")","Model","to","encode","and","decode","images","to","and","from","latent","representations","."]
code: def __init__(
      self,
      # image encoding components
      feature_extractor: CLIPImageProcessor,
      image_encoder: CLIPVisionModelWithProjection,
      # image noising components
      image_normalizer: StableUnCLIPImageNormalizer,
      image_noising_scheduler: KarrasDiffusionSchedulers,
      # regular denoising components
      tokenizer: CLIPTokenizer,
      text_encoder: CLIPTextModel,
      unet: UNet2DConditionModel,
      scheduler: KarrasDiffusionSchedulers,
      # vae
      vae: AutoencoderKL,
  ):
      super().__init__()
  
      self.register_modules(
          feature_extractor=feature_extractor,
          image_encoder=image_encoder,
          image_normalizer=image_normalizer,
          image_noising_scheduler=image_noising_scheduler,
          tokenizer=tokenizer,
          text_encoder=text_encoder,
          unet=unet,
          scheduler=scheduler,
          vae=vae,
      )
  
      self.vae_scale_factor = 2 ** (
          len(self.vae.config.block_out_channels) - 1
      )
      self.image_processor = VaeImageProcessor(
          vae_scale_factor=self.vae_scale_factor
      )
  
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 VaeImageProcessor
  from ...loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...models.embeddings import get_timestep_embedding
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  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, ImagePipelineOutput
  from .stable_unclip_image_normalizer import StableUnCLIPImageNormalizer
label_desc: Use image node_id 1 to create a new StableUnCLIPImg2ImgPipeline object from inherited base classes: DiffusionPipeline, TextualInversionLoaderMixin, LoraLoaderMixin with example: obj = StableUnCLIPImg2ImgPipeline(feature_extractor, image_encoder, image_normalizer, image_noising_scheduler, tokenizer, text_encoder, unet, scheduler, vae)