load_text_encoder_safetensors

Load HF safetensors weights into the native CLIP text encoder

Description

Loads a HuggingFace CLIPTextModel model.safetensors (e.g. FLUX.1-schnell’s text_encoder) into text_encoder_native, reusing the TorchScript key remaps minus the export prefixes.

Usage

load_text_encoder_safetensors(native_encoder, path, verbose = TRUE)

Arguments

  • native_encoder: Native text encoder module
  • path: Path to model.safetensors (or a directory containing it)
  • verbose: Print loading progress

Value

The native encoder with loaded weights (invisibly)