Site icon Efficient Coder

Turn Any ComfyUI Workflow Into an AI Chat Tool in 30 Minutes

Pixelle MCP zero-code walkthrough for junior-college level readers (3,000-word plain-English guide)


1. What problem does this solve?

If you have ever thought… Pixelle MCP gives you…
“I wish Cursor could run my ComfyUI upscaler with one sentence.” An MCP server that publishes any workflow as a chat tool—no Python, no REST wrappers.
“Docker-Compose is over-kill for a side project.” One single container (or even a uvx one-liner) that bundles Web UI, file host and MCP endpoint.
“I hate re-coding every time I add a new sampler.” Drop the exported API-JSON into a folder; the tool appears instantly.

2. Quick glossary (skip if you already know)

Term Plain-English meaning in this article
MCP Model-Context-Protocol. A young, JSON-RPC style API that lets LLMs call external tools.
ComfyUI Node-based Stable-Diffusion front-end. You chain loaders, samplers, savers like LEGO.
Workflow The .json file ComfyUI exports. Two flavours: UI (pretty) and API (machine). We always use API.
Tool From the LLM’s point of view, a remote function with a name, parameters and return value.

3. Architecture at a bus-stop glance

┌--------------┐     HTTP     ┌---------------------┐     HTTP     ┌-------------┐
│Cursor/Claude │◀------------▶│  Pixelle 9004 port  │◀------------▶│  ComfyUI    │
│  Desktop     │   MCP call   │  (3-in-1 process)   │   /prompt    │  8188 port  │
└--------------┘              └---------------------┘              └-------------┘
                                     ├─ Web chat (Chainlit)
                                     ├─ File up/down
                                     └─ MCP end-point /pixelle/mcp

Only one port is exposed; everything else is internal.
No nginx, no Redis, no Postgres—unless you want them.


4. Pick your install style (copy-paste ready)

Style One-line command When to use
Try-and-throw uvx pixelle@latest Curious but don’t want packages in system Python.
Stay-forever pip install -U pixelle then pixelle Daily driver; upgrade later with pip.
Team/docker git clone... && docker compose up -d Production, CI, or you need reproducible builds.

Whichever you pick, a browser tab opens at http://localhost:9004 (change with PORT=8080).
First-run wizard checks ComfyUI on 8188 and asks for at least one LLM key.


5. Five-minute victory: “Gaussian-Blur-Any-Image”

5.1 Build the flow in ComfyUI

  1. Add nodes: LoadImageGaussianBlurSaveImage.
  2. Double-click the title of LoadImage and type exactly:
    $image.image!:input image URL
    • $image = argument name the LLM will see
    • image! = connect to the image socket and make it required
  3. Menu Export → API (JSON) → save as i_blur.json.

5.2 Feed it to Pixelle

  1. Web-UI → “Upload Workflow” → choose i_blur.json → Send.
  2. You get a toast “Tool i_blur added”. Refresh the page.

5.3 Chat with it

Type:
“Please blur https://example.com/cat.jpg radius 8.”
The LLM builds {image: "https://..."} and Pixelle returns the blurred PNG.
No REST client, no cURL, no Swagger.


6. A heavier example: “FLUX-Turbo-Text-to-Image”

Node Title you type Meaning
CLIPTextEncode (positive) $prompt.text!:positive prompt Required string.
EmptyLatentImage $width.width:width, default 512 Optional integer.
FluxTurboSampler $steps.steps:sampling steps Optional integer.
SaveImage leave blank Auto-detected output.

Export → t2i_flux_turbo.json → upload → done.
From now on you can say:
“Draw a steampunk owl, width 768, steps 12.”


7. DSL cheat-sheet (print and pin)

Mark-up Where Example Parsed meaning
$name.socket! node title $seed.seed! Required param.
$name.~socket! node title $video.~video! Download URL first, then upload to ComfyUI.
$output.xxx any node title $output.mask Expose this node’s return value.
MCP free text node title content = tool description Shows up in LLM’s tool list.

Remember:

  • File-name becomes tool-name; avoid spaces.
  • Only API format is accepted; UI format will silently fail.
  • Optional params must have a default in the node, or ComfyUI throws 500.

8. First-aid FAQ

Q1 Uploaded but tool missing?
→ Check logs: usually a typo in socket name or you ticked “UI format” by mistake.

Q2 500 error—ComfyUI says “model not found”?
→ Pixelle does not ship models. Make sure the workflow runs natively in ComfyUI first.

Q3 Need versioning?
→ Prefix file: v2_i_blur.json → tool name v2_i_blur. Roll back with git or simple file rename.

Q4 Port 9004 taken?
export PORT=8080 before start, or add PORT=8080 in .env.

Q5 Multiple LLMs?
→ Repeat key lines in .env, e.g.
LITELLM_MODEL=openai/gpt-4o
LITELLM_MODEL=gemini-1.5-pro
Pixelle round-robins across them.


9. Going prod: team sandbox blueprint

Need Recipe
Shared models Mount ComfyUI models folder from NFS or S3; keep containers stateless.
Auth Put Nginx in front with basic-auth; Pixelle needs zero code changes.
CI/CD Store *.json workflows in Git; push triggers copy to data/custom_workflows.
Metrics Grep Chainlit logs for tool_call_id and latency; pipe to Prometheus/Grafana.

10. Why bother now?

  • Protocol moat: MCP is six months old. The sooner your workflows speak it, the earlier you appear in “Tools” drop-downs.
  • Cost: You recycle existing ComfyUI graphs—no new backends, no OpenAPI YAML.
  • Risk: One 200 MB container; delete the folder and your system is clean again.

11. Copy-paste recap (save in your note app)

# 1. Run
uvx pixelle@latest        # or docker compose up -d
# 2. Open
http://localhost:9004     # user/dev dev/dev
# 3. Export any ComfyUI flow in API mode, title the nodes with $dsl, drop the json in.
# 4. Chat:
#    "Blur this image..." → instant result.

Next time someone asks “Can we just type and get the video upscaled?” you can finally answer:
“Yes, one sentence—send it.”

Exit mobile version