Normalize select_safetensors to diffusion_models
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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')})`);
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user