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 forward(
      self,
      txt_feat,
      txt_feat_seq,
      mask,
      cf_guidance_scales=None,
      timestep_respacing=None,
      denoised_fn=True,
  ):
      # cfg should be enabled in inference
      assert cf_guidance_scales is not None and all(
          cf_guidance_scales > 0.0
      )
  
      bsz_ = txt_feat.shape[0]
      bsz = bsz_ // 2
  
      def guided_model_fn(x_t, ts, **kwargs):
          half = x_t[: len(x_t) // 2]
          combined = torch.cat([half, half], dim=0)
          model_out = self.model(combined, ts, **kwargs)
          eps, rest = (
              model_out[:, : int(x_t.shape[1])],
              model_out[:, int(x_t.shape[1]) :],
          )
          cond_eps, uncond_eps = torch.split(eps, len(eps) // 2, dim=0)
          half_eps = uncond_eps + cf_guidance_scales.view(-1, 1) * (
              cond_eps - uncond_eps
          )
          eps = torch.cat([half_eps, half_eps], dim=0)
          return torch.cat([eps, rest], dim=1)
  
      cond = {
          "text_emb": txt_feat,
          "text_enc": txt_feat_seq,
          "mask": mask,
          "causal_mask": self.causal_mask,
      }
      sample_fn = self.get_sample_fn(timestep_respacing)
      sample = sample_fn(
          guided_model_fn,
          (bsz_, self.model.clip_dim),
          noise=None,
          device=txt_feat.device,
          clip_denoised=False,
          denoised_fn=lambda x: torch.clamp(x, -10, 10),
          model_kwargs=cond,
      )
      sample = (sample * self.clip_std) + self.clip_mean
  
      return sample[:bsz]
  
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 6 for calling the PriorDiffusionModel obj's underlying member method code with example usage: obj.forward(txt_feat, txt_feat_seq, mask, cf_guidance_scales, timestep_respacing, denoised_fn) and returns: sample, torch