Commit c707b7df authored by papuSpartan's avatar papuSpartan
Browse files

remove excess condition

parent a609bd56
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -501,9 +501,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
            if k == 'sd_vae':
                sd_vae.reload_vae_weights()

        if opts.token_merging:

            if p.hr_second_pass_steps < 1 and not opts.token_merging_hr_only:
        if opts.token_merging and not opts.token_merging_hr_only:
            print("applying token merging to all passes")
            tomesd.apply_patch(
                p.sd_model,
                ratio=opts.token_merging_ratio,
@@ -521,6 +520,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
    finally:
        # undo model optimizations made by tomesd
        if opts.token_merging:
            print('removing token merging model optimizations')
            tomesd.remove_patch(p.sd_model)

        # restore opts to original state
@@ -961,6 +961,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
        # apply token merging optimizations from tomesd for high-res pass
        # check if hr_only so we don't redundantly apply patch
        if opts.token_merging and opts.token_merging_hr_only:
            print("applying token merging for high-res pass")
            tomesd.apply_patch(
                self.sd_model,
                ratio=opts.token_merging_ratio,