mcpField
V
viewcomfy-api-rules

viewcomfy-api-rules

github.com/mindrallyCreative & media287667 installsUpdated 3w ago
Repository

About viewcomfy-api-rules

A skill for integrating the ViewComfy API into Python web applications. It explains workflow setup, request methods, output handling, and operational concerns such as cold starts and long-running generation.

Key features

  1. 01ViewComfy workflow deployment steps
  2. 02Parameter extraction and validation
  3. 03Standard and streaming API requests
  4. 04Base64 output decoding and saving
  5. 05Credential and error handling guidance

Use cases

  1. 01Connecting a Python web app to ViewComfy
  2. 02Tracking long-running workflow execution
  3. 03Saving generated files from API responses

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mindrally/skills --skill viewcomfy-api-rules

After installing, type/viewcomfy-api-rulesin Claude Code to confirm it loaded.

Details

From the project README

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

Comments

Markdown supported