Skip to content

Commit

Permalink
Fix skip_until_exit logic bug breaking injection after first run of m…
Browse files Browse the repository at this point in the history
…odel
  • Loading branch information
Kosinkadink committed Sep 21, 2024
1 parent 5f450d3 commit f28d892
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion comfy/model_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def __enter__(self):

def __exit__(self, *args):
if self.was_injected:
if self.skip_until_exit or not self.model.skip_injection:
if self.skip_until_exit:
self.model.skip_injection = self.prev_skip_injection
self.model.inject_model()
elif not self.model.skip_injection:
self.model.inject_model()
self.model.skip_injection = self.prev_skip_injection

Expand Down

0 comments on commit f28d892

Please sign in to comment.