Skip to content

Commit 971cefe

Browse files
Fix pytorch warnings. (#11314)
1 parent da2bfb5 commit 971cefe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

comfy/ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def state_dict(self, *args, destination=None, prefix="", **kwargs):
592592
quant_conf = {"format": self.quant_format}
593593
if self._full_precision_mm:
594594
quant_conf["full_precision_matrix_mult"] = True
595-
sd["{}comfy_quant".format(prefix)] = torch.frombuffer(json.dumps(quant_conf).encode('utf-8'), dtype=torch.uint8)
595+
sd["{}comfy_quant".format(prefix)] = torch.tensor(list(json.dumps(quant_conf).encode('utf-8')), dtype=torch.uint8)
596596
return sd
597597

598598
def _forward(self, input, weight, bias):

comfy/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,6 @@ def convert_old_quants(state_dict, model_prefix="", metadata={}):
12621262
if quant_metadata is not None:
12631263
layers = quant_metadata["layers"]
12641264
for k, v in layers.items():
1265-
state_dict["{}.comfy_quant".format(k)] = torch.frombuffer(json.dumps(v).encode('utf-8'), dtype=torch.uint8)
1265+
state_dict["{}.comfy_quant".format(k)] = torch.tensor(list(json.dumps(v).encode('utf-8')), dtype=torch.uint8)
12661266

12671267
return state_dict, metadata

0 commit comments

Comments
 (0)