Disable the OSInsert FluxFillPipeline patch and restore upstream behavior.
()
| 51 | |
| 52 | |
| 53 | def disable_patch() -> None: |
| 54 | """Disable the OSInsert FluxFillPipeline patch and restore upstream behavior.""" |
| 55 | global _PATCH_ENABLED |
| 56 | if not _PATCH_ENABLED: |
| 57 | return |
| 58 | |
| 59 | upstream_mod = importlib.import_module("diffusers.pipelines.flux.pipeline_flux_fill") |
| 60 | if _ORIG_CALL is not None: |
| 61 | upstream_mod.FluxFillPipeline.__call__ = _ORIG_CALL |
| 62 | |
| 63 | _PATCH_ENABLED = False |
| 64 | |
| 65 | |
| 66 | @contextmanager |