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
| Recipe | What it builds |
|---|---|
textToImage | Checkpoint → CLIP encodes → empty latent → KSampler → VAE decode → Save |
img2img | LoadImage → VAE encode → KSampler(denoise) → decode → save |
inpaint | Image + mask → VAE encode for inpaint → KSampler |
outpaint | Pad for outpainting → encode for inpaint → KSampler |
withLora | Insert LoraLoader between model/clip sources and consumers |
withControlNet | ControlNet loader + apply on the first sampler |
hiresFix | Latent upscale + second KSamplerAdvanced before VAE decode |
upscale | Pixel 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.