mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-14 07:22:36 +08:00
porting the cast of the temp_weight to the gpu
This commit is contained in:
parent
6d3dee9d16
commit
3e4755ed14
@ -154,7 +154,7 @@ class ModelPatcher:
|
|||||||
self.backup[key] = weight.to(self.offload_device)
|
self.backup[key] = weight.to(self.offload_device)
|
||||||
|
|
||||||
if device_to is not None:
|
if device_to is not None:
|
||||||
temp_weight = weight.float().to(device_to, copy=True)
|
temp_weight = weight.to(device_to, copy=True).float()
|
||||||
else:
|
else:
|
||||||
temp_weight = weight.to(torch.float32, copy=True)
|
temp_weight = weight.to(torch.float32, copy=True)
|
||||||
out_weight = self.calculate_weight(self.patches[key], temp_weight, key).to(weight.dtype)
|
out_weight = self.calculate_weight(self.patches[key], temp_weight, key).to(weight.dtype)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user