Skip to content

Commit 828438b

Browse files
Merge pull request #4120 from aliencaocao/enable-override-hypernet
Enable override_settings to take effect for hypernetworks
2 parents c81d440 + c13e234 commit 828438b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/processing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,15 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
424424

425425
try:
426426
for k, v in p.override_settings.items():
427-
setattr(opts, k, v) # we don't call onchange for simplicity which makes changing model, hypernet impossible
427+
setattr(opts, k, v) # we don't call onchange for simplicity which makes changing model impossible
428+
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
428429

429430
res = process_images_inner(p)
430431

431-
finally:
432+
finally: # restore opts to original state
432433
for k, v in stored_opts.items():
433434
setattr(opts, k, v)
435+
if k == 'sd_hypernetwork': shared.reload_hypernetworks()
434436

435437
return res
436438

0 commit comments

Comments
 (0)