mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
feat: enhance bulk operations panel styling and update downloadExampleImages method to accept optional modelTypes parameter
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
z-index: var(--z-overlay);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
min-width: 420px;
|
||||
max-width: 900px;
|
||||
width: auto;
|
||||
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -48,6 +50,8 @@
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
min-height: 36px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
@@ -105,6 +109,8 @@
|
||||
@media (max-width: 768px) {
|
||||
.bulk-operations-panel {
|
||||
width: calc(100% - 40px);
|
||||
min-width: unset;
|
||||
max-width: unset;
|
||||
left: 20px;
|
||||
transform: none;
|
||||
border-radius: var(--border-radius-sm);
|
||||
|
||||
@@ -856,7 +856,7 @@ export class BaseModelApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
async downloadExampleImages(modelHashes, modelTypes) {
|
||||
async downloadExampleImages(modelHashes, modelTypes = null) {
|
||||
let ws = null;
|
||||
|
||||
await state.loadingManager.showWithProgress(async (loading) => {
|
||||
|
||||
@@ -281,22 +281,14 @@ function showExampleAccessModal(card, modelType) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine model type (singular form)
|
||||
let modelTypeSingular = 'lora';
|
||||
if (modelType === MODEL_TYPES.CHECKPOINT) {
|
||||
modelTypeSingular = 'checkpoint';
|
||||
} else if (modelType === MODEL_TYPES.EMBEDDING) {
|
||||
modelTypeSingular = 'embedding';
|
||||
}
|
||||
|
||||
// Close the modal
|
||||
modalManager.closeModal('exampleAccessModal');
|
||||
|
||||
try {
|
||||
// Use the appropriate model API client to download examples
|
||||
const apiClient = getModelApiClient(modelType);
|
||||
await apiClient.downloadExampleImages([modelHash], [modelTypeSingular]);
|
||||
|
||||
await apiClient.downloadExampleImages([modelHash]);
|
||||
|
||||
// Open the example images folder if successful
|
||||
openExampleImagesFolder(modelHash);
|
||||
} catch (error) {
|
||||
|
||||
@@ -203,7 +203,6 @@ export class BulkManager {
|
||||
|
||||
toggleCardSelection(card) {
|
||||
const filepath = card.dataset.filepath;
|
||||
const pageState = getCurrentPageState();
|
||||
|
||||
if (card.classList.contains('selected')) {
|
||||
card.classList.remove('selected');
|
||||
|
||||
Reference in New Issue
Block a user