class_docstr: Uses the CLIP transformer encoder for text (from huggingface)
class_docstr_tok: ["Uses","the","CLIP","transformer","encoder","for","text","(","from","huggingface",")"]
code: def __init__(
      self,
      version="openai/clip-vit-large-patch14",
      device="cuda",
      max_length=77,
      freeze=True,
      layer="last",
      layer_idx=None,
  ):  # clip-vit-base-patch32
      super().__init__()
      assert layer in self.LAYERS
      self.tokenizer = CLIPTokenizer.from_pretrained(version)
      self.transformer = CLIPTextModel.from_pretrained(version)
      self.device = device
      self.max_length = max_length
      if freeze:
          self.freeze()
      self.layer = layer
      self.layer_idx = layer_idx
      if layer == "hidden":
          assert layer_idx is not None
          assert 0 <= abs(layer_idx) <= 12
  
imports: import torch
  import torch.nn
  import kornia
  from torch.utils.checkpoint import checkpoint
  from transformers import T5Tokenizer, T5EncoderModel, CLIPTokenizer, CLIPTextModel
  import open_clip
  from ldm.util import default, count_params, autocast
  from ldm.modules.diffusionmodules.upscaling import ImageConcatWithNoiseAugmentation
  from ldm.modules.diffusionmodules.openaimodel import Timestep
label_desc: Use image node_id 1 to create a new FrozenCLIPEmbedder object from inherited base classes: AbstractEncoder with example: obj = FrozenCLIPEmbedder(version, device, max_length, freeze, layer, layer_idx)