diff --git a/modules/model_quant.py b/modules/model_quant.py index c99ca8945..48bacf0a1 100644 --- a/modules/model_quant.py +++ b/modules/model_quant.py @@ -278,16 +278,16 @@ def load_quanto(msg='', silent=False): def upcast_non_layerwise_modules(model, dtype): # pylint: disable=unused-argument - from diffusers.hooks.layerwise_casting import SUPPORTED_PYTORCH_LAYERS + from diffusers.hooks.layerwise_casting import _GO_LC_SUPPORTED_PYTORCH_LAYERS model_children = list(model.children()) if not model_children: - if not isinstance(model, SUPPORTED_PYTORCH_LAYERS): + if not isinstance(model, _GO_LC_SUPPORTED_PYTORCH_LAYERS): model = model.to(dtype) return model for module in model_children: has_children = list(module.children()) if not has_children: - if not isinstance(module, SUPPORTED_PYTORCH_LAYERS): + if not isinstance(module, _GO_LC_SUPPORTED_PYTORCH_LAYERS): module = module.to(dtype) else: module = upcast_non_layerwise_modules(module, dtype) diff --git a/modules/processing.py b/modules/processing.py index bc96fa20a..c574c814e 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -373,8 +373,8 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed: image.info["parameters"] = info output_images.append(image) - is_grid = len(output_images) == p.batch_size * p.n_iter + 1 and i == 0 - for j, image in enumerate(output_images): + for i, image in enumerate(output_images): + is_grid = len(output_images) == p.batch_size * p.n_iter + 1 and i == 0 # resize after if p.selected_scale_tab_after == 1: p.width_after, p.height_after = int(image.width * p.scale_by_after), int(image.height * p.scale_by_after) diff --git a/pipelines/model_wanai.py b/pipelines/model_wanai.py index 7400bdd10..49503c670 100644 --- a/pipelines/model_wanai.py +++ b/pipelines/model_wanai.py @@ -70,7 +70,7 @@ def load_wan(checkpoint_info, diffusers_load_config={}): transformer_2 = load_transformer(repo_id, diffusers_load_config, 'transformer_2') else: shared.log.error(f'Load model: type=WanAI stage="{shared.opts.model_wan_stage}" unsupported') - return None + return None else: transformer = load_transformer(repo_id, diffusers_load_config, 'transformer') transformer_2 = None