Image Worker

Image Worker

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

Worker bond: 1,000 AIPG minimum. Image workers use the same bonding model as text workers — stake AIPG via WorkerRegistry, get slashed if you serve bad results. 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 polls The Grid for jobs
  3. Your GPU renders images
  4. You upload results and earn 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
SD 1.56 GBFast, huge LoRA ecosystem
SDXL8 GB1024px native, great quality
Flux Schnell12 GBFast, excellent quality
Flux Dev12 GBBest quality, slower

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:8000.

2. Get an API Key

Register at dashboard.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:8000

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:8000Your 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=stable_diffusion, flux-schnell

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:8000 \
  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 AIPG

What Earns Most

  • Flux models — 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 Keydashboard.aipowergrid.io
ComfyUIgithub.com/comfyanonymous/ComfyUI
Discorddiscord.gg/W9D8j6HCtC