A FigJam plugin to browse your ComfyUI Cloud workflows, run one with custom settings, and drop the generated image (or video) straight onto the FigJam canvas.
Settings (paste API key) → Workflow list → Generation form → Generate
→ live progress → result placed on the canvas
FigJam plugin (create-figma-plugin: TypeScript + Preact, Figma sandbox)
src/main.ts ── clientStorage (your key), canvas insertion
src/ui.tsx ── settings / list / form / progress (all fetch runs here)
│ fetch() with your X-API-Key on every request
▼
Vercel proxy (proxy/, Node serverless) — holds NO key of its own
• relays your X-API-Key to Comfy Cloud; never stores it
• adds CORS (the plugin iframe is an opaque origin)
• streams output bytes back so the plugin only needs one allowed domain
│ MCP over StreamableHTTP, X-API-Key
▼
Comfy Cloud MCP https://cloud.comfy.org/mcp
list_saved_workflows · get_saved_workflow · run_saved_workflow
· get_job_status · get_output
Why a proxy? The documented Comfy Cloud REST API has no "list workflows" endpoint — listing, the per-workflow parameter schema, and editor→executable conversion are only available through the Comfy Cloud MCP. The proxy speaks MCP with your key and exposes a small REST surface to the plugin. It's multi-user: each request carries the caller's own key, which the proxy relays and never persists.
/
package.json → create-figma-plugin config (manifest is generated)
src/
main.ts → main thread: clientStorage + canvas insertion
ui.tsx → UI: settings / list / form / progress screens
api.ts → typed client for the proxy
fields.ts → customizable_inputs → form fields
run.ts, output.ts → run orchestration + output resolution
screens/ → Settings, WorkflowList, GenerationForm, RunProgress
proxy/ → Vercel serverless proxy (its own package.json)
api/ → workflows, workflow, run, status, output, asset, upload-image
dev.ts → local dev server (mirrors Vercel routing)
- Node 20+ and npm.
- Figma desktop app (dev plugins can only be imported there).
- A ComfyUI Cloud API key (
comfyui-…) from platform.comfy.org/profile/api-keys.
You need two terminals: one for the proxy, one for the plugin build.
cd proxy
npm install
npm run dev # → http://localhost:3000The proxy holds no key — it relays whatever X-API-Key the plugin sends.
Note:
npm run dev(tsx) does not hot-reload. Restart it after changing anything underproxy/.
npm install
npm run build # or: npm run watch (rebuilds on change)In the Figma desktop app, open a FigJam file, then
Plugins → Development → Import plugin from manifest… and select this repo's
generated manifest.json. Run it via Plugins → Development → ComfyUI for FigJam.
After a rebuild, re-run the plugin in FigJam to pick up the new UI. If the UI seems stale, a leftover
npm run watchprocess may be overwriting the build — kill straybuild-figma-pluginprocesses and rebuild.
Paste your comfyui-… key → Connect → pick a workflow → adjust inputs →
Generate. Workflows with paid API nodes prompt for confirmation before
spending credits.
- Create a Vercel project with Root Directory =
proxy/(framework preset: Other). Theapi/*.tsfiles deploy as serverless functions automatically. - No environment variables are required — the proxy is keyless (keys are
relayed per request). Optionally set
COMFY_MCP_URLto override the MCP endpoint. - After it deploys (e.g.
https://your-proxy.vercel.app), point the plugin at it:src/config.ts→ setPROXY_BASEto your Vercel URL.package.json→ setfigma-plugin.networkAccess.allowedDomainsto["https://your-proxy.vercel.app"](keepdevAllowedDomainswithhttp://localhost:3000for local dev).- Rebuild (
npm run build) and re-import the manifest.
| Where | Setting | Purpose |
|---|---|---|
src/config.ts |
PROXY_BASE |
Proxy URL the plugin calls (localhost for dev). |
package.json → figma-plugin.networkAccess.allowedDomains |
proxy domain | Domains Figma lets the plugin reach in production. |
package.json → …devAllowedDomains |
http://localhost:3000 |
Domains allowed while running in development. |
package.json → figma-plugin.id |
plugin id | Placeholder is fine for dev; set a real id only to publish. |
proxy env (optional) |
COMFY_MCP_URL |
Override the Comfy Cloud MCP endpoint. |
- No key is ever hardcoded. You paste it at runtime; it lives only in
figma.clientStorageon your machine and is sent to the proxy per request. - The proxy does not store keys — it relays them to Comfy Cloud and forgets them.
- The built plugin bundle contains no secrets (verify with
grep -ri "comfyui-" build/→ only the placeholder text).
- Images (PNG/JPG/GIF/WebP) are placed as image fills, sized (capped to 1024px), selected, and zoomed into view.
- Video is embedded when FigJam/your plan supports it; otherwise the plugin falls back to a clickable link node on the canvas.
- Other media (e.g. audio) is inserted as a link node.
- Manifest error "must be a valid URL" —
allowedDomainsentries must be valid lowercase URLs (or the special value"none"). - UI not updating after a code change — re-run the plugin; kill any stray
npm run watchprocess that may be clobbering the build. - Stuck on "Generating…" — make sure the proxy is running and was restarted
after any change under
proxy/. - "Could not reach the proxy" — the proxy isn't running, or
PROXY_BASE/allowedDomainsdon't match its URL.