mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: Add Civitai model version retrieval for Checkpoints and update error handling in download managers
This commit is contained in:
@@ -76,8 +76,12 @@ export class CheckpointDownloadManager {
|
||||
throw new Error('Invalid Civitai URL format');
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/civitai/versions/${modelId}`);
|
||||
const response = await fetch(`/api/checkpoints/civitai/versions/${modelId}`);
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
if (errorData && errorData.error && errorData.error.includes('Model type mismatch')) {
|
||||
throw new Error('This model is not a Checkpoint. Please switch to the LoRAs page to download LoRA models.');
|
||||
}
|
||||
throw new Error('Failed to fetch model versions');
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,10 @@ export class DownloadManager {
|
||||
|
||||
const response = await fetch(`/api/civitai/versions/${modelId}`);
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
if (errorData && errorData.error && errorData.error.includes('Model type mismatch')) {
|
||||
throw new Error('This model is not a LoRA. Please switch to the Checkpoints page to download checkpoint models.');
|
||||
}
|
||||
throw new Error('Failed to fetch model versions');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user