beam-logo
← All use cases

Turn ComfyUI workflows into production APIs

Export your ComfyUI workflow as JSON and Beam serves it as an API endpoint on cloud GPUs.

Why Beam

ComfyUI in production

Run Comfy on cloud GPUs without managing your own infrastructure.

How it works

From workflow to API in minutes

01

Build ComfyUI into an image

Install ComfyUI with comfy-cli, add your custom nodes, and bake model weights into the image or a volume.

02

Export your workflow as JSON

Use ComfyUI's export menu to save workflow_api.json.

03

Deploy it as an API

Wrap the workflow in an endpoint, deploy, and generate images over HTTP.

terminal
# Wrap an exported workflow in an API (api.py)
workflow = json.loads(WORKFLOW_FILE.read_text())
workflow["6"]["inputs"]["text"] = item["prompt"]

subprocess.run(
    f"comfy run --workflow {workflow_file} --wait",
    shell=True, check=True,
)

output = Output(path=latest_image)
output.save()
return {"output_url": output.public_url()}

# Deploy it
$ beam deploy api.py:handler

# Generate images over HTTP
$ curl -X POST https://comfy-xyz.app.beam.cloud/generate \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -d '{"prompt": "A cat in a spacesuit"}'
FAQ

Frequently asked questions

Can I use custom nodes?

Yes. Install node packs with comfy node install as part of your image build — the same nodes you use locally work in the cloud.

How do model weights get loaded?

Bake them into the container image with huggingface-cli download, or store them on a persistent volume shared across containers.

Can I run the ComfyUI interface itself?

Yes. A Pod hosts the full web UI behind an SSL-terminated URL, backed by whatever GPU you pick.

Which GPU do I need for my model?

SD 1.5 and SDXL run comfortably on 24Gi cards like the A10G or RTX 4090. Flux-scale checkpoints want an H100 with 80Gi.

How fast does a workflow start generating?

Once your image is built, containers boot in seconds with weights already cached — there's no template to initialize and no models to install by hand through the UI.

$30 free creditrefreshed monthly

Start shipping on infra
you won’t outgrow.

Run sandboxes and GPU workloads on your cloud, and scale out to ours when you need to. No infra to manage.