From 0428c6e47aeddd9c8e3f12ae2666e4e7078d6c66 Mon Sep 17 00:00:00 2001 From: aria1th <35677394+aria1th@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:30:32 +0900 Subject: [PATCH] missing scripts.xy_grid really? --- patches/hypernetwork.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/hypernetwork.py b/patches/hypernetwork.py index 02e670e..424efc8 100644 --- a/patches/hypernetwork.py +++ b/patches/hypernetwork.py @@ -7,7 +7,6 @@ import traceback import torch from torch.nn.init import normal_, xavier_uniform_, zeros_, xavier_normal_, kaiming_uniform_, kaiming_normal_ -import scripts.xy_grid from modules.shared import opts try: from modules.hashes import sha256 @@ -597,8 +596,12 @@ if hasattr(modules.hypernetworks.hypernetwork, 'apply_strength'): modules.hypernetworks.hypernetwork.apply_strength = apply_strength modules.hypernetworks.hypernetwork.Hypernetwork = Hypernetwork modules.hypernetworks.hypernetwork.HypernetworkModule = HypernetworkModule -if hasattr(scripts.xy_grid, 'apply_hypernetwork_strength'): - scripts.xy_grid.apply_hypernetwork_strength = apply_hypernetwork_strength +try: + import scripts.xy_grid + if hasattr(scripts.xy_grid, 'apply_hypernetwork_strength'): + scripts.xy_grid.apply_hypernetwork_strength = apply_hypernetwork_strength +except (ModuleNotFoundError, ImportError): + pass # Fix calculating hash for multiple hns processing.create_infotext = create_infotext \ No newline at end of file