remove excess condition
This commit is contained in:
parent
a609bd56b4
commit
c707b7df95
@ -501,9 +501,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
|
|||||||
if k == 'sd_vae':
|
if k == 'sd_vae':
|
||||||
sd_vae.reload_vae_weights()
|
sd_vae.reload_vae_weights()
|
||||||
|
|
||||||
if opts.token_merging:
|
if opts.token_merging and not opts.token_merging_hr_only:
|
||||||
|
print("applying token merging to all passes")
|
||||||
if p.hr_second_pass_steps < 1 and not opts.token_merging_hr_only:
|
|
||||||
tomesd.apply_patch(
|
tomesd.apply_patch(
|
||||||
p.sd_model,
|
p.sd_model,
|
||||||
ratio=opts.token_merging_ratio,
|
ratio=opts.token_merging_ratio,
|
||||||
@ -521,6 +520,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
|
|||||||
finally:
|
finally:
|
||||||
# undo model optimizations made by tomesd
|
# undo model optimizations made by tomesd
|
||||||
if opts.token_merging:
|
if opts.token_merging:
|
||||||
|
print('removing token merging model optimizations')
|
||||||
tomesd.remove_patch(p.sd_model)
|
tomesd.remove_patch(p.sd_model)
|
||||||
|
|
||||||
# restore opts to original state
|
# restore opts to original state
|
||||||
@ -961,6 +961,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|
|||||||
# apply token merging optimizations from tomesd for high-res pass
|
# apply token merging optimizations from tomesd for high-res pass
|
||||||
# check if hr_only so we don't redundantly apply patch
|
# check if hr_only so we don't redundantly apply patch
|
||||||
if opts.token_merging and opts.token_merging_hr_only:
|
if opts.token_merging and opts.token_merging_hr_only:
|
||||||
|
print("applying token merging for high-res pass")
|
||||||
tomesd.apply_patch(
|
tomesd.apply_patch(
|
||||||
self.sd_model,
|
self.sd_model,
|
||||||
ratio=opts.token_merging_ratio,
|
ratio=opts.token_merging_ratio,
|
||||||
|
Loading…
Reference in New Issue
Block a user