fix the bug 'Linear' object has no attribute 'weight_function'

fix the bug 'Linear' object has no attribute 'weight_function'
This commit is contained in:
qiaoce 2025-02-21 09:13:19 +08:00 committed by GitHub
parent cc9d669c62
commit 38ed808658
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,7 @@ def wipe_lowvram_weight(m):
m.comfy_cast_weights = m.prev_comfy_cast_weights
del m.prev_comfy_cast_weights
if not hasattr(m, "weight_function"):
if hasattr(m, "weight_function"):
m.weight_function = []
if hasattr(m, "bias_function"):
@ -781,6 +781,8 @@ class ModelPatcher:
if move_weight:
cast_weight = self.force_cast_weights
m.to(device_to)
if not hasattr(m, "weight_function"):
m.weight_function=[]
module_mem += move_weight_functions(m, device_to)
if lowvram_possible:
if weight_key in self.patches: