emit_partner_workflow
Write a local API workflow containing a partner model's node, avoiding upfront API calls and spending. Run the saved workflow later to execute and bill.
Instructions
Write a runnable workflow that drives a partner model's NODE on LOCAL ComfyUI.
Wraps comfy generate <model> --emit-workflow <out_path>. Writes an
API-format graph containing the partner's API node and returns — calls no
partner API, spends nothing. Chain::
emit_partner_workflow("flux-pro", "/tmp/flux.json", {"prompt": "a red fox"})
run_workflow("/tmp/flux.json", confirm_spend=True) # the node bills HERE
fetch_outputs(prompt_id)Args:
model: only FIVE aliases map to a node — flux-2, flux-pro,
kling-i2v, nano-banana, seedance. Everything else
raises; route to partner_generate instead (narrow coverage,
not "unsupported").
params: the model's own inputs, same validation as partner_generate;
optional even where the proxy requires them (defaults fillable
later via set_workflow_slot).
out_path: the workflow JSON to write. comfy-cli OVERWRITES it in place
with no existence check — name a fresh file.
Returns:
comfy-cli's own {"out": ..., "model": ..., "nodes": ...}.
Gotchas:
- No confirm_spend here: this call never spends. RUNNING the
emitted graph is what bills — pass confirm_spend=True to that
run_workflow call, and do not read its absence as protection: a
comfy-cli lacking the spend gate runs and bills silently regardless.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| params | No | ||
| out_path | Yes |