comfyui-converter

Convert ComfyUI JSON workflow graphs into TypeScript functions with Zod validation.

25|4|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/thangchung/agent-engineering-experiment --skill comfyui-converter-thangchung
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comfyui-converter
Source: https://github.com/thangchung/agent-engineering-experiment/tree/main/comfyui-aks/.github/workflows/skills/comfyui
Command: npx skills add https://github.com/thangchung/agent-engineering-experiment --skill comfyui-converter-thangchung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires zod.

What problem does it solve? Manually translating ComfyUI image generation workflow graphs into typed, validated TypeScript code is repetitive and error-prone. This Skill automates that conversion, producing a ready-to-use workflow module with schema-validated inputs. ## Core Features & Use Cases - JSON-to-TypeScript Conversion: Transforms a ComfyUI workflow graph into a TypeScript function that generates the equivalent prompt graph programmatically. - Zod Input Validation: Defines a typed RequestSchema with .describe annotations for every parameter, including defaults, ranges, and enums sourced from config. - Use Case: You have a ComfyUI text-to-image workflow exported as JSON. Use this Skill to convert it into a TypeScript module exposing RequestSchema and generateWorkflow, ready to integrate into a backend image generation API. ## Quick Start Convert this ComfyUI JSON workflow graph into a TypeScript function with Zod-validated inputs.

Frequently Asked Questions about comfyui-converter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a ComfyUI workflow JSON to TypeScript?▼

Provide the ComfyUI JSON workflow graph and the Skill generates a TypeScript module containing a Zod RequestSchema and a generateWorkflow function. The output maps each graph node to its class_type and inputs, parameterized by the validated input fields.

How to validate ComfyUI workflow inputs with Zod?▼

The generated code defines a Zod object schema where each parameter has type constraints, min/max ranges, defaults, and `.describe` annotations. Checkpoint, sampler, and scheduler values come from imported config enums rather than hardcoded lists.

Does the converter support image inputs in ComfyUI workflows?▼

Yes, LoadImage inputs are accepted as either a URL or a base64 encoded string. The generated schema handles these parameters like other validated inputs in the RequestSchema.

What are the limitations of converting ComfyUI graphs to code?▼

The converter does not extrapolate enum values, so checkpoint and sampler options must exist in the imported config. Filename prefixes are set externally by the system, and the output is strictly TypeScript with no additional explanation.