mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(tags): implement bulk tag addition and replacement functionality
This commit is contained in:
@@ -306,6 +306,34 @@ export class BaseModelApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
async addTags(filePath, data) {
|
||||
try {
|
||||
const response = await fetch(this.apiConfig.endpoints.addTags, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
file_path: filePath,
|
||||
...data
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to add tags');
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (result.success && result.tags) {
|
||||
state.virtualScroller.updateSingleItem(filePath, { tags: result.tags });
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error('Error adding tags:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async refreshModels(fullRebuild = false) {
|
||||
try {
|
||||
state.loadingManager.showSimpleLoading(
|
||||
|
||||
Reference in New Issue
Block a user