refactoring: use the same code for "scan task" and realtime DB population

This commit is contained in:
bigcat88
2025-08-25 13:31:56 +03:00
parent d7464e9e73
commit 09dabf95bc
7 changed files with 178 additions and 98 deletions

View File

@@ -29,6 +29,7 @@ import itertools
from torch.nn.functional import interpolate
from einops import rearrange
from comfy.cli_args import args
from app.assets_manager import populate_db_with_asset
MMAP_TORCH_FILES = args.mmap_torch_files
DISABLE_MMAP = args.disable_mmap
@@ -102,6 +103,7 @@ def load_torch_file(ckpt, safe_load=False, device=None, return_metadata=False):
else:
sd = pl_sd
populate_db_with_asset(ckpt)
return (sd, metadata) if return_metadata else sd
def save_torch_file(sd, ckpt, metadata=None):