Skip to content

Comfy WorkflowsCode-first, typed, composable workflows for ComfyUI

Stop hand-editing workflow JSON. Import an existing graph or author one in TypeScript, compile it deterministically, package it, and run it anywhere Comfy runs.

Typed composition, not pseudo-code

ts
import { workflow } from "@stepupgaming/comfy-workflows";
import { conditioning, image, latent, loaders, sampling } from "@stepupgaming/comfy-workflows/nodes";

const g = workflow("t2i");
const ckpt = g.add(loaders.CheckpointLoaderSimple, {
  ckpt_name: "v1-5-pruned-emaonly.safetensors",
});
const pos = g.add(conditioning.CLIPTextEncode, { text: "a red cube", clip: ckpt.CLIP });
const lat = g.add(latent.EmptyLatentImage, { width: 512, height: 512, batch_size: 1 });
const ks = g.add(sampling.KSampler, {
  model: ckpt.MODEL,
  positive: pos.CONDITIONING,
  negative: pos.CONDITIONING,
  latent_image: lat.LATENT,
  seed: 42n,
  steps: 20,
  cfg: 7,
  sampler_name: "euler",
  scheduler: "normal",
  denoise: 1,
});
const dec = g.add(latent.VAEDecode, { samples: ks.LATENT, vae: ckpt.VAE });
g.add(image.SaveImage, { images: dec.IMAGE, filename_prefix: "t2i" });
TypeScriptGraph IRCompilerComfy

TypeScript is what you edit · Graph IR is the semantic document · Comfy JSON is a build artifact

Released under the MIT License. Unofficial project. Not affiliated with or endorsed by Comfy Org.