mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-21 11:11:26 -03:00
fix(download): accept HuggingFace blob URLs in download dialog
detectUrlType only matched /resolve/ links, so pasting a HF web preview (/blob/) URL fell through to direct-http and surfaced a misleading 'Invalid CivitAI URL format' error. Treat blob URLs as hf-resolve.
This commit is contained in:
@@ -55,6 +55,18 @@ describe('DownloadManager.detectUrlType — HF URL detection', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('detects HF blob (web preview) URL as resolve', () => {
|
||||
const result = DownloadManager.detectUrlType(
|
||||
'https://huggingface.co/Comfy-Org/z_image_turbo/blob/main/split_files/diffusion_models/z_image_turbo_bf16.safetensors'
|
||||
);
|
||||
expect(result).toEqual({
|
||||
type: 'hf-resolve',
|
||||
repo: 'Comfy-Org/z_image_turbo',
|
||||
revision: 'main',
|
||||
filename: 'split_files/diffusion_models/z_image_turbo_bf16.safetensors',
|
||||
});
|
||||
});
|
||||
|
||||
it('detects CivitAI URL', () => {
|
||||
const result = DownloadManager.detectUrlType(
|
||||
'https://civitai.com/models/123/some-model'
|
||||
|
||||
Reference in New Issue
Block a user