mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-06 22:10:14 -03:00
fix(ui): exit bulk mode after send-to-workflow completes
This commit is contained in:
@@ -556,7 +556,8 @@ export class BulkManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await sendLoraToWorkflow(loraSyntaxes.join(', '), replaceMode, 'lora');
|
const exitBulkMode = () => { if (state.bulkMode) this.toggleBulkMode(); };
|
||||||
|
await sendLoraToWorkflow(loraSyntaxes.join(', '), replaceMode, 'lora', exitBulkMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _sendAllEmbeddingsToWorkflow() {
|
async _sendAllEmbeddingsToWorkflow() {
|
||||||
@@ -578,7 +579,8 @@ export class BulkManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const joinedCode = embeddingCodes.join(', ');
|
const joinedCode = embeddingCodes.join(', ');
|
||||||
await sendEmbeddingToWorkflow(joinedCode);
|
const exitBulkMode = () => { if (state.bulkMode) this.toggleBulkMode(); };
|
||||||
|
await sendEmbeddingToWorkflow(joinedCode, exitBulkMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
showBulkDeleteModal() {
|
showBulkDeleteModal() {
|
||||||
|
|||||||
@@ -656,7 +656,7 @@ async function ensureRelativeModelPath(modelPath, collectionType) {
|
|||||||
* @param {string} syntaxType - The type of syntax ('lora' or 'recipe')
|
* @param {string} syntaxType - The type of syntax ('lora' or 'recipe')
|
||||||
* @returns {Promise<boolean>} - Whether the operation was successful
|
* @returns {Promise<boolean>} - Whether the operation was successful
|
||||||
*/
|
*/
|
||||||
export async function sendLoraToWorkflow(loraSyntax, replaceMode = false, syntaxType = 'lora') {
|
export async function sendLoraToWorkflow(loraSyntax, replaceMode = false, syntaxType = 'lora', onComplete = null) {
|
||||||
const registry = await fetchWorkflowRegistry();
|
const registry = await fetchWorkflowRegistry();
|
||||||
if (!registry) {
|
if (!registry) {
|
||||||
return false;
|
return false;
|
||||||
@@ -681,7 +681,9 @@ export async function sendLoraToWorkflow(loraSyntax, replaceMode = false, syntax
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nodeKeys.length === 1) {
|
if (nodeKeys.length === 1) {
|
||||||
return await sendLoraToNodes([nodeKeys[0]], loraNodes, loraSyntax, replaceMode, syntaxType);
|
const result = await sendLoraToNodes([nodeKeys[0]], loraNodes, loraSyntax, replaceMode, syntaxType);
|
||||||
|
if (result && typeof onComplete === 'function') onComplete();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const actionType =
|
const actionType =
|
||||||
@@ -695,8 +697,11 @@ export async function sendLoraToWorkflow(loraSyntax, replaceMode = false, syntax
|
|||||||
showNodeSelector(loraNodes, {
|
showNodeSelector(loraNodes, {
|
||||||
actionType,
|
actionType,
|
||||||
actionMode,
|
actionMode,
|
||||||
onSend: (selectedNodeIds) =>
|
onSend: async (selectedNodeIds) => {
|
||||||
sendLoraToNodes(selectedNodeIds, loraNodes, loraSyntax, replaceMode, syntaxType),
|
const result = await sendLoraToNodes(selectedNodeIds, loraNodes, loraSyntax, replaceMode, syntaxType);
|
||||||
|
if (result && typeof onComplete === 'function') onComplete();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -967,7 +972,7 @@ async function sendTextToNodes(nodeIds, nodesMap, text, mode, messages = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function sendEmbeddingToWorkflow(embeddingCode) {
|
export async function sendEmbeddingToWorkflow(embeddingCode, onComplete = null) {
|
||||||
const registry = await fetchWorkflowRegistry();
|
const registry = await fetchWorkflowRegistry();
|
||||||
if (!registry) {
|
if (!registry) {
|
||||||
return false;
|
return false;
|
||||||
@@ -995,8 +1000,11 @@ export async function sendEmbeddingToWorkflow(embeddingCode) {
|
|||||||
missingTargetMessage: translate('uiHelpers.workflow.noTargetNodeSelected', {}, 'No target node selected'),
|
missingTargetMessage: translate('uiHelpers.workflow.noTargetNodeSelected', {}, 'No target node selected'),
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSend = (selectedNodeIds) =>
|
const handleSend = async (selectedNodeIds) => {
|
||||||
sendTextToNodes(selectedNodeIds, textNodes, embeddingCode, 'append', messages);
|
const result = await sendTextToNodes(selectedNodeIds, textNodes, embeddingCode, 'append', messages);
|
||||||
|
if (result && typeof onComplete === 'function') onComplete();
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
if (nodeKeys.length === 1) {
|
if (nodeKeys.length === 1) {
|
||||||
return await handleSend([nodeKeys[0]]);
|
return await handleSend([nodeKeys[0]]);
|
||||||
|
|||||||
Reference in New Issue
Block a user