From 8d4ebcd5ef61256abde6687191707ac69d6baa53 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 18 Jun 2026 11:45:32 +0200 Subject: [PATCH] processors multiple fixes Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 1 + modules/control/proc/anyline/__init__.py | 2 +- .../leres/pix2pix/options/base_options.py | 6 ++-- modules/control/proc/lotus/__init__.py | 4 +++ modules/control/proc/mediapipe_face.py | 8 ++--- modules/control/proc/midas/api.py | 9 +++--- modules/control/proc/normalbae/__init__.py | 21 +++++++++++++ .../proc/segment_anything/utils/onnx.py | 7 ++--- .../models/base_models/midas_repo/hubconf.py | 6 ++-- .../midas_repo/midas/backbones/next_vit.py | 1 - .../zoedepth/models/zoedepth/zoedepth_v1.py | 12 ++++---- .../models/zoedepth_nk/zoedepth_nk_v1.py | 14 ++++----- modules/control/processor.py | 15 +++++----- modules/control/processors.py | 30 ++++++++++--------- scripts/flux_tools.py | 2 +- 15 files changed, 80 insertions(+), 58 deletions(-) create mode 100644 modules/control/proc/normalbae/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 21c3130fb..df67a219b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `sdnq` warn instead of error for triton - `insightface` missing dependencies - `pulid` import paths + - `processors` init code and multiple fixes ## Update for 2026-06-16 diff --git a/modules/control/proc/anyline/__init__.py b/modules/control/proc/anyline/__init__.py index 2f37d952a..623ab8ff3 100644 --- a/modules/control/proc/anyline/__init__.py +++ b/modules/control/proc/anyline/__init__.py @@ -10,7 +10,7 @@ class AnylineDetector: def from_pretrained(cls, pretrained_model_or_path="TheMistoAI/MistoLine", cache_dir=None, local_files_only=False): from installer import install install('controlnet-aux', quiet=True) - from controlnet_aux import AnylineDetector as _AnylineDetector + from controlnet_aux.anyline import AnylineDetector as _AnylineDetector model = _AnylineDetector.from_pretrained(pretrained_model_or_path, filename="MTEED.pth", subfolder="Anyline", cache_dir=cache_dir) return cls(model) diff --git a/modules/control/proc/leres/pix2pix/options/base_options.py b/modules/control/proc/leres/pix2pix/options/base_options.py index 2ff2c7822..60892de61 100644 --- a/modules/control/proc/leres/pix2pix/options/base_options.py +++ b/modules/control/proc/leres/pix2pix/options/base_options.py @@ -1,10 +1,8 @@ import argparse import os -from ..util import util -# import torch -from .. import models -# import pix2pix.data import numpy as np +from modules.control.proc.leres.pix2pix.util import util +from modules.control.proc.leres.pix2pix import models class BaseOptions(): """This class defines options used during both training and test time. diff --git a/modules/control/proc/lotus/__init__.py b/modules/control/proc/lotus/__init__.py index c275c35e1..0e8765511 100644 --- a/modules/control/proc/lotus/__init__.py +++ b/modules/control/proc/lotus/__init__.py @@ -64,9 +64,13 @@ class LotusDetector: # Concatenate along channel dim: [rgb_latents, noise_latents] latent_input = torch.cat([rgb_latents, noise_latents], dim=1) # UNet forward pass with task embedding as class_labels + latent_input = latent_input.to(self.unet.dtype) + prompt_embeds = prompt_embeds.to(self.unet.dtype) + task_emb = task_emb.to(self.unet.dtype) prediction = self.unet(latent_input, timestep, encoder_hidden_states=prompt_embeds, class_labels=task_emb).sample # Decode prediction prediction = prediction / self.vae.config.scaling_factor + prediction = prediction.to(self.vae.dtype) decoded = self.vae.decode(prediction).sample if opts.control_move_processor: self._to("cpu") diff --git a/modules/control/proc/mediapipe_face.py b/modules/control/proc/mediapipe_face.py index ceda9f857..87befff50 100644 --- a/modules/control/proc/mediapipe_face.py +++ b/modules/control/proc/mediapipe_face.py @@ -9,12 +9,10 @@ checked_ok = False def check_dependencies(): global checked_ok # pylint: disable=global-statement - from installer import installed, install + from installer import install from modules.logger import log - packages = [('mediapipe', 'mediapipe')] - for pkg in packages: - if not installed(pkg[1], quiet=True): - install(pkg[0], pkg[1], ignore=False) + install('mediapipe') + # install('protobuf==4.25.6', 'protobuf', no_deps=True, reinstall=True, force=True) try: import mediapipe as mp # pylint: disable=unused-import checked_ok = True diff --git a/modules/control/proc/midas/api.py b/modules/control/proc/midas/api.py index c08c02cdd..38b6735f9 100644 --- a/modules/control/proc/midas/api.py +++ b/modules/control/proc/midas/api.py @@ -2,14 +2,13 @@ import cv2 import os -import torch import torch.nn as nn from torchvision.transforms import Compose -from .midas.dpt_depth import DPTDepthModel -from .midas.midas_net import MidasNet -from .midas.midas_net_custom import MidasNet_small -from .midas.transforms import Resize, NormalizeImage, PrepareForNet +from modules.control.proc.midas.midas.dpt_depth import DPTDepthModel +from modules.control.proc.midas.midas.midas_net import MidasNet +from modules.control.proc.midas.midas.midas_net_custom import MidasNet_small +from modules.control.proc.midas.midas.transforms import Resize, NormalizeImage, PrepareForNet from modules.control.util import annotator_ckpts_path diff --git a/modules/control/proc/normalbae/__init__.py b/modules/control/proc/normalbae/__init__.py new file mode 100644 index 000000000..ab0a67267 --- /dev/null +++ b/modules/control/proc/normalbae/__init__.py @@ -0,0 +1,21 @@ +import numpy as np +from PIL import Image + + +class NormalBaeDetector: + def __init__(self, model): + self.model = model + + @classmethod + def from_pretrained(cls, pretrained_model_or_path="fal/teed", cache_dir=None, local_files_only=False): # pylint: disable=unused-argument + from installer import install + install('controlnet-aux', quiet=True) + from controlnet_aux.normalbae import NormalBaeDetector as _NormalBaeDetector + model = _NormalBaeDetector.from_pretrained(pretrained_model_or_path, filename="5_model.pth") + return cls(model) + + def __call__(self, image, output_type="pil", **kwargs): + if isinstance(image, np.ndarray): + image = Image.fromarray(image) + result = self.model(image, output_type=output_type) + return result diff --git a/modules/control/proc/segment_anything/utils/onnx.py b/modules/control/proc/segment_anything/utils/onnx.py index 103867faf..2d654f33c 100644 --- a/modules/control/proc/segment_anything/utils/onnx.py +++ b/modules/control/proc/segment_anything/utils/onnx.py @@ -4,14 +4,13 @@ # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. +from typing import Tuple import torch import torch.nn as nn from torch.nn import functional as F -from typing import Tuple - -from ..modeling import Sam -from .amg import calculate_stability_score +from modules.control.proc.segment_anything.modeling import Sam +from modules.control.proc.segment_anything.utils.amg import calculate_stability_score class SamOnnxModel(nn.Module): diff --git a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/hubconf.py b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/hubconf.py index e6f593e2d..8ecfcfe77 100644 --- a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/hubconf.py +++ b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/hubconf.py @@ -2,9 +2,9 @@ dependencies = ["torch"] import torch -from .midas.dpt_depth import DPTDepthModel -from .midas.midas_net import MidasNet -from .midas.midas_net_custom import MidasNet_small +from modules.control.proc.zoe.zoedepth.models.base_models.midas_repo.midas.dpt_depth import DPTDepthModel +from modules.control.proc.zoe.zoedepth.models.base_models.midas_repo.midas.midas_net import MidasNet +from modules.control.proc.zoe.zoedepth.models.base_models.midas_repo.midas.midas_net_custom import MidasNet_small def DPT_BEiT_L_512(pretrained=True, **kwargs): """ # This docstring shows up in hub.help() diff --git a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/backbones/next_vit.py b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/backbones/next_vit.py index 776fd2472..d216fc9e4 100644 --- a/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/backbones/next_vit.py +++ b/modules/control/proc/zoe/zoedepth/models/base_models/midas_repo/midas/backbones/next_vit.py @@ -1,7 +1,6 @@ import timm import torch.nn as nn from .utils import activations, forward_default, get_activation -from ..external.next_vit.classification.nextvit import * def forward_next_vit(pretrained, x): diff --git a/modules/control/proc/zoe/zoedepth/models/zoedepth/zoedepth_v1.py b/modules/control/proc/zoe/zoedepth/models/zoedepth/zoedepth_v1.py index 385eaf873..1c9faa0be 100644 --- a/modules/control/proc/zoe/zoedepth/models/zoedepth/zoedepth_v1.py +++ b/modules/control/proc/zoe/zoedepth/models/zoedepth/zoedepth_v1.py @@ -26,12 +26,12 @@ import itertools import torch import torch.nn as nn -from ..depth_model import DepthModel -from ...base_models.midas import MidasCore -from ...layers.attractor import AttractorLayer, AttractorLayerUnnormed -from ...layers.dist_layers import ConditionalLogBinomial -from ...layers.localbins_layers import Projector, SeedBinRegressor, SeedBinRegressorUnnormed -from ...model_io import load_state_from_resource +from modules.control.proc.zoe.zoedepth.models.depth_model import DepthModel +from modules.control.proc.zoe.zoedepth.models.base_models.midas import MidasCore +from modules.control.proc.zoe.zoedepth.models.layers.attractor import AttractorLayer, AttractorLayerUnnormed +from modules.control.proc.zoe.zoedepth.models.layers.dist_layers import ConditionalLogBinomial +from modules.control.proc.zoe.zoedepth.models.layers.localbins_layers import Projector, SeedBinRegressor, SeedBinRegressorUnnormed +from modules.control.proc.zoe.zoedepth.models.model_io import load_state_from_resource class ZoeDepth(DepthModel): diff --git a/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py b/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py index 2c295013e..d927c37a6 100644 --- a/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py +++ b/modules/control/proc/zoe/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py @@ -27,13 +27,13 @@ import itertools import torch import torch.nn as nn -from ..depth_model import DepthModel -from ...base_models.midas import MidasCore -from ...layers.attractor import AttractorLayer, AttractorLayerUnnormed -from ...layers.dist_layers import ConditionalLogBinomial -from ...layers.localbins_layers import Projector, SeedBinRegressor, SeedBinRegressorUnnormed -from ...layers.patch_transformer import PatchTransformerEncoder -from ...model_io import load_state_from_resource +from modules.control.proc.zoe.zoedepth.models.depth_model import DepthModel +from modules.control.proc.zoe.zoedepth.models.base_models.midas import MidasCore +from modules.control.proc.zoe.zoedepth.models.layers.attractor import AttractorLayer, AttractorLayerUnnormed +from modules.control.proc.zoe.zoedepth.models.layers.dist_layers import ConditionalLogBinomial +from modules.control.proc.zoe.zoedepth.models.layers.localbins_layers import Projector, SeedBinRegressor, SeedBinRegressorUnnormed +from modules.control.proc.zoe.zoedepth.models.layers.patch_transformer import PatchTransformerEncoder +from modules.control.proc.zoe.zoedepth.models.model_io import load_state_from_resource class ZoeDepthNK(DepthModel): def __init__(self, core, bin_conf, bin_centers_type="softplus", bin_embedding_dim=128, diff --git a/modules/control/processor.py b/modules/control/processor.py index 9a6fe3175..02e7e9604 100644 --- a/modules/control/processor.py +++ b/modules/control/processor.py @@ -18,8 +18,6 @@ processors = [ # pose 'OpenPose', 'DWPose', - 'MediaPipe Face', - 'DWPose (ONNX)', 'RTMW', 'RTMO', 'ViTPose', @@ -31,8 +29,7 @@ processors = [ 'HED', 'PidiNet', 'MLSD', - 'TEED', - 'Anyline', + 'Anyline (Legacy)', # depth 'Midas Depth Hybrid', 'Leres Depth', @@ -47,16 +44,20 @@ processors = [ 'Marigold Depth LCM', 'Lotus Depth', # normal - 'Normal Bae', + 'Normal Bae (Legacy)', 'DSINE', 'StableNormal', 'Marigold Normals', # segmentation - 'SegmentAnything', - 'SAM 2.1', + 'SegmentAnything 1.0', + 'SegmentAnything 2.1', 'OneFormer', # other 'Shuffle', + # legacy + 'MediaPipe Face (Legacy)', + 'DWPose (Legacy)', + 'TEED (Legacy)', ] diff --git a/modules/control/processors.py b/modules/control/processors.py index 1f03f5594..37d7d926d 100644 --- a/modules/control/processors.py +++ b/modules/control/processors.py @@ -16,8 +16,6 @@ config = { 'None': {}, # pose models 'OpenPose': {'class': None, 'group': 'Pose', 'checkpoint': True, 'params': {'include_body': True, 'include_hand': False, 'include_face': False}}, - 'MediaPipe Face': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'max_faces': 1, 'min_confidence': 0.5}}, - 'DWPose (ONNX)': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, 'RTMW': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3, 'draw_body_pose': True, 'draw_hand_pose': True, 'draw_face_pose': True}}, 'RTMO': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, 'ViTPose': {'class': None, 'group': 'Pose', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'usyd-community/vitpose-plus-base'}, 'params': {'min_confidence': 0.3}}, @@ -29,8 +27,6 @@ config = { 'HED': {'class': None, 'group': 'Edge', 'checkpoint': True, 'params': {'scribble': False, 'safe': False}}, 'PidiNet': {'class': None, 'group': 'Edge', 'checkpoint': True, 'params': {'scribble': False, 'safe': False, 'apply_filter': False}}, 'MLSD': {'class': None, 'group': 'Edge', 'checkpoint': True, 'params': {'thr_v': 0.1, 'thr_d': 0.1}}, - 'TEED': {'class': None, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'fal/teed'}, 'params': {}}, - 'Anyline': {'class': None, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'TheMistoAI/MistoLine'}, 'params': {}}, # depth models 'Midas Depth Hybrid': {'class': None, 'group': 'Depth', 'checkpoint': True, 'params': {'bg_th': 0.1, 'depth_and_normal': False}}, 'Leres Depth': {'class': None, 'group': 'Depth', 'checkpoint': True, 'params': {'boost': False, 'thr_a': 0, 'thr_b': 0}}, @@ -45,16 +41,21 @@ config = { 'Marigold Depth LCM': {'class': None, 'group': 'Depth', 'checkpoint': True, 'params': {'denoising_steps': 1, 'ensemble_size': 1, 'processing_res': 768, 'match_input_res': True, 'color_map': 'None'}, 'load_config': {'pretrained_model_or_path': 'prs-eth/marigold-depth-lcm-v1-0'}}, 'Lotus Depth': {'class': None, 'group': 'Depth', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'jingheya/lotus-depth-g-v2-1-disparity'}, 'params': {'color_map': 'inferno'}}, # normal models - 'Normal Bae': {'class': None, 'group': 'Normal', 'checkpoint': True, 'params': {}}, 'DSINE': {'class': None, 'group': 'Normal', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'hugoycj/DSINE-hub'}, 'params': {}}, 'StableNormal': {'class': None, 'group': 'Normal', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'Stable-X/StableNormal'}, 'params': {}}, 'Marigold Normals': {'class': None, 'group': 'Normal', 'checkpoint': True, 'params': {'denoising_steps': 4, 'ensemble_size': 4, 'processing_res': 768, 'match_input_res': True}, 'load_config': {'pretrained_model_or_path': 'prs-eth/marigold-normals-v1-1'}}, # segmentation models - 'SegmentAnything': {'class': None, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Base', 'params': {}}, - 'SAM 2.1': {'class': None, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Large', 'load_config': {'pretrained_model_or_path': 'facebook/sam2.1-hiera-large'}, 'params': {}}, + 'SegmentAnything 1.0': {'class': None, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Base', 'params': {}}, + 'SegmentAnything 2.1': {'class': None, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Large', 'load_config': {'pretrained_model_or_path': 'facebook/sam2.1-hiera-large'}, 'params': {}}, 'OneFormer': {'class': None, 'group': 'Segmentation', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'shi-labs/oneformer_ade20k_swin_large'}, 'params': {}}, # other models 'Shuffle': {'class': None, 'group': 'Other', 'checkpoint': False, 'params': {}}, + # legacy models + 'MediaPipe Face (Legacy)': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'max_faces': 1, 'min_confidence': 0.5}}, + 'DWPose (Legacy)': {'class': None, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, + 'TEED (Legacy)': {'class': None, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'fal/teed'}, 'params': {}}, + 'Anyline (Legacy)': {'class': None, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'TheMistoAI/MistoLine'}, 'params': {}}, + 'Normal Bae (Legacy)': {'class': None, 'group': 'Normal', 'checkpoint': True, 'params': {}}, } @@ -81,6 +82,7 @@ def delay_load_config(): from modules.control.proc.depth_pro import DepthProDetector from modules.control.proc.depth_anything_v2 import DepthAnythingV2Detector from modules.control.proc.teed import TEEDDetector + from modules.control.proc.normalbae import NormalBaeDetector from modules.control.proc.anyline import AnylineDetector from modules.control.proc.rtmlib_pose import RtmlibPoseDetector from modules.control.proc.vitpose import ViTPoseDetector @@ -95,8 +97,8 @@ def delay_load_config(): 'None': {}, # pose models 'OpenPose': {'class': OpenposeDetector, 'group': 'Pose', 'checkpoint': True, 'params': {'include_body': True, 'include_hand': False, 'include_face': False}}, - 'MediaPipe Face': {'class': MediapipeFaceDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'max_faces': 1, 'min_confidence': 0.5}}, - 'DWPose (ONNX)': {'class': RtmlibPoseDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, + 'MediaPipe Face (Legacy)': {'class': MediapipeFaceDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'max_faces': 1, 'min_confidence': 0.5}}, + 'DWPose (Legacy)': {'class': RtmlibPoseDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, 'RTMW': {'class': RtmlibPoseDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3, 'draw_body_pose': True, 'draw_hand_pose': True, 'draw_face_pose': True}}, 'RTMO': {'class': RtmlibPoseDetector, 'group': 'Pose', 'checkpoint': False, 'params': {'min_confidence': 0.3}}, 'ViTPose': {'class': ViTPoseDetector, 'group': 'Pose', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'usyd-community/vitpose-plus-base'}, 'params': {'min_confidence': 0.3}}, @@ -108,8 +110,8 @@ def delay_load_config(): 'HED': {'class': HEDdetector, 'group': 'Edge', 'checkpoint': True, 'params': {'scribble': False, 'safe': False}}, 'PidiNet': {'class': PidiNetDetector, 'group': 'Edge', 'checkpoint': True, 'params': {'scribble': False, 'safe': False, 'apply_filter': False}}, 'MLSD': {'class': MLSDdetector, 'group': 'Edge', 'checkpoint': True, 'params': {'thr_v': 0.1, 'thr_d': 0.1}}, - 'TEED': {'class': TEEDDetector, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'fal/teed'}, 'params': {}}, - 'Anyline': {'class': AnylineDetector, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'TheMistoAI/MistoLine'}, 'params': {}}, + 'TEED (Legacy)': {'class': TEEDDetector, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'fal/teed'}, 'params': {}}, + 'Anyline (Legacy)': {'class': AnylineDetector, 'group': 'Edge', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'TheMistoAI/MistoLine'}, 'params': {}}, # depth models 'Midas Depth Hybrid': {'class': MidasDetector, 'group': 'Depth', 'checkpoint': True, 'params': {'bg_th': 0.1, 'depth_and_normal': False}}, 'Leres Depth': {'class': LeresDetector, 'group': 'Depth', 'checkpoint': True, 'params': {'boost': False, 'thr_a': 0, 'thr_b': 0}}, @@ -124,13 +126,13 @@ def delay_load_config(): 'Marigold Depth LCM': {'class': MarigoldDetector, 'group': 'Depth', 'checkpoint': True, 'params': {'denoising_steps': 1, 'ensemble_size': 1, 'processing_res': 768, 'match_input_res': True, 'color_map': 'None'}, 'load_config': {'pretrained_model_or_path': 'prs-eth/marigold-depth-lcm-v1-0'}}, 'Lotus Depth': {'class': LotusDetector, 'group': 'Depth', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'jingheya/lotus-depth-g-v2-1-disparity'}, 'params': {'color_map': 'inferno'}}, # normal models - 'Normal Bae': {'class': None, 'group': 'Normal', 'checkpoint': True, 'params': {}}, + 'Normal Bae (Legacy)': {'class': NormalBaeDetector, 'group': 'Normal', 'checkpoint': True, 'params': {}}, 'DSINE': {'class': DSINEDetector, 'group': 'Normal', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'hugoycj/DSINE-hub'}, 'params': {}}, 'StableNormal': {'class': StableNormalDetector, 'group': 'Normal', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'Stable-X/StableNormal'}, 'params': {}}, 'Marigold Normals': {'class': MarigoldNormalsDetector, 'group': 'Normal', 'checkpoint': True, 'params': {'denoising_steps': 4, 'ensemble_size': 4, 'processing_res': 768, 'match_input_res': True}, 'load_config': {'pretrained_model_or_path': 'prs-eth/marigold-normals-v1-1'}}, # segmentation models - 'SegmentAnything': {'class': SamDetector, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Base', 'params': {}}, - 'SAM 2.1': {'class': Sam2Detector, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Large', 'load_config': {'pretrained_model_or_path': 'facebook/sam2.1-hiera-large'}, 'params': {}}, + 'SegmentAnything 1.0': {'class': SamDetector, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Base', 'params': {}}, + 'SegmentAnything 2.1': {'class': Sam2Detector, 'group': 'Segmentation', 'checkpoint': True, 'model': 'Large', 'load_config': {'pretrained_model_or_path': 'facebook/sam2.1-hiera-large'}, 'params': {}}, 'OneFormer': {'class': OneFormerDetector, 'group': 'Segmentation', 'checkpoint': True, 'load_config': {'pretrained_model_or_path': 'shi-labs/oneformer_ade20k_swin_large'}, 'params': {}}, # other models 'Shuffle': {'class': ContentShuffleDetector, 'group': 'Other', 'checkpoint': False, 'params': {}}, diff --git a/scripts/flux_tools.py b/scripts/flux_tools.py index fec213181..ee358e920 100644 --- a/scripts/flux_tools.py +++ b/scripts/flux_tools.py @@ -113,7 +113,7 @@ class FluxToolsScript(scripts_manager.Script): shared.opts.data["sd_model_checkpoint"] = "black-forest-labs/FLUX.1-Canny-dev" sd_models.reload_model_weights(op='model', revision="refs/pr/1") if processor_canny is None: - from controlnet_aux import CannyDetector + from modules.control.proc.canny import CannyDetector processor_canny = CannyDetector() if process: control_image = processor_canny(image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024)