Skip to content

Running ComfyUI

Use cg run to launch ComfyUI from the selected ComfyGit environment.

cg run

Before launching, ComfyGit syncs the environment so the virtualenv, custom nodes, model links, PyTorch backend, and local overlays match the manifest plus local runtime configuration.

Choose An Environment

Use the active environment:

cg use my-env
cg run

Or target one command:

cg -e my-env run

Pass ComfyUI Arguments

ComfyGit owns flags before --. Arguments after -- are passed to ComfyUI.

cg run -- --listen 0.0.0.0 --port 8188

Common examples:

cg run -- --port 8189
cg run -- --listen 0.0.0.0
cg run -- --auto-launch

One-Time Runtime Overrides

Use a different PyTorch backend for one run:

cg run --torch-backend cpu

Apply an overlay for one run:

cg run --overlay local-dev

Install an optional extra for the run sync:

cg run --extra cuda

These operation-level flags do not rewrite the saved local environment config.

Skip Sync

cg run --no-sync

Use --no-sync only when you deliberately want to bypass reconciliation. If the runtime is stale, ComfyUI may start with missing packages, nodes, or model links.

Open ComfyUI

By default, ComfyUI is available at:

http://127.0.0.1:8188

If you bind to 0.0.0.0, make sure the port is reachable from the browser or machine that needs it.

Inspect And Restart A Managed Runtime

For a named environment launched by the current cg run supervisor:

cg -e my-env orch status --json
cg -e my-env orch restart --wait --timeout 180 --json

Restart requires a matching runtime identity, reachable Manager restart support, and a verified empty ComfyUI queue. It refuses unknown or busy state. --wait verifies a new runtime generation and HTTP readiness; an accepted restart request alone is not completion. If acknowledgement is uncertain, inspect status before retrying.

A process started before upgrading the CLI must be stopped and relaunched through the updated cg run to advertise this control endpoint. An arbitrary ComfyUI process or port is not adopted. Existing legacy orchestrators retain their own control path; do not use a named runtime request to restart a different child.

Run Vs Serve

cg run launches the full ComfyUI editor and backend.

cg serve fronts an already running ComfyUI backend with workflow contract endpoints and the packaged Studio UI.

For Studio/API usage, run both:

cg run -- --port 8188
cg serve --port 8190 --comfy-url http://127.0.0.1:8188

Read more: Serve workflows.