Downloads · 30 days
71
6% of all-time downloads
codemichaeld/sdxl_clip_g_fp8
sdxl_clip_g_fp8 is a machine learning model from codemichaeld. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
- Source: https://huggingface.co/hum-ma/SDXL-models-GGUF/clip - File: clipg.safetensors - FP8 Format: E5M2 - LoRA Rank: 64 - LoRA File: clipg-lora-r64.safetensors
Downloads · 30 days
71
6% of all-time downloads
All-time downloads
1.1K
Public
Repo size
796 MB
Likes
1
Public
Click a slice to open those files.
.safetensors796 MB · 100%
From the Hugging Face model README
https://huggingface.co/hum-ma/SDXL-models-GGUF/clipclip_g.safetensorsE5M2clip_g-lora-r64.safetensorsfrom safetensors.torch import load_file
import torch
# Load FP8 model
fp8_state = load_file("clip_g-fp8-e5m2.safetensors")
lora_state = load_file("clip_g-lora-r64.safetensors")
# Reconstruct approximate original weights
reconstructed = {}
for key in fp8_state:
if f"lora_A.{key}" in lora_state and f"lora_B.{key}" in lora_state:
A = lora_state[f"lora_A.{key}"].to(torch.float32)
B = lora_state[f"lora_B.{key}"].to(torch.float32)
lora_weight = B @ A # (rank, out) @ (in, rank) -> (out, in)
fp8_weight = fp8_state[key].to(torch.float32)
reconstructed[key] = fp8_weight + lora_weight
else:
reconstructed[key] = fp8_state[key].to(torch.float32)
Requires PyTorch ≥ 2.1 for FP8 support.