mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-27 05:54:08 -03:00
fix: stop grouping HF/ModelScope models by repository
A repository is not a model identity: collection repos on Hugging Face and ModelScope host many unrelated models, which were wrongly shown as versions of each other. - Hugging Face models no longer auto-group (the Hub exposes no site-native model id) - ModelScope models group by the site's native published-model id (MuseInfo modelVersion.modelId), extracted during enrichment and persisted on the sidecar as source_model_id/source_version_id; unenriched models stay standalone instead of collapsing a whole repo into one group - TensorArt grouping unchanged (its URL id is already model-level) - Frontend group-key derivation mirrors the new backend semantics
This commit is contained in:
@@ -105,13 +105,39 @@ describe('modelSourceHelpers', () => {
|
||||
|
||||
describe('getModelSourceGroupKey', () => {
|
||||
it('matches the backend group-key shapes', () => {
|
||||
expect(getModelSourceGroupKey({ hf_url: 'https://huggingface.co/u/r' })).toBe('hf:u/r');
|
||||
expect(
|
||||
getModelSourceGroupKey({ source_url: 'https://modelscope.cn/models/u/r' })
|
||||
).toBe('ms:u/r');
|
||||
// TensorArt's numeric id already identifies a single model.
|
||||
expect(getModelSourceGroupKey({ source_url: 'https://tensor.art/models/123' })).toBe(
|
||||
'ta:123'
|
||||
);
|
||||
// ModelScope groups by the site-native published-model id.
|
||||
expect(
|
||||
getModelSourceGroupKey({
|
||||
source_url: 'https://modelscope.cn/models/u/r',
|
||||
source_model_id: '555',
|
||||
})
|
||||
).toBe('ms:555');
|
||||
expect(
|
||||
getModelSourceGroupKey({
|
||||
source_url: 'https://www.modelscope.ai/models/u/r',
|
||||
source_model_id: '678',
|
||||
})
|
||||
).toBe('msai:678');
|
||||
});
|
||||
|
||||
it('returns an empty string for sources without a model identity', () => {
|
||||
// Hugging Face repos are not a model identity: never grouped.
|
||||
expect(getModelSourceGroupKey({ hf_url: 'https://huggingface.co/u/r' })).toBe('');
|
||||
// Unenriched ModelScope models stay standalone rather than collapsing
|
||||
// a whole collection repo into one group.
|
||||
expect(
|
||||
getModelSourceGroupKey({ source_url: 'https://modelscope.cn/models/u/r' })
|
||||
).toBe('');
|
||||
expect(
|
||||
getModelSourceGroupKey({
|
||||
source_url: 'https://modelscope.cn/models/u/r',
|
||||
source_model_id: ' ',
|
||||
})
|
||||
).toBe('');
|
||||
});
|
||||
|
||||
it('returns an empty string without a source', () => {
|
||||
|
||||
Reference in New Issue
Block a user