02 / 07 · Compose
Call and payload anatomy
Separate your intent from the provider request. A brief is portable; a model body is specific to one endpoint.
Portable request brief
Copy this as a human handoff or workflow starting point. It is an illustrative brief, not an executable API payload.
| 1 | Asset: ceramic desk lamp, three-quarter view |
| 2 | Use: product card on a light background |
| 3 | Subject: one unbranded lamp, shade and base fully visible |
| 4 | Composition: three-quarter view; longest occupied dimension at most 72 percent on a square canvas |
| 5 | Style: clean editorial illustration, soft directional light |
| 6 | Palette: warm ivory body, deep blue cord, neutral background |
| 7 | Output: clean removable background, 1:1 cutout |
| 8 | Acceptance: alpha-128 framing at most 72 percent; recognizable at 96 and 32 px; no text or extra objects |
Plan the versioned Flows graph offline
Use one portable-asset-flow-v1 file with graph nodes, edges, compiler pin and contract. The public planner accepts that same file from a person or any LLM. A ready asset-workflow-plan-v2 result includes validation, compiler readiness, exact endpoint/body, warning details and deterministic graph/body/source fingerprints. Ready means local compilation only. The property example below is a real checked-in graph; its model, prompt, style and palette values are explicit and its saved-run IDs remain empty.
| 1 | node packages/asset-workflow/bin/plan.mjs apps/asset-library/production/flows-assets-property-2026-10-17/flows/neutral-threshold-bridge.flow.json |
Convert and import a workflow archive
The portable compiler envelope is not a Flows UI import file. Independent regression QA accepted the corrected lint-roller archive and converter: the strict portable and imported plans are ready with the same endpoint, body and compiler evidence, and wrong compiler pins or a changed graph are rejected before archive output. Independent offline QA also accepted all three property archives: the actual Flows parser and import preparation preserved titles, node data, handles and empty references; prepared graphs replanned to the exact saved bodies and fingerprints. From the design-system root, the property command below rebuilds them using a matching inspected Flows source checkout; --check requires byte-for-byte agreement with the committed archives. The local Flows workflows page at http://127.0.0.1:3003/dashboard/workflows was reachable, but account identity, editor role and backend source version were not verified. With a genuine authenticated editor session, Import or drag/drop opens an archive preview; explicit confirmation creates a saved workflow. Read back its graph and revision and compare the recompiled body with the offline plan before any paid step.
| 1 | node apps/asset-library/production/flows-assets-property-2026-10-17/build-archives.mjs <FLOWS_SOURCE_ROOT> --check |
Paid run remains a separate gate
After authenticated editor access, deployed-backend provenance and saved-graph readback are confirmed, check runner capabilities and obtain a paid-run grant against the exact node, model and input. The authenticated canvas uses flows.generationRuns.startNodeGeneration once, then reads that real run by ID. Retain the accepted input, request fingerprint, provider receipt, result URL and output-byte hash; an ambiguous submission stops without automatic retry. A successful provider job still needs independent visual QA, selected-byte intake, publication and separately verified app attachment. The legacy flows.generate.runGeneration action and asset-library direct-FAL CLIs do not establish this saved-workflow route. There is no verified headless paid adapter for an LLM.
Legacy direct-CLI request example
This example matches the legacy direct FAL draft runner only; it is not a verified flows_dashboard input schema. Save it for historical comparison, not as a new shared-flow dispatch recipe. In that CLI, subject is text; camera is an angle/framing object; style text, enabled parts and grade are explicit; palette colours are named; controls are simple named values. The matching camera sentence and framingMaxPercent give the framing QA helper an exact 72% request limit. References may be empty. The two example takes omit seed, so the runner generates a seed for each call; an explicit seed would be reused for both takes. Coral and any brand lock appear only if the author chooses them. The style key and version identify the authored selection; the runner uses the text in this file and does not fetch a preset from the Flows dashboard.
| 1 | { |
| 2 | "subject": "One unbranded ceramic desk lamp, shade and base fully visible; no text or extra objects", |
| 3 | "camera": { |
| 4 | "angle": "three-quarter", |
| 5 | "framing": "longest occupied dimension at most 72 percent on a square canvas" |
| 6 | }, |
| 7 | "style": { |
| 8 | "key": "editorial-illustration", |
| 9 | "version": "1", |
| 10 | "systemPrompt": "Keep materials clean and edges softly rounded.", |
| 11 | "stylePrompt": "A clear editorial illustration with soft directional light.", |
| 12 | "parts": { |
| 13 | "lock": true, |
| 14 | "direction": true, |
| 15 | "grade": true |
| 16 | }, |
| 17 | "grade": { |
| 18 | "contrast": 10 |
| 19 | } |
| 20 | }, |
| 21 | "palette": { |
| 22 | "colours": [ |
| 23 | { |
| 24 | "name": "Ivory", |
| 25 | "tag": "@body", |
| 26 | "hex": "#F3EFE7", |
| 27 | "role": "lamp body", |
| 28 | "vars": { |
| 29 | "usage": "main ceramic surface" |
| 30 | } |
| 31 | }, |
| 32 | { |
| 33 | "name": "Blue", |
| 34 | "tag": "@cord", |
| 35 | "hex": "#334D6E", |
| 36 | "role": "cord", |
| 37 | "vars": { |
| 38 | "avoid": "shade and background" |
| 39 | } |
| 40 | } |
| 41 | ] |
| 42 | }, |
| 43 | "controls": { |
| 44 | "lighting": "soft directional", |
| 45 | "background": "clean removable background", |
| 46 | "framingMaxPercent": 72 |
| 47 | }, |
| 48 | "references": [], |
| 49 | "output": { |
| 50 | "aspectRatio": "1:1", |
| 51 | "takes": 2, |
| 52 | "cutout": true |
| 53 | } |
| 54 | } |
Legacy direct-CLI preview boundary
The command below previews only the old direct-FAL request shape. It does not validate a Flows graph or prove a saved workflow, paid grant or dispatcher receipt. Use the versioned graph planner above for new work. The offline planner and the authenticated saved-node runner remain separate steps.
| 1 | node apps/asset-library/pipeline/draft-asset.mjs --request desk-lamp.request.json --out drafts/desk-lamp-001 --dry-run |
Legacy provider body and Flows evidence
The legacy direct CLI composes the authored brief into prompt text, then calls the shared falBody() helper. With no references it uses fal-ai/nano-banana; with HTTPS image references it uses fal-ai/nano-banana/edit. The actual body, endpoint and request ID go into receipt.json. Existing library takes have their own Recipe view; reconstructed recipes warn that exact historical dispatch is unknown.
- Prompt text: subject, camera, enabled style text and nonzero grade values, the required palette role with hex and usage/avoid notes, and simple controls. Disabled style parts contribute no text.
- Provider body: prompt, num_images: 1, output_format: png, aspect_ratio, and the submitted per-take seed. output.takes makes separate one-image calls; an omitted seed is generated for each take. A provider-returned seed, if any, is recorded separately.
- Edit inputs: references[].url becomes image_urls in its original order. Reference role and optional expected SHA-256 are local provenance, checked and recorded before live dispatch, not extra provider fields.
- Local-only descriptors: style key/version, palette names, tags and rgba remain in the saved request. Named controls enter prompt text, never extra FAL body fields. Cutout true triggers a separate Birefnet call after generation.
Framing is a request and a measurement
The dry run reports whether the original JSON declares an exact framing contract. A numeric controls.framingMaxPercent can supply the maximum; camera.framing can use precise supported wording such as “longest occupied dimension at most 72 percent.” Matching controls and prose must agree. A vague request remains unassessed rather than receiving an invented limit. Controls still become prompt text; the framing helper reads the saved request for QA, not as an extra FAL API parameter.
Verified current provider body
Both draft and historical CLIs use falBody(). This short prompt only illustrates that helper; the actual draft call uses the full composed prompt. The historical command adds its Otesse camera, style and brand text; the draft command composes only the explicit request values. The JSON fields below are FAL provider fields, not a universal asset-request schema. Do not pass this short provider body to draft-asset.mjs --request; use the accepted draft request above, which supplies subject and output.
| 1 | {"prompt":"A compact desk lamp","num_images":1,"output_format":"png","aspect_ratio":"1:1","seed":12345} |
A recorded take has layers
The current Recipe view presents style, branding and controls, subject, references, model and request body, composed prompt target, post-processing, and provenance. It is a view of an existing take, not a form that sends new calls.
Implementation references
- apps/asset-library/pipeline/lib/fal.mjs
- apps/asset-library/pipeline/generic-request.mjs
- apps/asset-library/pipeline/draft-asset.mjs
- apps/asset-library/pipeline/lib/framing-contract.mjs
- apps/asset-library/pipeline/lib/draft-framing-qa.mjs
- apps/asset-library/components/asset/RecipeLayers.tsx
- apps/asset-library/SPEC.md