mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-05 08:16:47 +08:00
Merge 56e9de4f9f into d113d1cc32
This commit is contained in:
commit
b61d6b07e2
@ -122,6 +122,11 @@ class LowVramPatch:
|
|||||||
self.set_func = set_func
|
self.set_func = set_func
|
||||||
|
|
||||||
def __call__(self, weight):
|
def __call__(self, weight):
|
||||||
|
if weight.dtype == torch.float8_e4m3fn or weight.dtype == torch.float8_e5m2:
|
||||||
|
temp_weight = weight.to(torch.bfloat16)
|
||||||
|
patched_weight = comfy.lora.calculate_weight(self.patches[self.key], temp_weight, self.key, intermediate_dtype=torch.bfloat16)
|
||||||
|
return patched_weight.to(weight.dtype)
|
||||||
|
|
||||||
return comfy.lora.calculate_weight(self.patches[self.key], weight, self.key, intermediate_dtype=weight.dtype)
|
return comfy.lora.calculate_weight(self.patches[self.key], weight, self.key, intermediate_dtype=weight.dtype)
|
||||||
|
|
||||||
LOWVRAM_PATCH_ESTIMATE_MATH_FACTOR = 2
|
LOWVRAM_PATCH_ESTIMATE_MATH_FACTOR = 2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user