mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-09 15:30:16 -03:00
Compare commits
3 Commits
c9e5e784fc
...
0d8805cdee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d8805cdee | ||
|
|
656e24ac9b | ||
|
|
6718b37403 |
@@ -260,8 +260,9 @@ export class RecipeContextMenu extends BaseContextMenu {
|
|||||||
strength: lora.strength || 1.0,
|
strength: lora.strength || 1.0,
|
||||||
|
|
||||||
// Model identifiers
|
// Model identifiers
|
||||||
|
modelId: lora.modelId || lora.model_id || civitaiInfo.modelId,
|
||||||
hash: modelFile?.hashes?.SHA256?.toLowerCase() || lora.hash,
|
hash: modelFile?.hashes?.SHA256?.toLowerCase() || lora.hash,
|
||||||
modelVersionId: civitaiInfo.id || lora.modelVersionId,
|
id: civitaiInfo.id || lora.modelVersionId,
|
||||||
|
|
||||||
// Metadata
|
// Metadata
|
||||||
thumbnailUrl: civitaiInfo.images?.[0]?.url || '',
|
thumbnailUrl: civitaiInfo.images?.[0]?.url || '',
|
||||||
|
|||||||
@@ -1421,6 +1421,7 @@ class RecipeModal {
|
|||||||
strength: lora.strength || 1.0,
|
strength: lora.strength || 1.0,
|
||||||
|
|
||||||
// Model identifiers
|
// Model identifiers
|
||||||
|
modelId: lora.modelId || lora.model_id || civitaiInfo.modelId,
|
||||||
hash: modelFile?.hashes?.SHA256?.toLowerCase() || lora.hash,
|
hash: modelFile?.hashes?.SHA256?.toLowerCase() || lora.hash,
|
||||||
id: civitaiInfo.id || lora.modelVersionId,
|
id: civitaiInfo.id || lora.modelVersionId,
|
||||||
|
|
||||||
|
|||||||
@@ -729,10 +729,12 @@ export class FilterManager {
|
|||||||
const pageState = getCurrentPageState();
|
const pageState = getCurrentPageState();
|
||||||
const storageKey = `${this.currentPage}_filters`;
|
const storageKey = `${this.currentPage}_filters`;
|
||||||
|
|
||||||
// Save filters to localStorage (exclude EMPTY_WILDCARD_MARKER)
|
// Save filters to localStorage (exclude EMPTY_WILDCARD_MARKER and transient search)
|
||||||
const filtersSnapshot = this.cloneFilters();
|
const filtersSnapshot = this.cloneFilters();
|
||||||
// Don't persist EMPTY_WILDCARD_MARKER - it's a runtime-only marker
|
// Don't persist EMPTY_WILDCARD_MARKER - it's a runtime-only marker
|
||||||
filtersSnapshot.baseModel = filtersSnapshot.baseModel.filter(m => m !== EMPTY_WILDCARD_MARKER);
|
filtersSnapshot.baseModel = filtersSnapshot.baseModel.filter(m => m !== EMPTY_WILDCARD_MARKER);
|
||||||
|
// Don't persist search - it's transient and managed by SearchManager
|
||||||
|
delete filtersSnapshot.search;
|
||||||
setStorageItem(storageKey, filtersSnapshot);
|
setStorageItem(storageKey, filtersSnapshot);
|
||||||
|
|
||||||
// Update state with current filters
|
// Update state with current filters
|
||||||
@@ -993,7 +995,7 @@ export class FilterManager {
|
|||||||
license: { ...(this.filters.license || {}) },
|
license: { ...(this.filters.license || {}) },
|
||||||
modelTypes: [...(this.filters.modelTypes || [])],
|
modelTypes: [...(this.filters.modelTypes || [])],
|
||||||
tagLogic: this.filters.tagLogic || 'any',
|
tagLogic: this.filters.tagLogic || 'any',
|
||||||
search: this.filters.search || pageState?.filters?.search || ''
|
search: pageState?.filters?.search ?? ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { translate } from '../../utils/i18nHelpers.js';
|
|||||||
import { getModelApiClient } from '../../api/modelApiFactory.js';
|
import { getModelApiClient } from '../../api/modelApiFactory.js';
|
||||||
import { MODEL_TYPES } from '../../api/apiConfig.js';
|
import { MODEL_TYPES } from '../../api/apiConfig.js';
|
||||||
import { getStorageItem } from '../../utils/storageHelpers.js';
|
import { getStorageItem } from '../../utils/storageHelpers.js';
|
||||||
|
import { state } from '../../state/index.js';
|
||||||
|
|
||||||
export class DownloadManager {
|
export class DownloadManager {
|
||||||
constructor(importManager) {
|
constructor(importManager) {
|
||||||
@@ -125,11 +126,25 @@ export class DownloadManager {
|
|||||||
showToast('toast.recipes.nameSaved', { name: this.importManager.recipeName }, 'success');
|
showToast('toast.recipes.nameSaved', { name: this.importManager.recipeName }, 'success');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close modal
|
|
||||||
modalManager.closeModal('importModal');
|
modalManager.closeModal('importModal');
|
||||||
|
|
||||||
// Refresh the recipe
|
if (isDownloadOnly && state.virtualScroller) {
|
||||||
window.recipeManager.loadRecipes(true);
|
const recipeId = this.importManager.recipeId;
|
||||||
|
try {
|
||||||
|
const detailRes = await fetch(`/api/lm/recipe/${encodeURIComponent(recipeId)}`);
|
||||||
|
if (detailRes.ok) {
|
||||||
|
const updated = await detailRes.json();
|
||||||
|
state.virtualScroller.updateSingleItem(updated.file_path, updated);
|
||||||
|
} else {
|
||||||
|
throw new Error(`API returned ${detailRes.status}`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Failed to update recipe card in-place, falling back to reload:', e);
|
||||||
|
await window.recipeManager.loadRecipes({ resetPage: true, preserveScroll: true });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.recipeManager.loadRecipes({ resetPage: true, preserveScroll: true });
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user