fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
This commit is contained in:
coderabbitai[bot]
2026-04-16 04:37:55 +00:00
committed by GitHub
co-authored by CodeRabbit
parent bafd34d48b
commit 43fce69abd
+16 -4
View File
@@ -1063,12 +1063,24 @@ def _temporary_prefer_tiled_vae_encode(vae: Any):
def _wrap_vae_encode_for_inpaint_node(func: Callable[..., Any]) -> Callable[..., Any]:
supported_kwargs = frozenset(inspect.signature(func).parameters)
@functools.wraps(func)
def wrapper(self, vae, pixels, mask, grow_mask_by=6):
def wrapper(self, *args, **kwargs):
# Filter kwargs to only include those supported by the wrapped function
filtered_kwargs = {key: value for key, value in kwargs.items() if key in supported_kwargs}
# Supply default grow_mask_by if not present and supported
if "grow_mask_by" in supported_kwargs and "grow_mask_by" not in filtered_kwargs:
filtered_kwargs["grow_mask_by"] = 6
if REGISTRY.get_policy() != "sticky_gpu":
return func(self, vae, pixels, mask, grow_mask_by=grow_mask_by)
return func(self, *args, **filtered_kwargs)
# Extract vae from args for the context manager
vae = args[0] if args else kwargs.get("vae")
with _temporary_prefer_tiled_vae_encode(vae):
return func(self, vae, pixels, mask, grow_mask_by=grow_mask_by)
return func(self, *args, **filtered_kwargs)
return wrapper
@@ -1627,4 +1639,4 @@ def install_patches() -> None:
REGISTRY.refresh_runtime_state()
_PATCHED = True
_LOG.info("GPU Resident Loader: monkey patches active on ComfyUI loader and residency paths")
_LOG.info("GPU Resident Loader: monkey patches active on ComfyUI loader and residency paths")