Commit 21553316 authored by m957ymj75urz's avatar m957ymj75urz
Browse files

add batch count to the menu

parent 4ed39cf0
...@@ -641,7 +641,8 @@ class ComfyApp { ...@@ -641,7 +641,8 @@ class ComfyApp {
return { workflow, output }; return { workflow, output };
} }
async queuePrompt(number) { async queuePrompt(number, batchCount = 1) {
for (let i = 0; i < batchCount; i++) {
const p = await this.graphToPrompt(); const p = await this.graphToPrompt();
try { try {
...@@ -667,6 +668,7 @@ class ComfyApp { ...@@ -667,6 +668,7 @@ class ComfyApp {
this.canvas.draw(true, true); this.canvas.draw(true, true);
await this.ui.queue.update(); await this.ui.queue.update();
} }
}
/** /**
* Loads workflow data from the specified file * Loads workflow data from the specified file
......
...@@ -254,9 +254,14 @@ export class ComfyUI { ...@@ -254,9 +254,14 @@ export class ComfyUI {
$el("span", { $: (q) => (this.queueSize = q) }), $el("span", { $: (q) => (this.queueSize = q) }),
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }), $el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
]), ]),
$el("button.comfy-queue-btn", { textContent: "Queue Prompt", onclick: () => app.queuePrompt(0) }), $el("div", { style: { width: "100%" }}, [
$el("label", { innerHTML: "Batch count" }, [
$el("input", { type: "number", value: "1", min: "1", style: { width: "30%", "margin-left": "0.4em" }, onchange: (i) => this.batchCount = i.target.value })
]),
]),
$el("button.comfy-queue-btn", { textContent: "Queue Prompt", onclick: () => app.queuePrompt(0, this.batchCount) }),
$el("div.comfy-menu-btns", [ $el("div.comfy-menu-btns", [
$el("button", { textContent: "Queue Front", onclick: () => app.queuePrompt(-1) }), $el("button", { textContent: "Queue Front", onclick: () => app.queuePrompt(-1, this.batchCount) }),
$el("button", { $el("button", {
$: (b) => (this.queue.button = b), $: (b) => (this.queue.button = b),
textContent: "View Queue", textContent: "View Queue",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment