refactor multifile download code

This commit is contained in:
Lincoln Stein
2024-05-17 22:29:19 -04:00
parent 2dae5eb7ad
commit d968c6f379
13 changed files with 262 additions and 144 deletions

View File

@ -133,7 +133,7 @@ class LaMaInfillInvocation(InfillImageProcessorInvocation):
"""Infills transparent areas of an image using the LaMa model"""
def infill(self, image: Image.Image, context: InvocationContext):
with context.models.load_ckpt_from_url(
with context.models.load_and_cache_model(
source="https://github.com/Sanster/models/releases/download/add_big_lama/big-lama.pt",
loader=LaMA.load_jit_model,
) as model: