Skip to content

Commit

Permalink
dont unload controlnets when changhing ip adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
painebenjamin committed Jan 19, 2024
1 parent 1a9da83 commit c3ded9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/python/enfugue/diffusion/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5359,12 +5359,13 @@ def memoize_callback(images: List[PIL.Image.Image]) -> None:
if hasattr(self, "_pipeline"):
if self._ip_adapter_model is None:
if self._pipeline.ip_adapter_loaded:
self.unload_pipeline("disabling IP adapter")
self.unload_pipeline("disabling IP adapter", False)
else:
if not self._pipeline.ip_adapter_loaded:
self.unload_pipeline("enabling IP adapter")
self.unload_pipeline("enabling IP adapter", False)
elif self.ip_adapter.model != self._ip_adapter_model:
self.unload_pipeline("changing IP adapter model")
self.unload_pipeline("changing IP adapter model", False)

pipe = self.pipeline # type: ignore

# Check refining settings
Expand Down

0 comments on commit c3ded9e

Please sign in to comment.