Skip to content

eliteprox/comfy-workflows-api

Repository files navigation

Comfy Workflows API

Simple API to manage and share ComfyUI workflows.

Run locally

npm install
export ADMIN_API_KEY="super-secret"
npm start

Cloudflare Worker

Requirements: Node.js v20.0.0 or higher

# Switch to Node 20 (if using nvm)
nvm use 20

# Login to Cloudflare
wrangler login

# The KV namespace is already configured in wrangler.toml!

# For local development, copy the example file
cp .dev.vars.example .dev.vars
# Edit .dev.vars and set your ADMIN_API_KEY

# Test locally (uses .dev.vars automatically)
wrangler dev

# For production, set the secret (one-time setup)
wrangler secret put ADMIN_API_KEY

# Deploy to production
wrangler deploy

Endpoints

  • GET /workflows – public, lists all workflows
  • GET /workflows/:id – public, retrieves a specific workflow
  • POST /workflows – requires Authorization: Bearer <ADMIN_API_KEY>
  • PUT /workflows/:id – requires Authorization: Bearer <ADMIN_API_KEY>
  • DELETE /workflows/:id – requires Authorization: Bearer <ADMIN_API_KEY>

Docker

docker build -t comfy-workflows-api .
docker run -p 8787:8787 -e ADMIN_API_KEY=super-secret comfy-workflows-api

GitHub Actions

The repository includes a GitHub Actions workflow that automatically builds and pushes the Docker image to eliteencoder/comfy-workflows-api on Docker Hub when committing to main.

Setup:

  1. Go to your GitHub repository settings → Secrets and variables → Actions
  2. Add the following secrets:
    • DOCKERHUB_USERNAME – Your Docker Hub username
    • DOCKERHUB_TOKEN – Your Docker Hub access token (create one here)

Environment Variables

  • PORT – Server port (default: 8787)
  • ADMIN_API_KEY – Required for write operations
  • CORS_ALLOW_ORIGIN – CORS origin (default: *)
  • DATA_FILE – Path to workflows JSON file (default: ./workflows.json)

Note: When using Docker Compose, the workflows data is stored in a ./data directory which is mounted as a volume. This ensures data persistence across container restarts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published