Skip to content
FLORA DocsGo to app

Generate without a Technique

Run a model straight from a prompt — no saved Technique required.

Techniques are FLORA’s superpower — saved workflows with locked-in inputs and post-processing. But sometimes you just want a raw model run: a prompt, a model, an image. For that, the agent uses client.generations.create instead of a Technique. No slug, no saved workflow.

Generate 3 cinematic product shots of a ceramic mug on a sunlit table. Use a good image model, 4:3.

  1. Resolve a workspace and project

    Generations are billed to a workspace and attach to a project, so the agent first calls client.workspaces.list() and either picks an existing project (client.projects.list(...)) or creates one with client.projects.create(...).

  2. Pick a model

    The agent calls client.models.list({ type: "image" }) to find an available model_id and the parameters it accepts (aspect ratio, seed, etc.).

  3. Start the generation

    It calls client.generations.create(...) with type, prompt, workspace_id, project_id, the chosen model, and any model-specific params.

  4. Poll until complete

    Generations don’t have a saved-Technique run to poll, so the agent polls history: client.generations.list(...) (newest first), matches its run_id, and renders the outputs once status is completed.

The requested images render inline in the chat as each generation completes — same as a Technique run, just without a Technique behind them.

| | Technique run | Generation | | --- | --- | --- | | Entry point | client.techniques.runs.create(techniqueId, …) | client.generations.create(…) | | Needs a saved Technique | Yes | No | | Inputs | The Technique’s input schema (inputs[]) | type + prompt + optional model/params | | Best for | Repeatable, branded, multi-step workflows | One-off, ad-hoc model runs | | Post-processing | Baked into the Technique | None — raw model output |

async function run(client) {
// 1. Resolve a workspace and a project (both required by generate)
const { workspaces } = await client.workspaces.list();
const workspace_id = workspaces[0].workspace_id;
const project = await client.projects.create({ name: "Quick generations", workspace_id });
// 2. Pick an image model
const { models } = await client.models.list({ type: "image" });
const model = models[0].model_id;
// 3. Start the generation
const gen = await client.generations.create({
type: "image",
prompt: "a cinematic product photo of a ceramic mug on a sunlit table",
workspace_id,
project_id: project.project_id,
model,
params: { aspect_ratio: "4:3" }, // model-specific — see client.models.list
});
console.log("Generation started:", gen.run_id);
// 4. Poll history until this run completes
let result;
do {
await new Promise((r) => setTimeout(r, 3000));
for await (const g of client.generations.list({ workspace_id, limit: 10 })) {
if (g.run_id === gen.run_id) { result = g; break; }
}
console.log("Status:", result?.status, result?.progress);
} while (result && (result.status === "pending" || result.status === "running"));
return result?.outputs; // [{ output_id, type: "imageUrl", url }]
}
  • type must be exactly one of image, video, audio, or text — not a model family like t2i or text-to-image.
  • model must be a model_id from client.models.list(...). If you see “Model … is not available”, list models for the same type and retry with one of the returned IDs. Omit model to use the workspace default.
  • workspace_id and project_id are both required. The generation shows up on that project’s canvas in FLORA.
  • Output URLs are long-lived but not permanent — download anything you need to keep.