feat(recipe): send embedded recipe workflow to ComfyUI canvas

This commit is contained in:
Will Miao
2026-08-20 22:18:13 +08:00
parent 0905e2be6e
commit 3ebf256c5d
24 changed files with 1145 additions and 27 deletions
+22
View File
@@ -49,6 +49,28 @@ export async function fetchRecipeDetails(recipeId) {
return response.json();
}
export async function sendRecipeWorkflow(recipeId) {
if (!recipeId) {
throw new Error('Unable to determine recipe ID');
}
const encodedRecipeId = encodeURIComponent(recipeId);
const response = await fetch(`${RECIPE_ENDPOINTS.detail}/${encodedRecipeId}/send-workflow`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
const result = await response.json();
if (!response.ok) {
return { success: false, error: result.error || response.statusText };
}
return result;
}
/**
* Fetch recipes with pagination for virtual scrolling
* @param {number} page - Page number to fetch