From 8b2d200f770fc8fa6cd34ff827767f45769c13a7 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Sun, 19 Jul 2026 15:46:34 +0200 Subject: [PATCH] Normalize select_safetensors to diffusion_models --- core/type_utils.py | 1 + tests/test_downloads_tab_workflow_route.mjs | 7 +++++++ tests/test_unified_helpers.py | 2 +- web/resolver/search/download_target_methods.js | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/type_utils.py b/core/type_utils.py index 316e8bf..a0a83c0 100644 --- a/core/type_utils.py +++ b/core/type_utils.py @@ -170,6 +170,7 @@ CATEGORY_MAP = { "diffusers": "diffusers", "unet": "diffusion_models", "unet_gguf": "diffusion_models", + "select_safetensors": "diffusion_models", "diffusion_model": "diffusion_models", "diffusion_models": "diffusion_models", "clip": "text_encoders", diff --git a/tests/test_downloads_tab_workflow_route.mjs b/tests/test_downloads_tab_workflow_route.mjs index 63ac1a3..0d53801 100644 --- a/tests/test_downloads_tab_workflow_route.mjs +++ b/tests/test_downloads_tab_workflow_route.mjs @@ -1469,6 +1469,13 @@ test('download category normalization maps unet gguf to diffusion models', () => assert.equal(normalizeDownloadCategory('UNET GGUF'), 'diffusion_models'); }); +test('download category normalization maps select safetensors alias to diffusion models', () => { + const normalizeDownloadCategory = eval(`(${extractMethod(downloadTargetMethodsSource, 'normalizeDownloadCategory')})`); + + assert.equal(normalizeDownloadCategory('select_safetensors'), 'diffusion_models'); + assert.equal(normalizeDownloadCategory('SELECT SAFETENSORS'), 'diffusion_models'); +}); + test('hash match label map numbers distinct matched hashes', () => { const normalizeSearchResultSha256 = eval(`(${extractMethod(searchPanelMethodsSource, 'normalizeSearchResultSha256')})`); const getLocalMatchHash = eval(`(${extractMethod(searchPanelMethodsSource, 'getLocalMatchHash')})`); diff --git a/tests/test_unified_helpers.py b/tests/test_unified_helpers.py index 99892a3..3e6543b 100644 --- a/tests/test_unified_helpers.py +++ b/tests/test_unified_helpers.py @@ -1194,6 +1194,7 @@ class UnifiedHelpersTests(unittest.TestCase): from core.type_utils import resolve_model_category self.assertEqual(resolve_model_category("checkpoints", target_format="folder"), "checkpoints") self.assertEqual(resolve_model_category("lora", target_format="folder"), "loras") + self.assertEqual(resolve_model_category("select_safetensors", target_format="folder"), "diffusion_models") self.assertEqual(resolve_model_category("checkpoint", target_format="civitai"), "Checkpoint") self.assertEqual(resolve_model_category("diffusion_models", target_format="civitai"), "Checkpoint") self.assertEqual(resolve_model_category("loras", target_format="civitai"), "LORA") @@ -1216,4 +1217,3 @@ class UnifiedHelpersTests(unittest.TestCase): self.assertIn("Cookie", call_kwargs["headers"]) - diff --git a/web/resolver/search/download_target_methods.js b/web/resolver/search/download_target_methods.js index cd8c3d1..c1cc91f 100644 --- a/web/resolver/search/download_target_methods.js +++ b/web/resolver/search/download_target_methods.js @@ -109,6 +109,7 @@ export const downloadTargetMethods = { upscaler: 'upscale_models', unet: 'diffusion_models', unet_gguf: 'diffusion_models', + select_safetensors: 'diffusion_models', diffusion_model: 'diffusion_models', diffusion_models: 'diffusion_models', clip: 'text_encoders',