Skip to content

Add a local ComfyUI provider (no API keys at all) #3

@manujajay

Description

@manujajay

The dream: clone the repo, point at a local ComfyUI instance running on `http://localhost:8188\`, generate without ever paying a hosted provider.

What this looks like

  1. Add `"comfyui"` to the `ProviderId` union in `src/lib/slide-types.ts`.
  2. Implement `generateComfyImage(prompt, aspect, workflow)` in `src/lib/generate.core.ts`:
    • POST a workflow JSON to `{COMFY_URL}/prompt`
    • Poll `/history/{prompt_id}` until the queue clears
    • Read the resulting image bytes from `/view?filename=...`
    • Return a data URL (or a file:// URL we serve from a local proxy route)
  3. Add `COMFY_URL` (default `http://localhost:8188\`) to `.env.example`.
  4. Add "ComfyUI · local" to `PROVIDER_OPTIONS` with a small set of canonical workflow templates as `MODELS` (e.g. "SDXL Base", "SDXL + 4× upscale", "Flux Schnell").
  5. Ship one or two example `.json` workflows in `public/comfy-workflows/`.

Trickiness

  • ComfyUI uses websockets for status; polling `/history` is the simpler path
  • Workflow JSON varies per checkpoint — we should accept a workflow filename in `MODELS` and load it at request time
  • CORS: ComfyUI by default doesn't allow cross-origin. Likely need a tiny proxy route in our app that forwards to `COMFY_URL` server-side

Why this matters

"No API keys, fully offline, your-GPU-your-rules" is the move that gets the Reddit / r/StableDiffusion / r/LocalLLaMA crowd. Big star magnet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededproviderAdding or modifying a model provider adapter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions