class_docstr: A sampler for text-to-image generation.
  :param root_dir: directory for model checkpoints.
  :param sampling_type: ["default", "fast"]
class_docstr_tok: ["A","sampler","for","text-to-image","generation",".",":","param","root_dir",":","directory","for","model","checkpoints",".",":","param","sampling_type",":","[","``","default","''",",","``","fast","''","]"]
code: def from_pretrained(
      cls,
      root_dir: str,
      clip_model_path: str,
      clip_stat_path: str,
      sampling_type: str = "default",
  ):
      model = cls(
          root_dir=root_dir,
          sampling_type=sampling_type,
      )
      model.load_clip(clip_model_path)
      model.load_prior(
          f"{CKPT_PATH['prior']}",
          clip_stat_path=clip_stat_path,
          prior_config="configs/karlo/prior_1B_vit_l.yaml",
      )
      model.load_decoder(
          f"{CKPT_PATH['decoder']}",
          decoder_config="configs/karlo/decoder_900M_vit_l.yaml",
      )
      model.load_sr_64_256(
          CKPT_PATH["sr_256"],
          sr_config="configs/karlo/improved_sr_64_256_1.4B.yaml",
      )
      return model
  
file_path: stablediffusion/ldm/modules/karlo/kakao/sampler.py
imports: from typing import Iterator
  import torch
  import torchvision.transforms.functional
  from torchvision.transforms import InterpolationMode
  from .template import BaseSampler, CKPT_PATH
label_desc: Use image node_id 2 for calling the T2ISampler obj's underlying member method code with example usage: obj.from_pretrained(cls, root_dir, clip_model_path, clip_stat_path, sampling_type) and returns: model