Enable the OSInsert FluxFillPipeline patch for the current Python process.
()
| 37 | |
| 38 | |
| 39 | def 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 | |
| 53 | def disable_patch() -> None: |
no test coverage detected