StableCanvas / comfyui-client

all ComfyUI http/ws APIs. support NodeJS / Browser environments. and advanced programmable workflow.
https://stablecanvas.github.io/comfyui-client/
MIT License
82 stars 11 forks source link

Browser example not working, need complete example code #16

Open ClusterLee opened 1 month ago

ClusterLee commented 1 month ago

where can I find main.module.mjs

zhzLuke96 commented 1 month ago

thx feedback!

Are you referring to examples/web/index.html? This is an extremely simple example (actually just something I use for debugging...), and it requires you to compile first and then start a server in the project directory (I know, it's a bit confusing 😂).

I'll update this script to use unpkg soon. I'll also likely add a simple codesandbox project for easier use.

If you'd like to try it out now, you can simply replace the path with unpkg:

https://unpkg.com/@stable-canvas/comfyui-client@latest/dist/main.module.mjs

So it would be:

import {
  Client,
  Workflow,
} from "https://unpkg.com/@stable-canvas/comfyui-client@latest/dist/main.module.mjs";