mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
Use weights_only for loading (#3427)
Co-authored-by: Manuel Schmid <9307310+mashb1t@users.noreply.github.com>
This commit is contained in:
co-authored by
Manuel Schmid
parent
1a53e0676a
commit
da3d4d006f
+1
-1
@@ -231,7 +231,7 @@ def get_previewer(model):
|
||||
if vae_approx_filename in VAE_approx_models:
|
||||
VAE_approx_model = VAE_approx_models[vae_approx_filename]
|
||||
else:
|
||||
sd = torch.load(vae_approx_filename, map_location='cpu')
|
||||
sd = torch.load(vae_approx_filename, map_location='cpu', weights_only=True)
|
||||
VAE_approx_model = VAEApprox()
|
||||
VAE_approx_model.load_state_dict(sd)
|
||||
del sd
|
||||
|
||||
@@ -196,7 +196,7 @@ class InpaintWorker:
|
||||
|
||||
if inpaint_head_model is None:
|
||||
inpaint_head_model = InpaintHead()
|
||||
sd = torch.load(inpaint_head_model_path, map_location='cpu')
|
||||
sd = torch.load(inpaint_head_model_path, map_location='cpu', weights_only=True)
|
||||
inpaint_head_model.load_state_dict(sd)
|
||||
|
||||
feed = torch.cat([
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ def perform_upscale(img):
|
||||
|
||||
if model is None:
|
||||
model_filename = downloading_upscale_model()
|
||||
sd = torch.load(model_filename)
|
||||
sd = torch.load(model_filename, weights_only=True)
|
||||
sdo = OrderedDict()
|
||||
for k, v in sd.items():
|
||||
sdo[k.replace('residual_block_', 'RDB')] = v
|
||||
|
||||
Reference in New Issue
Block a user