Skip to content

Commit

Permalink
Limited the U-Net restoration message to only display when it happens
Browse files Browse the repository at this point in the history
  • Loading branch information
h3rmit-git committed Aug 26, 2023
1 parent 2f207ff commit eafc798
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion scripts/fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ def process(self, p, *args):
print("[FABRIC] Skipping U-Net forward pass patching")

def postprocess(self, p, processed, *args):
print("[FABRIC] Restoring original U-Net forward pass")
unpatch_unet_forward_pass(p.sd_model.model.diffusion_model)

images = processed.images[processed.index_of_first_image:]
Expand Down
1 change: 1 addition & 0 deletions scripts/patching.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,6 @@ def patched_attn1_forward(attn1, idx, x, context=None, **kwargs):

def unpatch_unet_forward_pass(unet):
if hasattr(unet, "_fabric_old_forward"):
print("[FABRIC] Restoring original U-Net forward pass")
unet.forward = unet._fabric_old_forward
del unet._fabric_old_forward

0 comments on commit eafc798

Please sign in to comment.