class_docstr: NanoStableDiffusionImg2ImgPipeline.
class_docstr_tok: ["NanoStableDiffusionImg2ImgPipeline","."]
docstr: Get the pretrained model.
docstr_tok: ["Get","the","pretrained","model","."]
code: def from_pretrained(cls, *args, **kwargs):
      """Get the pretrained model."""
      base = NanoDiffusionPipeline.from_pretrained(
          StableDiffusionImg2ImgPipeline, *args, **kwargs
      )
      return cls(
          vae=base.vae,
          text_encoder=base.text_encoder,
          tokenizer=base.tokenizer,
          unet=base.unet,
          scheduler=base.scheduler,
          safety_checker=base.safety_checker,
          feature_extractor=base.feature_extractor,
          requires_safety_checker=base.requires_safety_checker,
      )
  
imports: import os
  import functools
  import diffusers
  from huggingface_hub import snapshot_download
  from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
  from diffusers import DiffusionPipeline, StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
  from diffusers import AutoencoderKL, UNet2DConditionModel
  from bigdl.nano.diffusion.utils.paths import *
  from bigdl.nano.pytorch import InferenceOptimizer
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.diffusion.common.optimize import load_optimized_unet, load_optimized_vae_decoder
label_desc: Use image node_id 2 for calling the NanoStableDiffusionImg2ImgPipeline obj's underlying member method code with example usage: obj.from_pretrained(cls) and returns: cls