Image Worker

Image Worker

Generate images on The Grid using ComfyUI. Earn USDC + AIPG for powering AI art.

No bond required to run a worker today. Image workers can connect and start serving with just an API key. A planned on-chain bonding mechanism (stake via WorkerRegistry, slashable for bad results) is in development and not yet required — same model as text workers. See Run a Node for the bigger picture.


What You’re Running

The Comfy Bridge connects your ComfyUI installation to The Grid:

  1. You run ComfyUI locally with your models
  2. The bridge holds a persistent WebSocket to The Grid, which pushes jobs to it
  3. Your GPU renders images
  4. You upload results and earn USDC + AIPG

Your existing ComfyUI setup works as-is. The bridge just connects it to the network.


Requirements

ComponentMinimumRecommended
GPUNVIDIA 6 GB VRAMNVIDIA 12 GB+
RAM8 GB16 GB+
Storage50 GB100 GB+ SSD
SoftwarePython 3.9+, ComfyUI runningSame

VRAM by Model

ModelVRAMNotes
z-image-turbo6–8 GBFast, high-quality
Krea 2 Turbo8–12 GBFast, stylized
FLUX.2 Klein 4B FP812 GB+Best quality, photorealism

Check /v1/models for the models the Grid is currently serving.


Quick Start

1. Get ComfyUI Running

If you don’t have ComfyUI yet:

git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt
python main.py

ComfyUI should be running at http://127.0.0.1:8188.

2. Get an API Key

Register at console.aipowergrid.io

3. Install the Bridge

git clone https://github.com/AIPowerGrid/comfy-bridge
cd comfy-bridge
pip install -e .

4. Configure

cp .env.example .env

Edit .env:

GRID_API_KEY=your-api-key-here
COMFYUI_URL=http://127.0.0.1:8188

5. Run

python -m bridge.cli

The bridge connects to The Grid and starts accepting jobs.


Configuration

All settings go in .env:

VariableDefaultDescription
GRID_API_KEY(required)Your API key
COMFYUI_URLhttp://127.0.0.1:8188Your ComfyUI address
GRID_WORKER_NAMEComfyWorkerName shown on the network
GRID_MODEL(auto-detect)Models to advertise (comma-separated)
GRID_THREADS2Concurrent jobs
GRID_MAX_PIXELS1048576Max output resolution
GRID_NSFWfalseAccept NSFW jobs
WORKFLOW_FILECustom workflow JSON

Model Auto-Detection

By default, the bridge scans your ComfyUI checkpoints and advertises matching models. Override with:

GRID_MODEL=z-image-turbo, krea-2-turbo

Docker

Linux (Host Networking)

docker build -t comfy-bridge .
docker run --rm --network host --env-file .env comfy-bridge

macOS / Windows

docker run --rm \
  --env-file .env \
  -e COMFYUI_URL=http://host.docker.internal:8188 \
  comfy-bridge

Docker Compose

# Linux
docker-compose -f docker-compose.linux.yml up --build
 
# macOS/Windows
docker-compose -f docker-compose.win-macos.yml up --build

Custom Workflows

Export a workflow from ComfyUI as JSON, place it in workflows/, and set:

WORKFLOW_FILE=my_workflow.json

The bridge uses your workflow as a template for incoming jobs.


Earning

How It Works

  1. User requests an image at aipg.art or via API
  2. The Grid routes the job to your worker
  3. Your GPU generates the image via ComfyUI
  4. You upload the result
  5. You earn USDC + AIPG

What Earns Most

  • In-demand models (z-image-turbo, FLUX.2 Klein) — high demand, good rewards
  • Large images — more compute = more reward
  • High step counts — more work = more pay
  • 24/7 uptime — consistent availability wins

Troubleshooting

No jobs coming in?

  • Check Advertising models: in logs
  • Make sure GRID_MODEL matches what users request
  • Verify ComfyUI is running

ComfyUI unreachable?

  • Confirm COMFYUI_URL is correct
  • Check ComfyUI is running on that port

400 Bad Request?

  • Model name mismatch — check GRID_MODEL values

Auth errors?

  • Verify GRID_API_KEY is correct

ResourceURL
Repositorygithub.com/AIPowerGrid/comfy-bridge
Get API Keyconsole.aipowergrid.io
ComfyUIgithub.com/comfyanonymous/ComfyUI
Discorddiscord.gg/W9D8j6HCtC