class_docstr: A prior that generates clip image feature based on the text prompt.
  
  :param config: yaml config to define the decoder.
  :param tokenizer: tokenizer used in clip.
  :param clip_mean: mean to normalize the clip image feature (zero-mean, unit variance).
  :param clip_std: std to noramlize the clip image feature (zero-mean, unit variance).
code: def __init__(self, config, tokenizer, clip_mean, clip_std):
      super().__init__()
  
      self._conf = config
      self._model_conf = config.model.hparams
      self._diffusion_kwargs = dict(
          steps=config.diffusion.steps,
          learn_sigma=config.diffusion.learn_sigma,
          sigma_small=config.diffusion.sigma_small,
          noise_schedule=config.diffusion.noise_schedule,
          use_kl=config.diffusion.use_kl,
          predict_xstart=config.diffusion.predict_xstart,
          rescale_learned_sigmas=config.diffusion.rescale_learned_sigmas,
          timestep_respacing=config.diffusion.timestep_respacing,
      )
      self._tokenizer = tokenizer
  
      self.register_buffer(
          "clip_mean", clip_mean[None, :], persistent=False
      )
      self.register_buffer(
          "clip_std", clip_std[None, :], persistent=False
      )
  
      causal_mask = self.get_causal_mask()
      self.register_buffer("causal_mask", causal_mask, persistent=False)
  
      self.model = PriorTransformer(
          text_ctx=self._model_conf.text_ctx,
          xf_width=self._model_conf.xf_width,
          xf_layers=self._model_conf.xf_layers,
          xf_heads=self._model_conf.xf_heads,
          xf_final_ln=self._model_conf.xf_final_ln,
          clip_dim=self._model_conf.clip_dim,
      )
  
      cf_token, cf_mask = self.set_cf_text_tensor()
      self.register_buffer("cf_token", cf_token, persistent=False)
      self.register_buffer("cf_mask", cf_mask, persistent=False)
  
file_path: StableDiffusion/ldm/modules/karlo/kakao/models/prior_model.py
imports: import copy
  import torch
  from ldm.modules.karlo.kakao.modules import create_gaussian_diffusion
  from ldm.modules.karlo.kakao.modules.xf import PriorTransformer
label_desc: Use image node_id 1 to create a new PriorDiffusionModel object from inherited base classes: torch.nn with example: obj = PriorDiffusionModel(config, tokenizer, clip_mean, clip_std)