/comfy-ts:convert [workflow.json] [module-name]from comfy-ts
Converts ComfyUI workflow JSON (workflow.json, api.json, or template) into a typed comfy-ts workflow module (*.cflow.ts).
Ships in comfy-ts. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Convert this ComfyUI JSON into a comfy-ts module: $ARGUMENTS
Read node_modules/comfy-ts/guide-for-agents.md: the module pattern, the var kinds, import and export. The conversion needs a host whose .comfy-ts/hosts/<id>/sdk.d.ts exists and whose nodes cover the JSON; without one, set the project up first.
Let comfy-ts read the JSON offline and print it in the prompt format. A JSON with a nodes array is a workflow.json; an object of { class_type, inputs } entries is an api.json. Save this as a scratch .ts file in the project and run it with bun:
import { ComfyTS } from 'comfy-ts'
const host = ComfyTS.create().host({ id: '<host-id>', url: '<host-url>' })
await host.loadSchemaFromCache()
const json = JSON.parse(await Bun.file('<input.json>').text())
const wf = 'nodes' in json ? host.importWorkflowJson(json) : host.importApiJson(json)
console.log(JSON.stringify(wf.toApiJson(), null, 1))
An error that names a node or a model the host lacks is the answer: report it, never guess around it.
Write <module-name>.cflow.ts from that prompt: one b.<class_type>({ … }) call per node, producers first. A link ["<id>", <slot>] becomes the producing node's output, node.outputs.<name> with the output name from the OUT block of sdk.d.ts. A literal input stays a value. Make vars of what a user tunes: prompt text, seed, size, steps, input media, the model files.
Check it as a new workflow is checked: the project typechecks, bunx comfy-ts run ./<module-name>.cflow.ts --help lists the vars, a dry build has empty problems. Then compare (await m.default.build({ dry: true })).toApiJson() with the converted prompt: every loader, encoder, sampler and saver node of the prompt is there.
Delete the scratch file.
Report the module path, its vars, and every node the conversion dropped, with the reason.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rvion/comfy-ts --plugin comfy-ts5 skills in this plugin
/guidecomfy-tsBackground for projects that use comfy-ts, the typed TypeScript SDK for ComfyUI. Use when code imports comfy-ts, touches a *.cflow.ts module or a .comfy-ts/ folder, or builds, runs, converts or debugs ComfyUI workflows from TypeScript./runGenerate with comfy-ts, one headless run of a *.cflow.ts workflow module or a bundled example through comfy-ts run, returning the output files. Use when the user wants an image, video, audio or text generated./setupSet up comfy-ts in this project, install it and generate the typed SDK of a ComfyUI host. Use when a project starts using comfy-ts or adds a ComfyUI host./workflowWrite a new comfy-ts workflow module (*.cflow.ts) that generates an image, video, audio or text on a ComfyUI host. Use when the user wants a new generation pipeline in TypeScript.Other plugins' skills for the same job