mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-23 19:51:15 -03:00
Compare commits
3 Commits
ff240db5b1
...
31c54ff068
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31c54ff068 | ||
|
|
21872a8e9e | ||
|
|
612612f1c7 |
@@ -257,7 +257,7 @@ class CivitaiClient:
|
|||||||
"GET",
|
"GET",
|
||||||
f"{self.base_url}/models",
|
f"{self.base_url}/models",
|
||||||
use_auth=True,
|
use_auth=True,
|
||||||
params={"ids": query},
|
params={"ids": query, "nsfw": "true"},
|
||||||
)
|
)
|
||||||
if not success:
|
if not success:
|
||||||
return None
|
return None
|
||||||
@@ -640,7 +640,7 @@ class CivitaiClient:
|
|||||||
"GET",
|
"GET",
|
||||||
f"{self.base_url}/models",
|
f"{self.base_url}/models",
|
||||||
use_auth=True,
|
use_auth=True,
|
||||||
params={"username": username},
|
params={"username": username, "nsfw": "true"},
|
||||||
)
|
)
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
|
|||||||
@@ -4,15 +4,20 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
border-bottom: 1px solid var(--lora-border);
|
border-bottom: 1px solid var(--lora-border);
|
||||||
padding-bottom: 10px;
|
padding-bottom: var(--space-2);
|
||||||
margin-bottom: 10px;
|
margin-bottom: var(--space-3);
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recipe-modal-header h2 {
|
.recipe-modal-header h2 {
|
||||||
font-size: 1.4em; /* Reduced from default h2 size */
|
margin: 0 0 var(--space-1);
|
||||||
line-height: 1.3;
|
padding: var(--space-1);
|
||||||
margin: 0;
|
border-radius: var(--border-radius-xs);
|
||||||
max-height: 2.6em; /* Limit to 2 lines */
|
font-size: 1.5em;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: var(--text-color);
|
||||||
|
max-height: 2.8em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -127,7 +132,7 @@
|
|||||||
/* Recipe Tags styles */
|
/* Recipe Tags styles */
|
||||||
.recipe-tags-container {
|
.recipe-tags-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 6px;
|
margin-top: 0;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +230,62 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Recipe Header Actions */
|
||||||
|
.recipe-header-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--space-2);
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: var(--space-1);
|
||||||
|
flex-shrink: 0;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipe-header-actions:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipe-source-url-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
background: rgba(0, 0, 0, 0.03);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: var(--border-radius-sm);
|
||||||
|
color: var(--text-color);
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 0.9em;
|
||||||
|
transition: all 0.2s;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="dark"] .recipe-source-url-btn {
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border: 1px solid var(--lora-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipe-source-url-btn:hover {
|
||||||
|
background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.1);
|
||||||
|
border-color: var(--lora-accent);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipe-source-url-btn i {
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-height: 860px) {
|
||||||
|
.recipe-header-actions {
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Top Section: Preview and Gen Params */
|
/* Top Section: Preview and Gen Params */
|
||||||
.recipe-top-section {
|
.recipe-top-section {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -1083,13 +1144,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.recipe-modal-header {
|
.recipe-modal-header {
|
||||||
padding-bottom: 6px;
|
padding-bottom: var(--space-1);
|
||||||
margin-bottom: 8px;
|
margin-bottom: var(--space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.recipe-modal-header h2 {
|
.recipe-modal-header h2 {
|
||||||
font-size: 1.25em;
|
font-size: 1.3em;
|
||||||
max-height: 2.5em;
|
max-height: 2.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recipe-tags-container {
|
.recipe-tags-container {
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ class RecipeModal {
|
|||||||
|
|
||||||
this.syncGenerationParams(hydratedRecipe.gen_params);
|
this.syncGenerationParams(hydratedRecipe.gen_params);
|
||||||
this.syncResourcesSection(hydratedRecipe);
|
this.syncResourcesSection(hydratedRecipe);
|
||||||
|
this.syncSourceUrlAction();
|
||||||
|
|
||||||
// Show the modal
|
// Show the modal
|
||||||
modalManager.showModal('recipeModal');
|
modalManager.showModal('recipeModal');
|
||||||
@@ -515,6 +516,7 @@ class RecipeModal {
|
|||||||
} else {
|
} else {
|
||||||
this.updateSourceUrlDisplay(this.currentRecipe.source_path || '');
|
this.updateSourceUrlDisplay(this.currentRecipe.source_path || '');
|
||||||
}
|
}
|
||||||
|
this.syncSourceUrlAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
getPreviewMediaUrl(recipe = {}) {
|
getPreviewMediaUrl(recipe = {}) {
|
||||||
@@ -582,6 +584,30 @@ class RecipeModal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncSourceUrlAction() {
|
||||||
|
const actionsContainer = document.getElementById('recipeHeaderActions');
|
||||||
|
if (!actionsContainer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
actionsContainer.innerHTML = '';
|
||||||
|
|
||||||
|
const sourcePath = this.currentRecipe?.source_path || '';
|
||||||
|
const isValidUrl = sourcePath.startsWith('http://') || sourcePath.startsWith('https://');
|
||||||
|
if (!isValidUrl) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const btn = document.createElement('button');
|
||||||
|
btn.className = 'recipe-source-url-btn';
|
||||||
|
btn.title = sourcePath;
|
||||||
|
btn.innerHTML = '<i class="fas fa-globe"></i> Open Source URL';
|
||||||
|
btn.addEventListener('click', () => {
|
||||||
|
window.open(sourcePath, '_blank');
|
||||||
|
});
|
||||||
|
actionsContainer.appendChild(btn);
|
||||||
|
}
|
||||||
|
|
||||||
syncTagsDisplay(tags) {
|
syncTagsDisplay(tags) {
|
||||||
const tagsContainer = document.getElementById('recipeTagsCompact');
|
const tagsContainer = document.getElementById('recipeTagsCompact');
|
||||||
if (!tagsContainer) {
|
if (!tagsContainer) {
|
||||||
@@ -1316,6 +1342,7 @@ class RecipeModal {
|
|||||||
// Update source URL in the UI
|
// Update source URL in the UI
|
||||||
this.commitField('source_path');
|
this.commitField('source_path');
|
||||||
this.updateSourceUrlDisplay(newSourceUrl, { forceInputSync: true });
|
this.updateSourceUrlDisplay(newSourceUrl, { forceInputSync: true });
|
||||||
|
this.syncSourceUrlAction();
|
||||||
|
|
||||||
// Update the current recipe object
|
// Update the current recipe object
|
||||||
this.currentRecipe.source_path = newSourceUrl;
|
this.currentRecipe.source_path = newSourceUrl;
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
<header class="recipe-modal-header">
|
<header class="recipe-modal-header">
|
||||||
<h2 id="recipeModalTitle">Recipe Details</h2>
|
<h2 id="recipeModalTitle">Recipe Details</h2>
|
||||||
|
<!-- Header Actions: populated dynamically in RecipeModal.js -->
|
||||||
|
<div class="recipe-header-actions" id="recipeHeaderActions"></div>
|
||||||
<!-- Recipe Tags Container -->
|
<!-- Recipe Tags Container -->
|
||||||
<div class="recipe-tags-container">
|
<div class="recipe-tags-container">
|
||||||
<div class="recipe-tags-compact" id="recipeTagsCompact"></div>
|
<div class="recipe-tags-compact" id="recipeTagsCompact"></div>
|
||||||
|
|||||||
@@ -658,6 +658,7 @@ export function addTagsWidget(node, name, opts, callback, wheelSensitivity = 0.0
|
|||||||
textEl.style.maxWidth = "140px";
|
textEl.style.maxWidth = "140px";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tagData.items.length > 1) {
|
||||||
const countBadge = document.createElement("span");
|
const countBadge = document.createElement("span");
|
||||||
countBadge.className = "lm-trigger-count-badge";
|
countBadge.className = "lm-trigger-count-badge";
|
||||||
countBadge.textContent = `${groupState.activeChildren}/${groupState.totalChildren}`;
|
countBadge.textContent = `${groupState.activeChildren}/${groupState.totalChildren}`;
|
||||||
@@ -684,6 +685,7 @@ export function addTagsWidget(node, name, opts, callback, wheelSensitivity = 0.0
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
groupChip.appendChild(countBadge);
|
groupChip.appendChild(countBadge);
|
||||||
|
}
|
||||||
|
|
||||||
if (showStrengthInfo) {
|
if (showStrengthInfo) {
|
||||||
const strengthBadge = createStrengthBadge();
|
const strengthBadge = createStrengthBadge();
|
||||||
@@ -697,7 +699,10 @@ export function addTagsWidget(node, name, opts, callback, wheelSensitivity = 0.0
|
|||||||
groupChip.title = activePreview ? `${tagData.text}\nActive: ${activePreview}` : tagData.text;
|
groupChip.title = activePreview ? `${tagData.text}\nActive: ${activePreview}` : tagData.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
const editButton = document.createElement("button");
|
let editButton = null;
|
||||||
|
|
||||||
|
if (tagData.items.length > 1) {
|
||||||
|
editButton = document.createElement("button");
|
||||||
editButton.type = "button";
|
editButton.type = "button";
|
||||||
editButton.className = "lm-trigger-group-edit-button";
|
editButton.className = "lm-trigger-group-edit-button";
|
||||||
editButton.textContent = "⋯";
|
editButton.textContent = "⋯";
|
||||||
@@ -726,10 +731,11 @@ export function addTagsWidget(node, name, opts, callback, wheelSensitivity = 0.0
|
|||||||
groupChip.addEventListener("contextmenu", openEditor);
|
groupChip.addEventListener("contextmenu", openEditor);
|
||||||
|
|
||||||
groupChip.appendChild(editButton);
|
groupChip.appendChild(editButton);
|
||||||
|
}
|
||||||
|
|
||||||
groupChip.addEventListener("click", (e) => {
|
groupChip.addEventListener("click", (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.target === editButton) {
|
if (editButton && e.target === editButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateWidgetValue(widget, (updatedTags) => {
|
updateWidgetValue(widget, (updatedTags) => {
|
||||||
@@ -740,7 +746,7 @@ export function addTagsWidget(node, name, opts, callback, wheelSensitivity = 0.0
|
|||||||
|
|
||||||
if (showStrengthInfo) {
|
if (showStrengthInfo) {
|
||||||
groupChip.addEventListener("wheel", (e) => {
|
groupChip.addEventListener("wheel", (e) => {
|
||||||
if (e.target === editButton) {
|
if (editButton && e.target === editButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -303,6 +303,8 @@ app.registerExtension({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupMode = groupModeWidget?.value ?? false;
|
||||||
|
|
||||||
const updatedTags = node.tagWidget.value.map((tag) => {
|
const updatedTags = node.tagWidget.value.map((tag) => {
|
||||||
if (!Array.isArray(tag.items)) {
|
if (!Array.isArray(tag.items)) {
|
||||||
return {
|
return {
|
||||||
@@ -311,6 +313,15 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In group mode, default_active only controls the group-level switch.
|
||||||
|
// Children's individual active states are managed exclusively via the group editor.
|
||||||
|
if (groupMode) {
|
||||||
|
return {
|
||||||
|
...tag,
|
||||||
|
active: value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...tag,
|
...tag,
|
||||||
active: value,
|
active: value,
|
||||||
@@ -320,7 +331,6 @@ app.registerExtension({
|
|||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
node.tagWidget.value = updatedTags;
|
node.tagWidget.value = updatedTags;
|
||||||
node.applyTriggerHighlightState?.();
|
node.applyTriggerHighlightState?.();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user