mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-14 09:43:22 -03:00
fix(download): accept newer CivitAI file types for primary file selection
Downloads failed with "No suitable file found in metadata" for models whose only file uses newer CivitAI file types (e.g. 'Enhancement LoRA' for Anima/AIR image-editing LoRAs) because the primary-file allowlist only covered legacy types. - unify the weights-type allowlist as MODEL_WEIGHT_FILE_TYPES (py/utils/constants.py) and apply it across download, recipe and metadata-refresh lookups - mirror CivitAI's getPrimaryFile() semantics: prefer weights-type primary, fall back to weights files, then trust CivitAI's primary flag (excluding non-downloadable artifacts like Config/Archive/Workflow) - mirror the allowlist in the frontend via shared isModelWeightFile() helper - add regression tests for the Enhancement LoRA primary-file download, primary-flag fallback and weights-over-non-weights-primary preference
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// CivitAI ModelFile.type values eligible as the main download file.
|
||||
// Mirrors the backend constant MODEL_WEIGHT_FILE_TYPES (py/utils/constants.py).
|
||||
// Keep both lists in sync when CivitAI introduces new file types.
|
||||
export const MODEL_WEIGHT_FILE_TYPES = [
|
||||
'Model',
|
||||
'Pruned Model',
|
||||
'Negative',
|
||||
'UNet',
|
||||
'Diffusion Model',
|
||||
'Enhancement LoRA',
|
||||
];
|
||||
|
||||
export function isModelWeightFile(type) {
|
||||
return MODEL_WEIGHT_FILE_TYPES.includes(type);
|
||||
}
|
||||
Reference in New Issue
Block a user