codemichaeld commited on
Commit
ff86b3c
·
verified ·
1 Parent(s): fe875a8

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +7 -6
README.md CHANGED
@@ -13,9 +13,9 @@ tags:
13
  - **Source**: `https://huggingface.co/spacepxl/Wan2.1-VAE-upscale2x`
14
  - **File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1.safetensors`
15
  - **FP8 Format**: `E5M2`
16
- - **LoRA Rank**: 128
17
  - **Architecture Target**: vae
18
- - **LoRA File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1-lora-r128-vae.safetensors`
19
  - **FP8 File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1-fp8-e5m2.safetensors`
20
 
21
  ## Usage (Inference)
@@ -25,7 +25,7 @@ import torch
25
 
26
  # Load FP8 model
27
  fp8_state = load_file("Wan2.1_VAE_upscale2x_imageonly_real_v1-fp8-e5m2.safetensors")
28
- lora_state = load_file("Wan2.1_VAE_upscale2x_imageonly_real_v1-lora-r128-vae.safetensors")
29
 
30
  # Reconstruct approximate original weights
31
  reconstructed = {}
@@ -36,11 +36,12 @@ for key in fp8_state:
36
  if A.ndim == 2 and B.ndim == 2:
37
  lora_weight = B @ A
38
  else:
39
- # Handle convolutional LoRA (simplified)
40
- lora_weight = torch.zeros_like(fp8_state[key], dtype=torch.float32)
 
41
  reconstructed[key] = fp8_state[key].to(torch.float32) + lora_weight
42
  else:
43
  reconstructed[key] = fp8_state[key].to(torch.float32)
44
  ```
45
 
46
- > Requires PyTorch ≥ 2.1 for FP8 support. Use the same architecture selection during inference.
 
13
  - **Source**: `https://huggingface.co/spacepxl/Wan2.1-VAE-upscale2x`
14
  - **File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1.safetensors`
15
  - **FP8 Format**: `E5M2`
16
+ - **LoRA Rank**: 64
17
  - **Architecture Target**: vae
18
+ - **LoRA File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1-lora-r64-vae.safetensors`
19
  - **FP8 File**: `Wan2.1_VAE_upscale2x_imageonly_real_v1-fp8-e5m2.safetensors`
20
 
21
  ## Usage (Inference)
 
25
 
26
  # Load FP8 model
27
  fp8_state = load_file("Wan2.1_VAE_upscale2x_imageonly_real_v1-fp8-e5m2.safetensors")
28
+ lora_state = load_file("Wan2.1_VAE_upscale2x_imageonly_real_v1-lora-r64-vae.safetensors")
29
 
30
  # Reconstruct approximate original weights
31
  reconstructed = {}
 
36
  if A.ndim == 2 and B.ndim == 2:
37
  lora_weight = B @ A
38
  else:
39
+ # Conv LoRA: simplified reconstruction
40
+ lora_weight = F.conv2d(fp8_state[key].unsqueeze(0).to(torch.float32), A, groups=1)[:, :B.shape[0]]
41
+ lora_weight = lora_weight.squeeze(0) + F.conv2d(fp8_state[key].unsqueeze(0).to(torch.float32), B, groups=1).squeeze(0)
42
  reconstructed[key] = fp8_state[key].to(torch.float32) + lora_weight
43
  else:
44
  reconstructed[key] = fp8_state[key].to(torch.float32)
45
  ```
46
 
47
+ > Requires PyTorch ≥ 2.1 for FP8 support. Use matching architecture during inference.