class_docstr: Pipeline for text-to-image generation using Stable Diffusion augmented with T2I-Adapter
  https://arxiv.org/abs/2302.08453
  
  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:
      adapter ([`T2IAdapter`] or [`MultiAdapter`] or `List[T2IAdapter]`):
          Provides additional conditioning to the unet during the denoising process. If you set multiple Adapter as a
          list, the outputs from each Adapter are added together to create one combined additional conditioning.
      adapter_weights (`List[float]`, *optional*, defaults to None):
          List of floats representing the weight which will be multiply to each adapter's output before adding them
          together.
      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 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 details.
      feature_extractor ([`CLIPFeatureExtractor`]):
          Model that extracts features from generated images to be used as inputs for the `safety_checker`.
class_docstr_tok: ["Pipeline","for","text-to-image","generation","using","Stable","Diffusion","augmented","with","T2I-Adapter","https",":","\/\/arxiv.org\/abs\/2302.08453","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",":","adapter","(","[","`","T2IAdapter","`","]","or","[","`","MultiAdapter","`","]","or","`","List","[","T2IAdapter","]","`",")",":","Provides","additional","conditioning","to","the","unet","during","the","denoising","process",".","If","you","set","multiple","Adapter","as","a","list",",","the","outputs","from","each","Adapter","are","added","together","to","create","one","combined","additional","conditioning",".","adapter_weights","(","`","List","[","float","]","`",",","*","optional","*",",","defaults","to","None",")",":","List","of","floats","representing","the","weight","which","will","be","multiply","to","each","adapter","'s","output","before","adding","them","together",".","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","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","details",".","feature_extractor","(","[","`","CLIPFeatureExtractor","`","]",")",":","Model","that","extracts","features","from","generated","images","to","be","used","as","inputs","for","the","`","safety_checker","`","."]
docstr: Enables the FreeU mechanism as in https://arxiv.org/abs/2309.11497.
  
  The suffixes after the scaling factors represent the stages where they are being applied.
  
  Please refer to the [official repository](https://github.com/ChenyangSi/FreeU) for combinations of the values
  that are known to work well for different pipelines such as Stable Diffusion v1, v2, and Stable Diffusion XL.
  
  Args:
      s1 (`float`):
          Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to
          mitigate "oversmoothing effect" in the enhanced denoising process.
      s2 (`float`):
          Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to
          mitigate "oversmoothing effect" in the enhanced denoising process.
      b1 (`float`): Scaling factor for stage 1 to amplify the contributions of backbone features.
      b2 (`float`): Scaling factor for stage 2 to amplify the contributions of backbone features.
docstr_tok: ["Enables","the","FreeU","mechanism","as","in","https",":","\/\/arxiv.org\/abs\/2309.11497",".","The","suffixes","after","the","scaling","factors","represent","the","stages","where","they","are","being","applied",".","Please","refer","to","the","[","official","repository","]","(","https",":","\/\/github.com\/ChenyangSi\/FreeU",")","for","combinations","of","the","values","that","are","known","to","work","well","for","different","pipelines","such","as","Stable","Diffusion","v1",",","v2",",","and","Stable","Diffusion","XL",".","Args",":","s1","(","`","float","`",")",":","Scaling","factor","for","stage","1","to","attenuate","the","contributions","of","the","skip","features",".","This","is","done","to","mitigate","``","oversmoothing","effect","''","in","the","enhanced","denoising","process",".","s2","(","`","float","`",")",":","Scaling","factor","for","stage","2","to","attenuate","the","contributions","of","the","skip","features",".","This","is","done","to","mitigate","``","oversmoothing","effect","''","in","the","enhanced","denoising","process",".","b1","(","`","float","`",")",":","Scaling","factor","for","stage","1","to","amplify","the","contributions","of","backbone","features",".","b2","(","`","float","`",")",":","Scaling","factor","for","stage","2","to","amplify","the","contributions","of","backbone","features","."]
code: def enable_freeu(self, s1: float, s2: float, b1: float, b2: float):
      r"""Enables the FreeU mechanism as in https://arxiv.org/abs/2309.11497.
  
      The suffixes after the scaling factors represent the stages where they are being applied.
  
      Please refer to the [official repository](https://github.com/ChenyangSi/FreeU) for combinations of the values
      that are known to work well for different pipelines such as Stable Diffusion v1, v2, and Stable Diffusion XL.
  
      Args:
          s1 (`float`):
              Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to
              mitigate "oversmoothing effect" in the enhanced denoising process.
          s2 (`float`):
              Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to
              mitigate "oversmoothing effect" in the enhanced denoising process.
          b1 (`float`): Scaling factor for stage 1 to amplify the contributions of backbone features.
          b2 (`float`): Scaling factor for stage 2 to amplify the contributions of backbone features.
      """
      if not hasattr(self, "unet"):
          raise ValueError(
              "The pipeline must have `unet` for using FreeU."
          )
      self.unet.enable_freeu(s1=s1, s2=s2, b1=b1, b2=b2)
  
imports: import inspect
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
  from ...image_processor import VaeImageProcessor
  from ...loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, MultiAdapter, T2IAdapter, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import PIL_INTERPOLATION, USE_PEFT_BACKEND, BaseOutput, 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
label_desc: Use image node_id 12 for calling the StableDiffusionAdapterPipeline obj's underlying member method code with example usage: obj.enable_freeu(s1, s2, b1, b2) without return types