mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 14:42:11 -03:00
refactor: Remove unnecessary workflow data logging and streamline saveRecipeDirectly function for legacy loras widget
This commit is contained in:
@@ -927,10 +927,6 @@ export function addLorasWidget(node, name, opts, callback) {
|
|||||||
// Function to directly save the recipe without dialog
|
// Function to directly save the recipe without dialog
|
||||||
async function saveRecipeDirectly(widget) {
|
async function saveRecipeDirectly(widget) {
|
||||||
try {
|
try {
|
||||||
// Get the workflow data from the ComfyUI app
|
|
||||||
const prompt = await app.graphToPrompt();
|
|
||||||
console.log('Prompt:', prompt);
|
|
||||||
|
|
||||||
// Show loading toast
|
// Show loading toast
|
||||||
if (app && app.extensionManager && app.extensionManager.toast) {
|
if (app && app.extensionManager && app.extensionManager.toast) {
|
||||||
app.extensionManager.toast.add({
|
app.extensionManager.toast.add({
|
||||||
@@ -941,14 +937,9 @@ async function saveRecipeDirectly(widget) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the data - only send workflow JSON
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('workflow_json', JSON.stringify(prompt.output));
|
|
||||||
|
|
||||||
// Send the request
|
// Send the request
|
||||||
const response = await fetch('/api/recipes/save-from-widget', {
|
const response = await fetch('/api/recipes/save-from-widget', {
|
||||||
method: 'POST',
|
method: 'POST'
|
||||||
body: formData
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|||||||
Reference in New Issue
Block a user