mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 06:32:12 -03:00
Add API endpoint and frontend integration for fetching example image files
This commit is contained in:
@@ -936,4 +936,26 @@ export function scrollToTop(button) {
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get example image files for a specific model from the backend
|
||||
* @param {string} modelHash - The model's hash
|
||||
* @returns {Promise<Array>} Array of file objects with path and metadata
|
||||
*/
|
||||
export async function getExampleImageFiles(modelHash) {
|
||||
try {
|
||||
const response = await fetch(`/api/example-image-files?model_hash=${modelHash}`);
|
||||
const result = await response.json();
|
||||
|
||||
if (result.success) {
|
||||
return result.files;
|
||||
} else {
|
||||
console.error('Failed to get example image files:', result.error);
|
||||
return [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching example image files:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user