diff --git a/comfy_extras/nodes/nodes_nf4.py b/comfy_extras/nodes/nodes_nf4.py index 59133e2d5..2f10a6007 100644 --- a/comfy_extras/nodes/nodes_nf4.py +++ b/comfy_extras/nodes/nodes_nf4.py @@ -79,7 +79,7 @@ class ForgeParams4bit(Params4bit): if device is not None and device.type == "cuda" and not self.bnb_quantized: return self._quantize(device) else: - n = ForgeParams4bit( + n = ForgeParams4bit( # pylint: disable=unexpected-keyword-arg torch.nn.Parameter.to(self, device=device, dtype=dtype, non_blocking=non_blocking), requires_grad=self.requires_grad, quant_state=copy_quant_state(self.quant_state, device), @@ -134,7 +134,7 @@ class ForgeLoader4Bit(torch.nn.Module): del self.dummy elif hasattr(self, 'dummy'): if prefix + 'weight' in state_dict: - self.weight = ForgeParams4bit( + self.weight = ForgeParams4bit( # pylint: disable=unexpected-keyword-arg state_dict[prefix + 'weight'].to(self.dummy), requires_grad=False, compress_statistics=True, diff --git a/comfy_extras/nodes/nodes_regexp.py b/comfy_extras/nodes/nodes_regexp.py index c21cd426f..219f26ff4 100644 --- a/comfy_extras/nodes/nodes_regexp.py +++ b/comfy_extras/nodes/nodes_regexp.py @@ -20,7 +20,8 @@ class RegexFlags(CustomNode): def execute(self, **kwargs) -> tuple[int]: has_noflag = hasattr(re.RegexFlag, "NOFLAG") - flags = re.RegexFlag.NOFLAG if has_noflag else 0 + # use getattr for python 3.10 compatibility + flags = getattr(re.RegexFlag, "NOFLAG") if has_noflag else 0 for name, on in kwargs.items(): if on and hasattr(re.RegexFlag, name): flags |= int(re.RegexFlag[name])