mcmonkeyprojects / sd-infinity-grid-generator-script

Infinite-Axis Grid Generator for Stable Diffusion!
MIT License
180 stars 24 forks source link

Rework of hypernetwork handling in Auto1111 webui breaks the generator #26

Closed itswhateverman closed 1 year ago

itswhateverman commented 1 year ago

A recent automatic1111 webui update https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/40ff6db5325fc34ad4fa35e80cb1e7768d9f7e75 reworked how hypernetworks are handled, and subsequent runs of the generator fail with the following:

`Traceback (most recent call last): File "A:\ZZZ_SD3\stable-diffusion-webui\extensions\sd-infinity-grid-generator-script\scripts\infinity_grid.py", line 703, in run result = runner.run(dry_run) File "A:\ZZZ_SD3\stable-diffusion-webui\extensions\sd-infinity-grid-generator-script\scripts\infinity_grid.py", line 464, in run oldHnStrength = hypernetwork.HypernetworkModule.multiplier AttributeError: type object 'HypernetworkModule' has no attribute 'multiplier'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "A:\ZZZ_SD3\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(*args, *kwargs)) File "A:\ZZZ_SD3\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(args, *kwargs) File "A:\ZZZ_SD3\stable-diffusion-webui\modules\txt2img.py", line 49, in txt2img processed = modules.scripts.scripts_txt2img.run(p, args) File "A:\ZZZ_SD3\stable-diffusion-webui\modules\scripts.py", line 337, in run processed = script.run(p, *script_args) File "A:\ZZZ_SD3\stable-diffusion-webui\extensions\sd-infinity-grid-generator-script\scripts\infinity_grid.py", line 702, in run with SettingsFixer(): File "A:\ZZZ_SD3\stable-diffusion-webui\extensions\sd-infinity-grid-generator-script\scripts\infinity_grid.py", line 507, in exit hypernetwork.apply_strength() AttributeError: module 'modules.hypernetworks.hypernetwork' has no attribute 'apply_strength'`

mcmonkey4eva commented 1 year ago

Fixed, error is gone - and the original hypernetwork support is removed from the grid.

For the record of anyone trying to use Hypernetworks intentionally and coming across this issue: In the new Auto WebUI update, hypernetworks are now part of the prompt, <hypernet:(NAME):(STRENGTH)>, like <hypernet:nai_anime_3:1> for example.

You can use promptReplace to alter these in a grid, see the change to the MegaGrid.yml in the linked commit above for an example.