MCPcopy Create free account
hub / github.com/bcmi/OSInsert-Image-Composition / enable_patch

Function enable_patch

diffusers_osinsert/__init__.py:39–50  ·  view source on GitHub ↗

Enable the OSInsert FluxFillPipeline patch for the current Python process.

()

Source from the content-addressed store, hash-verified

37
38
39def enable_patch() -> None:
40 """Enable the OSInsert FluxFillPipeline patch for the current Python process."""
41 global _ORIG_CALL, _PATCH_ENABLED
42 if _PATCH_ENABLED:
43 return
44
45 upstream_mod = importlib.import_module("diffusers.pipelines.flux.pipeline_flux_fill")
46 if _ORIG_CALL is None:
47 _ORIG_CALL = upstream_mod.FluxFillPipeline.__call__
48
49 upstream_mod.FluxFillPipeline.__call__ = _load_patched_call()
50 _PATCH_ENABLED = True
51
52
53def disable_patch() -> None:

Callers 1

patch_contextFunction · 0.85

Calls 1

_load_patched_callFunction · 0.85

Tested by

no test coverage detected