Implement database & model hashing

This commit is contained in:
pythongosssss
2025-06-01 15:32:02 +01:00
parent d3bd983b91
commit 1cb3c98947
15 changed files with 601 additions and 31 deletions

View File

@@ -20,6 +20,7 @@
import torch
import math
import struct
from app.model_processor import model_processor
import comfy.checkpoint_pickle
import safetensors.torch
import numpy as np
@@ -53,6 +54,9 @@ def load_torch_file(ckpt, safe_load=False, device=None, return_metadata=False):
if device is None:
device = torch.device("cpu")
metadata = None
model_processor.process_file(ckpt)
if ckpt.lower().endswith(".safetensors") or ckpt.lower().endswith(".sft"):
try:
with safetensors.safe_open(ckpt, framework="pt", device=device.type) as f: