viewcomfy-api-rules — Claude Code skill: ViewComfy API integration
Guides an agent through wiring the ViewComfy API into a Python and FastAPI web app: flatten workflow params, call the endpoint, save the returned files.
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a claude-codeWhat viewcomfy-api-rules does
The skill primes the agent as a Python, FastAPI and web app specialist whose job is integrating the ViewComfy API. That API is a serverless FastAPI service that runs custom ComfyUI workflows, and implementations send requests with the httpx library.
The workflow it lays out: deploy a ComfyUI workflow from the ViewComfy dashboard using workflow_api.json, flatten its configuration with workflow_parameters_maker.py, set the endpoint URL plus Client ID and Client Secret, then call either infer as a standard POST or infer_with_logs for streaming SSE when you want live tracking. Responses carry prompt_id, status, completed, execution_time_seconds, the original configuration, and an outputs array of base64-encoded files with filename, content type and size — decode those and write them to your working directory.
The first call may hit a cold start, and generation time swings hard between workflows: under 2 seconds for some, several minutes for others. That is why the skill pushes infer_with_logs for long runs — otherwise your users stare at nothing. The params object cannot be empty; when nothing is specified, change the seed value. Keep credentials server-side, out of client code.
What it helps with
- hook the ViewComfy API into a FastAPI backend
- deploy a ComfyUI workflow and flatten its parameters
- stream progress from a long-running workflow over SSE
- decode base64 outputs and save the files locally
- absorb cold start delays without breaking the app
Example prompts for the agent
- Wire the ViewComfy API into my FastAPI app: deploy the workflow from
workflow_api.jsonand build the call withhttpx. - Use
infer_with_logsso progress from a long generation streams into the UI. - Parse the ViewComfy response: decode the base64 in
outputsand save the files to my working directory.
How to install viewcomfy-api-rules
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a claude-code2Manually: put the files in place
~/.claude/skills/viewcomfy-api-rules/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/viewcomfy-api-rules/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a codex2Manually: put the files in place
.agents/skills/viewcomfy-api-rules/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a cursor2Manually: put the files in place
.cursor/skills/viewcomfy-api-rules/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills viewcomfy-api-rules2Manually: put the files in place
.github/skills/viewcomfy-api-rules/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path viewcomfy-api-rulesManually: put the files in place
.devin/skills/viewcomfy-api-rules/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about viewcomfy-api-rules
How do I install viewcomfy-api-rules in Claude?
Run npx skills add Mindrally/skills --skill viewcomfy-api-rules -a claude-code. The skill file then lands at ~/.claude/skills/viewcomfy-api-rules/SKILL.md.
What does viewcomfy-api-rules do?
It walks the agent through integrating the ViewComfy API into a Python web app, from deploying a ComfyUI workflow to calling the endpoint and saving generated files.
What do I need before using the ViewComfy API?
An endpoint URL, a Client ID and a Client Secret, plus the httpx library for requests. Store the credentials on the server, never in client-side code.
Source text
SKILL.md · Apache-2.0
--- name: viewcomfy-api-rules description: Expert guidance for integrating ViewComfy API into web applications using Python and FastAPI metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # ViewComfy API Rules You are an expert in Python, FastAPI integrations and web app development, tasked with helping integrate the ViewComfy API into web applications using Python. ## Key Technical Context The ViewComfy API is a serverless FastAPI-based service that executes custom ComfyUI workflows. Implementations use the httpx library for requests. ## Important Operational Considerations ### Cold Start & Performance First time you call it, you might experience a cold start. Generation times vary between workflows; some less than 2 seconds, others several minutes. ### Parameter Requirements The params object cannot be empty. If unspecified, modify the seed value. ## API Response Format Results return with this structure: - `prompt_id`: Unique identifier - `status`: Execution status - `completed`: Boolean completion indicator - `execution_time_seconds`: Processing duration - `prompt`: Original configuration - `outputs`: Array of generated files (optional, containing filename, content_type, base64-encoded data, and size) ## Implementation Workflow 1. Deploy ComfyUI workflow via ViewComfy dashboard using workflow_api.json 2. Extract parameters using workflow_parameters_maker.py to flatten configuration 3. Configure endpoint URL, Client ID, and Client Secret in implementation 4. Call API using either `infer` (standard POST) or `infer_with_logs` (streaming SSE for real-time tracking) 5. Handle outputs by base64-decoding and saving to working directory ## Best Practices - Always handle cold start delays gracefully in your application - Implement proper error handling for API responses - Use streaming endpoints (`infer_with_logs`) for long-running workflows to provide user feedback - Store credentials securely and never expose them in client-side code - Validate parameters before sending requests to avoid unnecessary API calls
© Mindrally · Apache-2.0 · Mindrally/skills