Skip to content

Commit

Permalink
Merge pull request #4120 from aliencaocao/enable-override-hypernet
Browse files Browse the repository at this point in the history
Enable override_settings to take effect for hypernetworks
  • Loading branch information
AUTOMATIC1111 authored Nov 20, 2022
2 parents c81d440 + c13e234 commit 828438b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,15 @@ def process_images(p: StableDiffusionProcessing) -> Processed:

try:
for k, v in p.override_settings.items():
setattr(opts, k, v) # we don't call onchange for simplicity which makes changing model, hypernet impossible
setattr(opts, k, v) # we don't call onchange for simplicity which makes changing model impossible
if k == 'sd_hypernetwork': shared.reload_hypernetworks() # make onchange call for changing hypernet since it is relatively fast to load on-change, while SD models are not

res = process_images_inner(p)

finally:
finally: # restore opts to original state
for k, v in stored_opts.items():
setattr(opts, k, v)
if k == 'sd_hypernetwork': shared.reload_hypernetworks()

return res

Expand Down

0 comments on commit 828438b

Please sign in to comment.