Open matbee-eth opened 3 months ago
Hey @matbee-eth, thanks for bringing this up!
TL;DR: You need to invoke the workflow you've created:
const client = /* your client instance */;
const wf1 = createWorkflow();
const result = await wf1.invoke(client); // or wf1.invoke_polling(client)
so, your case should be:
export async function generateImage(prompt: string): Promise<string> {
const workflow = new ComfyUIWorkflow();
// ... define this workflow
const images = await workflow.invoke_polling(client)
return images[0].data; // image url
}
Longer answer:
First, in addition to the README, we have auto-generated documentation pages which provide more detailed information, including example code and type annotations for commonly used interfaces.
Second, I'm guessing you're confused about the workflow example in the README? This example shows how to create a workflow but doesn't include code on how to use it (I reviewed it, and it does look a bit confusing 😂)
If you need to refer to complete example code, you can check out the ./examples/nodejs/main*.ts
entry files. These contain fully executable code examples ranging from the simplest to slightly more complex workflows.
This is impossible to follow along.
Your examples are marked as deprecated, and your README examples don't even work with the given example files. Very confusing.