For the complete documentation index, see llms.txt. This page is also available as Markdown.

Iterate on outputs

Re-run a FLORA Technique with your favorite earlier outputs as image references, so new variants build on what already works.

After a grid, the natural next step is "more like #4 and #7". Technique image inputs take URLs, so earlier outputs can drive new runs with no re-upload. Use this recipe after Generate a grid when you've picked favorites.

What you'll build: a function that takes favorite output URLs and a direction, and runs a Technique with them as references.

Match your Technique's inputs

Every Technique defines its own inputs, and the API rejects input IDs a Technique doesn't have. Read them first:

import { FloraClient } from "@flora-ai/flora"

const client = new FloraClient()

const technique = await client.techniques.retrieve({ techniqueId: "your-technique-slug" })
console.log(technique.inputs)
// [
//   { id: "brief", name: "Brief", type: "text" },
//   { id: "reference_1", name: "Reference 1", type: "imageUrl" },
//   { id: "reference_2", name: "Reference 2", type: "imageUrl", optional: true },
// ]

A Technique that takes several references has one imageUrl input per reference slot. Pass one URL per slot.

TypeScript

Save as iterate.mts and run with npx tsx iterate.mts. The function fills the first text input with your direction and the image inputs, in order, with your favorites.

If the Technique has more required image inputs than you have favorites, the run is rejected with input_validation_error; fill the rest or pick a Technique with optional slots. For several variants, start several runs in parallel as in Generate a grid.

Compose iterations

The pattern repeats cleanly: iterate, pick new favorites, iterate again.

Without a Technique

To iterate with a single model instead, start a generation and pass the favorite's canvas node in reference_node_ids, or its URL in the model's image parameter (such as image_url, listed in GET /models).

URL lifetime

Output URLs are long-lived but not permanent, so re-running this weeks later with the same URLs may fail. For long-lived workflows, either:

  1. Generate again from the original brief, or

  2. Download your favorites and upload them as assets, then reference those URLs.

Last updated

Was this helpful?