Skip to content

For ComfyUI

ComfyUI on Edge, your workflows on your servers

Build and run node-based diffusion workflows on a CPU VM, with checkpoints in your bucket and finished images served from the CDN. Slow on CPU, but private, scriptable and ready to move to GPU instances when they land.

CPU mode today, at minutes per image. GPU instances are coming soon.

Why ComfyUI on Edge

The most flexible diffusion runtime, on infrastructure you own

ComfyUI turns image generation into graphs you can save, version and call over HTTP. On Edge today it runs in CPU mode, suited to building workflows and running batches overnight.
  • Any workflow, as a graph

    Checkpoints, LoRAs, ControlNets, upscalers and custom samplers wired together visually, then saved as JSON.
  • CPU mode for builds and batches

    --cpu runs workflows without a GPU. SD 1.5 at 512 px takes minutes per image: fine for prototyping and overnight jobs.
  • Models in Edge Storage

    Keep checkpoints, LoRAs and VAEs in a bucket and sync them into models/. Every VM starts from the same set.
  • A headless API

    POST workflow JSON to /prompt, get a prompt_id back, then poll /history or listen on the WebSocket.
  • Outputs on the CDN

    Upload finished images to a bucket and serve them through the CDN, resized and converted to WebP or AVIF on request.
  • Custom nodes welcome

    Install community nodes with git clone into custom_nodes/, or use ComfyUI-Manager. It's your VM.

Reference architecture

How ComfyUI maps to Edge

ComfyUI runs headless on a VM behind Nginx basic auth. Models sync from one bucket, outputs go to another, and the CDN serves finished images at any size.
  • Compute

    Runs ComfyUI in CPU mode on 8 vCPU and 16 GiB, behind Nginx basic auth.

  • GPU Compute

    Coming soon. GPU instances for SDXL, FLUX and video models; join the waitlist.

  • Storage

    Two buckets: shared model files, and the images your workflows produce.

  • CDN

    TLS for the editor and API, plus worldwide delivery of finished images.

  • Image optimisation

    Resizes and converts outputs on request, so one PNG serves every size.

  • DNS

    Anycast DNS for comfy.acme.com and img.acme.com.

Deploy

ComfyUI on CPU in five steps

A CPU build of PyTorch, models from your bucket, and a proxy with authentication in front. ComfyUI has none of its own.
  1. 01

    Write a bootstrap script

    Installs ComfyUI with CPU-only PyTorch wheels, Nginx for auth, and the Edge CLI for model syncs.

    comfy-setup.sh
    #!/bin/bash
    set -e
    apt-get update
    apt-get install -y python3-venv git nginx apache2-utils
    curl -fsSL https://edge.network/install.sh | sh
    git clone https://github.com/comfyanonymous/ComfyUI /opt/comfy
    cd /opt/comfy && python3 -m venv .venv && . .venv/bin/activate
    pip install torch torchvision torchaudio \
      --index-url https://download.pytorch.org/whl/cpu
    pip install -r requirements.txt
  2. 02

    Create the VM and the buckets

    16 GiB of memory is the practical floor for diffusion on CPU. --disk 160 leaves room for a few checkpoints.

    shell
    $ edge compute scripts create --name comfy-setup --file comfy-setup.sh
    $ edge compute create --name comfy --size s-8vcpu-16gb --disk 160 \
        --image ubuntu-24 --region london --script comfy-setup
    $ edge storage create comfy-models
    $ edge storage create comfy-outputs
  3. 03

    Run it as a service

    Models sync from the bucket before each start, so every VM has the same set. ComfyUI stays on localhost.

    /etc/systemd/system/comfy.service
    [Service]
    WorkingDirectory=/opt/comfy
    EnvironmentFile=/etc/comfy.env   # EDGE_API_KEY
    ExecStartPre=/usr/local/bin/edge storage sync \
      comfy-models/ /opt/comfy/models/
    ExecStart=/opt/comfy/.venv/bin/python main.py --cpu \
      --listen 127.0.0.1 --port 8188
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
  4. 04

    Put basic auth in front

    Create the password file with htpasswd. The WebSocket headers keep the editor's live progress working.

    /etc/nginx/sites-enabled/comfy
    server {
      listen 443 ssl;
      server_name comfy.acme.com;
      ssl_certificate     /etc/ssl/origin.pem;   # origin certificate
      ssl_certificate_key /etc/ssl/origin.key;
    
      auth_basic "ComfyUI";
      auth_basic_user_file /etc/nginx/.htpasswd;
    
      location / {
        proxy_pass http://127.0.0.1:8188;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }
    }
  5. 05

    Add the CDN and queue a workflow

    One domain for the editor and API, one serving outputs from the bucket with image transforms on.

    shell
    $ edge cdn create --name comfy
    $ edge cdn domains add cdn-a1b2c3 \
        --domain comfy.acme.com --origin https://<vm-ip>
    $ edge cdn domains add cdn-a1b2c3 --domain img.acme.com \
        --origin-type storage --storage-bucket comfy-outputs --jit-image
    
    # payload.json = { "prompt": <workflow exported in API format> }
    $ curl -u artist:$PASS https://comfy.acme.com/prompt \
        -H "Content-Type: application/json" -d @payload.json

Prefer to hand it off? Give the job to your AI agent or have our engineers do it.

What it costs

Your own image pipeline, at a fixed price

No GPU instance is priced here because none is available yet. This is an 8 vCPU VM from the published per-resource rates, plus storage and CDN delivery.
  • No per-image charges from a hosted API
  • Image resizing included with the CDN
  • Models and outputs move with zero egress
  • Billed hourly from a prepaid balance, with hard caps
See compute pricing

Estimated monthly bill on Edge

Workflow development and overnight batches · SD 1.5 on CPU

USD
  • Compute · vCPU$23.368 vCPU × $0.004/hr × 730 hrs
  • Compute · memory$29.9016 GiB × $0.00256/GiB-hr × 730 hrs
  • Compute · disk$11.84160 GiB NVMe × $0.074/GiB-mo
  • Storage$0.6045 GB of models and outputs, first 5 GB free
  • CDN$0.00~300k image requests, inside the 500k free tier
  • DNS$0.00Zone, editor and image subdomains
  • Egress$0.00
Total$65.70

FAQ

ComfyUI on Edge, answered

Something else? Ask an engineer.
Can ComfyUI run without a GPU?
Yes, with --cpu. SD 1.5-class models at 512 px take minutes per image on 8 vCPU. SDXL and FLUX run far slower, which rules them out for interactive use until GPU instances arrive.
When will GPU instances be available?
GPU instances are coming soon. Join the waitlist at /compute/gpus to hear first. If you need GPU capacity now, contact us: we may be able to arrange early access or an interim option.
How do I call it from my app?
Export a workflow in API format, POST it to /prompt and keep the prompt_id. Poll /history/<prompt_id> or listen on /ws for completion, then fetch the image with /view or pick it up from the outputs bucket.
How do I secure it?
ComfyUI has no built-in authentication, so never expose port 8188. Keep it on 127.0.0.1 and put Nginx basic auth, or your own SSO proxy, in front, as in step four.
What about safety filters?
ComfyUI doesn't filter prompts or outputs by default; that's your call as the operator. For a public product, add a moderation step to the workflow or check outputs before publishing them.
How do I share models between VMs?
Every VM syncs comfy-models/ from the same bucket before ComfyUI starts, so adding a VM is just creating it from the same bootstrap script. No manual copying.

Generate images on your terms

Build your workflows on a CPU VM today, and join the GPU waitlist for production volume.

Free tiers hard-cap. Nothing bills until you add a card.