Skip to content

Recipes

Recipes expand into many nodes. They return template graphs. Placeholders survive withLora / hiresFix, so you bind once at the end.

ts
import {
  hiresFix,
  instantiateTemplate,
  paramRef,
  textToImage,
  withLora,
  type Graph,
} from "@stepupgaming/comfy-workflows";
import { explainGraph } from "@stepupgaming/comfy-workflows/recipes";

export function composed(): Graph {
  const tpl = textToImage({
    checkpoint: paramRef("checkpoint"),
    positivePrompt: paramRef("prompt"),
    seed: paramRef("seed"),
    width: 512,
    height: 512,
  });
  const withStyle = withLora(tpl, [
    { lora_name: "detail_tweaker.safetensors", strength_model: 0.8, strength_clip: 0.8 },
  ]);
  return hiresFix(withStyle, { scaleBy: 1.5, denoise: 0.45 });
}

export function expansion(): string {
  return explainGraph(composed());
}

export function bound(): Graph {
  return instantiateTemplate(composed(), {
    params: {
      checkpoint: "v1-5-pruned-emaonly.safetensors",
      prompt: "a lighthouse at dusk",
      seed: 42n,
    },
  });
}

Built-in recipes

RecipeWhat it builds
textToImageCheckpoint → CLIP encodes → empty latent → KSampler → VAE decode → Save
img2imgLoadImage → VAE encode → KSampler(denoise) → decode → save
inpaintImage + mask → VAE encode for inpaint → KSampler
outpaintPad for outpainting → encode for inpaint → KSampler
withLoraInsert LoraLoader between model/clip sources and consumers
withControlNetControlNet loader + apply on the first sampler
hiresFixLatent upscale + second KSamplerAdvanced before VAE decode
upscalePixel upscale model pass
explainGraph (from /recipes)Text expansion of nodes / params / wiring

Signatures: Recipe reference.

LoraSpec

ts
{ lora_name: string, strength_model?: number, strength_clip?: number }

There is no name / strength shorthand on the public type.

Seeds

textToImage requires seed. Reproducibility is the default, not an opt-in.

When not to use a recipe

Video graphs, speech graphs, anything whose nodes are not in the bundled core snapshot. Author those with generated specs. Recipes here are SD-image shaped on purpose.

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