mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: Implement model description retrieval and update related API endpoints
This commit is contained in:
@@ -970,4 +970,26 @@ export class BaseModelApiClient {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async fetchModelDescription(filePath) {
|
||||
try {
|
||||
const params = new URLSearchParams({ file_path: filePath });
|
||||
const response = await fetch(`${this.apiConfig.endpoints.modelDescription}?${params}`);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch ${this.apiConfig.config.singularName} description: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
return data.description;
|
||||
} else {
|
||||
throw new Error(data.error || `No description found for ${this.apiConfig.config.singularName}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error fetching ${this.apiConfig.config.singularName} description:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user