From 91542d4f8b99dfb65a3f5c56cc24fea91d93858a Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 28 May 2024 01:37:40 -0400 Subject: [PATCH] Import spandrel_extra_arches if present. I will not add this dependency to the default ones because models in the spandrel_extra_arches package are non commercial and therefore not compatible with free software licenses like the one ComfyUI uses. If you don't mind this you can install it manually yourself. --- comfy_extras/nodes_upscale_model.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/comfy_extras/nodes_upscale_model.py b/comfy_extras/nodes_upscale_model.py index 03f29446..bca79ef2 100644 --- a/comfy_extras/nodes_upscale_model.py +++ b/comfy_extras/nodes_upscale_model.py @@ -1,10 +1,19 @@ import os +import logging from spandrel import ModelLoader, ImageModelDescriptor from comfy import model_management import torch import comfy.utils import folder_paths +try: + from spandrel_extra_arches import EXTRA_REGISTRY + from spandrel import MAIN_REGISTRY + MAIN_REGISTRY.add(*EXTRA_REGISTRY) + logging.info("Successfully imported spandrel_extra_arches: support for non commercial upscale models.") +except: + pass + class UpscaleModelLoader: @classmethod def INPUT_TYPES(s):