class_docstr: Pipeline for text-to-image generation using Stable Diffusion and conditioning the results using feedback images.
  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:
      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 ([`EulerAncestralDiscreteScheduler`]):
          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.
code: def get_unet_hidden_states(self, z_all, t, prompt_embd):
      cached_hidden_states = []
      for module in self.unet.modules():
          if isinstance(module, BasicTransformerBlock):
  
              def new_forward(self, hidden_states, *args, **kwargs):
                  cached_hidden_states.append(
                      hidden_states.clone().detach().cpu()
                  )
                  return self.old_forward(
                      hidden_states, *args, **kwargs
                  )
  
              module.attn1.old_forward = module.attn1.forward
              module.attn1.forward = new_forward.__get__(module.attn1)
  
      # run forward pass to cache hidden states, output can be discarded
      _ = self.unet(z_all, t, encoder_hidden_states=prompt_embd)
  
      # restore original forward pass
      for module in self.unet.modules():
          if isinstance(module, BasicTransformerBlock):
              module.attn1.forward = module.attn1.old_forward
              del module.attn1.old_forward
  
      return cached_hidden_states
  
imports: from typing import List, Optional, Union
  import torch
  from packaging import version
  from PIL import Image
  from transformers import CLIPTextModel, CLIPTokenizer
  from diffusers import AutoencoderKL, UNet2DConditionModel
  from diffusers.configuration_utils import FrozenDict
  from diffusers.image_processor import VaeImageProcessor
  from diffusers.loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from diffusers.models.attention import BasicTransformerBlock
  from diffusers.models.attention_processor import LoRAAttnProcessor
  from diffusers.pipelines.pipeline_utils import DiffusionPipeline
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
  from diffusers.schedulers import EulerAncestralDiscreteScheduler, KarrasDiffusionSchedulers
  from diffusers.utils import deprecate, logging, replace_example_docstring
  from diffusers.utils.torch_utils import randn_tensor
label_desc: Use image node_id 3 for calling the FabricPipeline obj's underlying member method code with example usage: obj.get_unet_hidden_states(z_all, t, prompt_embd) and returns: cached_hidden_states, self