class_docstr: Pipeline for upscaling Stable Diffusion output image resolution by a factor of 2.
  
  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.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.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 [`EulerDiscreteScheduler`] to be used in combination with `unet` to denoise the encoded image latents.
class_docstr_tok: ["Pipeline","for","upscaling","Stable","Diffusion","output","image","resolution","by","a","factor","of","2",".","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.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.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","[","`","EulerDiscreteScheduler","`","]","to","be","used","in","combination","with","`","unet","`","to","denoise","the","encoded","image","latents","."]
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 warnings
  from typing import Callable, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  from transformers import CLIPTextModel, CLIPTokenizer
  from ...image_processor import PipelineImageInput, VaeImageProcessor
  from ...loaders import FromSingleFileMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...schedulers import EulerDiscreteScheduler
  from ...utils import deprecate, logging
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
label_desc: Use image node_id 6 for calling the StableDiffusionLatentUpscalePipeline obj's underlying member method code with example usage: obj.enable_freeu(s1, s2, b1, b2) without return types