mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-21 19:21:27 -03:00
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
// Controls components index file
|
|
import { PageControls } from './PageControls.js';
|
|
import { LorasControls } from './LorasControls.js';
|
|
import { CheckpointsControls } from './CheckpointsControls.js';
|
|
import { EmbeddingsControls } from './EmbeddingsControls.js';
|
|
import { OtherControls } from './OtherControls.js';
|
|
|
|
// Export the classes
|
|
export { PageControls, LorasControls, CheckpointsControls, EmbeddingsControls, OtherControls };
|
|
|
|
/**
|
|
* Factory function to create the appropriate controls based on page type
|
|
* @param {string} pageType - The type of page ('loras', 'checkpoints', 'embeddings', or 'other')
|
|
* @returns {PageControls} - The appropriate controls instance
|
|
*/
|
|
export function createPageControls(pageType) {
|
|
if (pageType === 'loras') {
|
|
return new LorasControls();
|
|
} else if (pageType === 'checkpoints') {
|
|
return new CheckpointsControls();
|
|
} else if (pageType === 'embeddings') {
|
|
return new EmbeddingsControls();
|
|
} else if (pageType === 'other') {
|
|
return new OtherControls();
|
|
} else {
|
|
console.error(`Unknown page type: ${pageType}`);
|
|
return null;
|
|
}
|
|
}
|