This Headshot Generator workflow lets you upload a selfie, choose an outfit and backdrop, and produce a polished, professional portrait. It wires together text controls and image conditioning so your face is preserved while the clothing and background are restyled. Your selfie is brought in with LoadImage and routed into a core generation node (ID: d4c06663-cb1a-4a41-a36b-f09c93e55e7e) that handles the actual synthesis. PreviewAny gives you quick visual checks, and SaveImage writes final results to disk.
Outfit and backdrop are managed with text nodes so you can work from presets or free‑type instructions. PrimitiveStringMultiline holds a small JSON block of presets; JsonExtractString pulls fields like outfit and backdrop from that JSON. ComfySwitchNode lets you toggle between preset-driven text and a custom prompt path. StringConcatenate assembles the final instruction text the generator sees (for example, a base headshot prompt plus your selected outfit and backdrop). A CustomCombo node encapsulates supporting pieces of the pipeline, so model loading and sampler details stay tidy while still exposing the key inputs you need for fast iteration.
API
Use this workflow from code
Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.
Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
// Install (beta)
npm i @comfyorg/sdk
// Run this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";
const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).
Comfy Cloud API access requires a plan with an API key.
FAQ

















