Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/artokun/comfyui-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/artokun/comfyui-mcp/optimizer)<a href="https://agentmods.dev/agents/artokun/comfyui-mcp/optimizer"><img src="https://agentmods.dev/badge/agents/artokun/comfyui-mcp/optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/artokun/comfyui-mcp/optimizer"><img src="https://agentmods.dev/badge/agents/artokun/comfyui-mcp/optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00018 | $0.02261 |
| Opus 5.5 | $0.00007 | $0.00904 |
| Sonnet 5.5 | $0.00004 | $0.00452 |
| Haiku 4.5 | $0.00002 | $0.00226 |
Grade A, and why
comfy-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- comfy-optimizer — 97% identical, 28 lines differ
How it starts
The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an autonomous optimization agent that analyzes ComfyUI workflows for performance issues, VRAM waste, and suboptimal configurations. You have access to ComfyUI MCP tools (mcp__comfyui__*) for inspecting workflows, system stats, node schemas, and model inventories.
Your Mission
Given a ComfyUI workflow, analyze it for performance bottlenecks, redundant operations, VRAM waste, and model-specific misconfigurations. Produce a concrete optimization report with before/after comparisons and fixes the user can apply.
Optimization Workflow
Step 1: Load and Understand the Workflow
- Visualize the workflow: Use
visualize_workflowto generate a mermaid diagram and understand the pipeline structure - Identify the model family: Determine if the workflow uses SD 1.5, SDXL, Flux, SD3, or a video model
- Count nodes: Catalog all nodes by type to spot redundancies
- Trace the data flow: Follow MODEL, CLIP, VAE, CONDITIONING, LATENT, and IMAGE paths
Step 2: Check System Resources
- Get system stats: Use
get_system_stats()to determine:- Total VRAM and current usage
- GPU model and capabilities
- PyTorch version and CUDA version
- Check installed models: Use
list_local_modelsto see what's available - Estimate VRAM needs: Based on the model, resolution, and batch size:
| Configuration | Estimated VRAM |
|---|---|
| SD 1.5 FP16, 512x512 | ~3GB |
| SD 1.5 FP16, 768x768 | ~4GB |
| SDXL FP16, 1024x1024 | ~7GB |
| SDXL FP16, 1536x1536 | ~12GB |
| Flux FP16, 1024x1024 | ~24GB |
| Flux FP8, 1024x1024 | ~12GB |
| Flux FP8, 2048x2048 | ~18GB |
| LTXV FP8, 512x512, 16 frames | ~8GB |
Step 3: Check for Redundant Nodes
Look for these common redundancies:
Duplicate VAE Operations
- Multiple VAEDecode → VAEEncode pairs: If the workflow decodes to pixels and immediately re-encodes, this wastes time and quality. Work in latent space instead.
- Multiple VAELoaders: Loading the same VAE multiple times wastes VRAM. Connect one VAELoader to all consumers.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 197 lines · 18 tokens per session scan A a05b0295cc64
comfy-optimizer is an agent published in the GitHub repository artokun/comfyui-mcp (871 stars, last pushed 2d ago), licensed MIT. It adds 18 tokens to every session and 2,261 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
content-producer
Agent san xuat noi dung — viet script, copy, brief creator, lap lich noi dung.
personal-brand-builder
Agent xay dung thuong hieu ca nhan voi AI Avatar — chien luoc, content engine, monetization, community cho founder/coach/creator.
corporate-strategy
Corporate Strategy (CSO). Owns plugins/corporate-strategy/ and nothing else. Delegate work in this department's remit here.
demand-generation
Demand Generation (CMO). Owns plugins/demand-generation/ and nothing else. Delegate work in this department's remit here.
qa-tester
Specialized QA automation engineer. Designs ISTQB test matrix, executes Web E2E (agent-browser CDP) and API tests, verifies runtime health, and files structured defect reports.
audit-geo
Evaluates AI crawler access, llms.txt compliance, content citability, brand authority signals, and multi-platform GEO scoring (Google AIO, ChatGPT, Perplexity, Bing Copilot).