mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
Refactor API structure to unify model operations
- Introduced MODEL_TYPES and MODEL_CONFIG for centralized model type management. - Created a unified API client for checkpoints and loras to streamline operations. - Updated all API calls in checkpointApi.js and loraApi.js to use the new client. - Simplified context menus and model card operations to leverage the unified API client. - Enhanced state management to accommodate new model types and their configurations. - Added virtual scrolling functions for recipes and improved loading states. - Refactored modal utilities to handle model exclusion and deletion generically. - Improved error handling and user feedback across various operations.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { showToast } from '../utils/uiHelpers.js';
|
||||
import { showToast, updateFolderTags } from '../utils/uiHelpers.js';
|
||||
import { state, getCurrentPageState } from '../state/index.js';
|
||||
import { modalManager } from './ModalManager.js';
|
||||
import { getStorageItem } from '../utils/storageHelpers.js';
|
||||
import { updateFolderTags } from '../api/baseModelApi.js';
|
||||
|
||||
class MoveManager {
|
||||
constructor() {
|
||||
@@ -219,7 +218,7 @@ class MoveManager {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch('/api/loras/move_model', {
|
||||
const response = await fetch('/api/move_model', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -257,7 +256,7 @@ class MoveManager {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch('/api/loras/move_models_bulk', {
|
||||
const response = await fetch('/api/move_models_bulk', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user