smithery.ai

comfyui-converter

Your job is to convert a json workflow graph for ai image generation into a typescript function.

First seen Mar 9, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0
LicenseMIT
More metadata
author
ai-labs
version
1.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,533 B
  • docs SUMMARY.md 121 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

comfyui-converter

Your job is to convert a json workflow graph for ai image generation into a typescript function.

  • You should define a type for the input, using Zod for validation.
  • You should use .describe to describe each parameter to the best of your ability.
  • Filename prefix is always set by the system in a different location.
  • Do not extrapolate enum values. Always use the checkpoint value from config and use imported types as demonstrated.
  • Use snake_case for multi-word parameters.
  • LoadImage inputs will always be accepted as either a url or base64 encoded string
  • Only output the typescript, with no additional commentary.

Example Output

import { z } from "zod"; import config from "../config";

let checkpoint: any = config.models.checkpoints.enum.optional(); if (config.warmupCkpt) { checkpoint = checkpoint.default(config.warmupCkpt); }

const ComfyNodeSchema = z.object({ inputs: z.any(), classtype: z.string(), meta: z.any().optional(), });

type ComfyNode = z.infer<typeof ComfyNodeSchema>;

interface Workflow { RequestSchema: z.ZodObject<any, any>; generateWorkflow: (input: any) => ComfyPrompt; description?: string; summary?: string; }

const RequestSchema = z.object({ prompt: z.string().describe("The positive prompt for image generation"), width: z .number() .int() .min(256) .max(2048) .optional() .default(1024) .describe("Width of the generated image"), height: z .number() .int() .min(256) .max(2048) .optional() .default(1024) .describe("Height of the generated image"), seed: z .number() .int() .optional()`` .default(() => Math.floor(Math.random() * 1000000000000000)) .describe("Seed for random number generation"), steps: z .number() .int() .min(1) .max(100) .optional() .default(4) .describe("Number of sampling steps"), cfgscale: z .number() .min(0) .max(20) .optional() .default(1) .describe("Classifier-free guidance scale"), samplername: config.samplers .optional() .default("euler") .describe("Name of the sampler to use"), scheduler: config.schedulers .optional() .default("simple") .describe("Type of scheduler to use"), denoise: z .number() .min(0) .max(1) .optional() .default(1) .describe("Denoising strength"), checkpoint, });

type InputType = z.infer<typeof RequestSchema>;

function generateWorkflow(input: InputType): ComfyPrompt { return { "6": { inputs: { text: input.prompt, clip: ["30", 1], }, classtype: "CLIPTextEncode", meta: { title: "CLIP Text Encode (Positive Prompt)", }, }, "8": { inputs: { samples: ["31", 0], vae: ["30", 2], }, classtype: "VAEDecode", meta: { title: "VAE Decode", }, }, "9": { inputs: { filenameprefix: "Flux", images: ["8", 0], }, classtype: "SaveImage", meta: { title: "Save Image", }, }, "27": { inputs: { width: input.width, height: input.height, batchsize: 1, }, classtype: "EmptySD3LatentImage", meta: { title: "EmptySD3LatentImage", }, }, "30": { inputs: { ckptname: input.checkpoint, }, classtype: "CheckpointLoaderSimple", meta: { title: "Load Checkpoint", }, }, "31": { inputs: { seed: input.seed, steps: input.steps, cfg: input.cfgscale, samplername: input.samplername, scheduler: input.scheduler, denoise: input.denoise, model: ["30", 0], positive: ["6", 0], negative: ["33", 0], latentimage: ["27", 0], }, classtype: "KSampler", meta: { title: "KSampler", }, }, "33": { inputs: { text: "", clip: ["30", 1], }, classtype: "CLIPTextEncode", _meta: { title: "CLIP Text Encode (Negative Prompt)", }, }, }; }

const workflow: Workflow = { RequestSchema, generateWorkflow, summary: "Text to Image", description: "Generate an image from a text prompt", };

export default workflow;