Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill viewcomfy-api-rules -a claude-code
Open on GitHub

What 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.json and build the call with httpx.
  • Use infer_with_logs so progress from a long generation streams into the UI.
  • Parse the ViewComfy response: decode the base64 in outputs and 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-code

2Manually: put the files in place

~/.claude/skills/viewcomfy-api-rules/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/viewcomfy-api-rules/

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

Similar skills

Everything for Backend and APIs →

From the same set168

monorepo-tamagui Gives your agent a rulebook for cross-platform monorepos built on Tamagui, Turbo, Next.js, Expo and Supabase. Useful when web and mobile apps share one repo. CX Codex +1 677installs swiftui-development A rule pack that keeps your coding agent on MVVM, modern state management and Swift 6 concurrency when it writes SwiftUI. CX Codex +1 676installs react-native-cursor-rules A rule set that tells your coding agent how to write React Native: typed TypeScript, functional components, fewer re-renders, tuned FlatLists. CX Codex +1 670installs netlify-development A skill that gives your agent Netlify build and deploy rules: serverless and edge functions, Blobs, Image CDN, build config. Useful when it writes functions or edits netlify.toml. CX Codex +1 665installs salesforce-development A skill that gives your agent Salesforce coding rules: Apex, triggers, Lightning Web Components, SOQL and metadata. Useful when you build on the platform and want the agent to respect its limits. CX Codex +1 659installs graphql-development A skill that gives the agent GraphQL guidelines: schema design, type-safe clients, React and Next.js integration. Useful when it writes resolvers and queries. CX Codex +1 661installs turborepo A skill that tells the agent how to configure Turborepo: workspace layout, turbo.json, caching and task filters. Useful once the monorepo already exists. CX Codex +1 658installs rollup-bundler This skill gives your agent Rollup.js rules: output formats, external dependencies, tree-shaking and the plugins needed to bundle a library. CX Codex +1 657installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor