fix inputs (assume forked comfyui)
This commit is contained in:
@@ -213,29 +213,6 @@ export namespace Comfy {
|
||||
Generation.Image.Output.received(prompt_id, responses);
|
||||
});
|
||||
|
||||
api.addEventListener("execution_start", ({ detail }) => {
|
||||
const { prompt_id } = detail;
|
||||
|
||||
console.log("execution_start", detail);
|
||||
|
||||
if (prompt_id) {
|
||||
let input = Generation.Image.Input.get(prompt_id);
|
||||
if (!input) {
|
||||
input = Generation.Image.Input.initial(prompt_id);
|
||||
Generation.Image.Inputs.set((inputs) => ({
|
||||
...inputs,
|
||||
[prompt_id]: input,
|
||||
}));
|
||||
}
|
||||
const output = Generation.Image.Output.requested(
|
||||
prompt_id,
|
||||
{},
|
||||
prompt_id
|
||||
);
|
||||
Generation.Image.Output.set(output);
|
||||
}
|
||||
});
|
||||
|
||||
api.addEventListener("execution_error", ({ detail }) => {
|
||||
console.log("execution_error", detail);
|
||||
Generation.Image.Output.clear(detail.prompt_id);
|
||||
|
||||
@@ -37,7 +37,6 @@ export namespace Create {
|
||||
}): Promise<undefined | Generation.Image.Exception> => {
|
||||
try {
|
||||
Latest.set(new Date());
|
||||
onStarted();
|
||||
|
||||
const initImg = await Generation.Image.Input.resizeInit(input);
|
||||
const pluginInput = await Generation.Image.Input.toInput(
|
||||
@@ -89,7 +88,26 @@ export namespace Create {
|
||||
});
|
||||
Comfy.get()?.refreshComboInNodes();
|
||||
console.log(Comfy.get());
|
||||
await Comfy.get()?.queuePrompt(-1, 1);
|
||||
const resp: any = await Comfy.get()?.queuePrompt(-1, 1);
|
||||
console.log("queued", resp);
|
||||
const { prompt_id } = resp;
|
||||
|
||||
if (prompt_id) {
|
||||
Generation.Image.Inputs.set((inputs) => ({
|
||||
...inputs,
|
||||
[prompt_id]: {
|
||||
...input,
|
||||
id: prompt_id,
|
||||
},
|
||||
}));
|
||||
const output = Generation.Image.Output.requested(
|
||||
prompt_id,
|
||||
{},
|
||||
prompt_id
|
||||
);
|
||||
Generation.Image.Output.set(output);
|
||||
onStarted(output);
|
||||
}
|
||||
} catch (caught: unknown) {
|
||||
const exception = Generation.Image.Exception.create(caught);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user