Media Worker

Media Worker

The Grid media worker bridges image, video, 3D, and managed audio runtimes to Core. The source bridge can connect an operator-managed ComfyUI installation, but public managed-media onboarding remains qualification-gated.

⚠️

Running ComfyUI does not make every checkpoint or custom workflow compatible with the Grid. A worker may advertise only models and recipes that it can resolve exactly and that Core currently accepts.

Current Paths

PathRuntimePublic status
Operator-managed image, video, and 3DExisting ComfyUIAdvanced; exact supported recipes only
Managed audio profileACE-Step direct APIQualification; not a public worker release
Unified media-manager downloadSigned, pinned profilesGated until release requirements pass

The public /run page fails closed: a media-manager download appears only when its immutable release, profile gates, checksums, SBOM, provenance, and required platform signing state pass.

How the ComfyUI Bridge Fits

  1. The operator runs ComfyUI locally with the required checkpoint and nodes.
  2. The bridge resolves approved model names to known workflow recipes.
  3. The bridge connects outbound to Core over WebSocket.
  4. Core sends compatible jobs to the worker.
  5. ComfyUI renders the output.
  6. The worker uploads it through a short-lived presigned URL and submits a signed completion receipt.

Workers never receive Grid object-storage credentials. Model files and custom nodes remain on the operator’s machine.

Public Qualification

Start at aipowergrid.io/run. The page shows the current hardware classes, accepted evidence counts, and the qualification artifact only when its release envelope verifies.

Qualification is local benchmark work, not paid Grid work. The benchmark tool:

  • cannot enroll a worker;
  • cannot advertise a capability;
  • cannot earn den or rewards;
  • emits a privacy-reduced public report separately from the private hardware report.

Never post API keys, private keys, wallet signatures, environment files, private benchmark reports, or credential-bearing logs.

Advanced ComfyUI Development Path

Experienced operators working with a currently supported recipe may inspect the source bridge:

git clone https://github.com/AIPowerGrid/grid-media-worker
cd grid-media-worker
python -m venv .venv
source .venv/bin/activate
pip install -e .

At minimum, the protected local environment identifies the Grid credential, worker name, Core endpoint, and local ComfyUI endpoint:

GRID_API_KEY=REDACTED
GRID_WORKER_NAME=your-worker-name
GRID_API_URL=https://api.aipowergrid.io
COMFYUI_URL=http://127.0.0.1:8188

The bridge advertises only models it can resolve and serve. GRID_MODEL can restrict that set; it cannot make a missing checkpoint, node, or recipe valid. Do not advertise a model name solely because a similarly named file exists.

The WebSocket execution loop processes one media job at a time. The worker now validates GRID_THREADS=1 and rejects larger values until Core supports multiple claim slots for one signed worker identity.

The standalone manager has a Capacity panel with three bounded modes: always available, paused until resumed, or paused during one maintenance window. Changes apply to a running worker within a few seconds. Pausing stops new claims and lets an active render finish before the worker disconnects. The policy is stored in a private local file beside the managed installation; it is not sent to or selected by the website.

Advanced source operators can express the same policy with a local-time schedule. A matching concurrency: 0 window pauses new claims; concurrency: 1 makes the worker available. Outside matching windows, the worker uses GRID_THREADS.

GRID_THREADS=1
GRID_SCHEDULE=[{"days":"mon-fri","start":"08:00","end":"18:00","concurrency":0}]

This example reserves weekday business hours for local ComfyUI use and makes the worker available at other times. Schedules accept at most 32 windows and support overnight ranges such as 22:00 to 02:00.

Operator Controls

ControlCurrent behavior
Model advertisementRestricted to resolvable supported names
Output sizeBounded by GRID_MAX_PIXELS and recipe policy
NSFW acceptanceExplicit local setting
Start and stopExplicit manager or process control
Grid concurrencyOne simultaneous job; larger values fail closed
AvailabilityAlways available, paused, or one maintenance window in the manager
Time scheduleAdvanced local-time windows; pause drains the active job before disconnecting

Security Boundary

⚠️

Media workers receive plaintext prompts and input media. Do not send private images, secrets, regulated data, or confidential assets unless a separately documented confidential-execution route is live and verified.

  • The manager makes final hardware decisions locally.
  • Managed profiles pin source, dependencies, model files, and recipes.
  • An unsigned draft profile cannot advertise or serve managed capabilities.
  • The payout private key never belongs on the worker host.
  • A public benchmark report intentionally omits exact private hardware data.

Troubleshooting

ComfyUI is reachable but the model is unavailable: confirm the exact checkpoint, custom nodes, and supported recipe are installed. Endpoint health alone is not capability proof.

A custom workflow works locally but not on the Grid: arbitrary workflows are not a public compatibility contract. Compare it with a currently accepted recipe and Core model name.

The qualification tool will not connect: that is intentional. It benchmarks locally and cannot enroll a worker.