← Blog

How-to seriesSeptember 28, 2026

How to generate and revise an image with an agent

Generate one image, inspect it, and make a controlled revision through Vaaya using an explicit brief and separate generation and editing calls.

Write the image brief before choosing the model. “A homepage illustration” leaves the subject, crop and useful empty space unresolved. A brief that names those decisions gives your agent a way to judge the output and limits how many paid attempts it makes.

The workflow below produces one first image and, if needed, one controlled revision through Vaaya. The sample brief and review record are illustrative; they do not describe a completed generation.

1. Prepare the brief and connection

Connect your agent through Vaaya's installation guide. Have a destination for the file, permission to use any reference images and a total budget that includes revisions. Decide the intended crop before paying for a composition that will later be cut in half.

For an example landing-page image, a useful brief is a ceramic desk lamp on a dark oak table, a plain wall behind it and empty space on the left for a headline. Specify whether the lamp is an invented object or must match a real product. If an exact product matters, supply a reference and ask for an editing route.

Paste this after replacing the brackets:

Use Vaaya to create one image for [placement and audience].
Subject: [specific object or scene]. Composition: [crop and layout].
Style and lighting: [description]. Keep [space/details] clear.
Required text: [exact words, or none].
My total budget, including one possible revision, is [amount].
Consult for a compatible model and current schema first.
Show the planned call and quote, then generate within my budget.
Return the file, prompt, model, settings and actual charge.

2. Choose a generation or editing model

Ask consult for the task and inspect the current catalog. Vaaya exposes media work through fal/generate; the model field selects the model. The registered image pairs include seedream--v5-pro--text-to-image for a fresh image and seedream--v5-pro--edit for an edit.

The edit model takes reference images through image_urls. Other models can have different size, reference-count or format requirements. Have the agent read those requirements before preparing a call, then select the required dimensions from that model's supported settings.

A filename in chat is not a provider-readable URL. When staging is needed, fal/upload accepts file_name and content_type to request an upload slot. Upload the actual bytes using that slot before passing the returned file URL to generation. Include staging in the budget.

3. Generate one candidate

Set a max_cost_cents ceiling on the call. Keep the requested output count small and record the selected size and model next to the prompt. A different quality setting or a new render is a separate cost decision.

If the response contains a job ID, use result to retrieve that job. Do not submit the same generation again because the first result has not arrived. Save the returned file and check that it opens before calling the attempt complete. The tool reference covers this flow.

4. Inspect against the brief

Open the image at its intended display size and at full resolution. Check the object, crop, empty space, text and any product details against the original brief. File size alone does not establish quality.

An illustrative review record could look like this:

{
  "brief": "Desk lamp; empty space at left",
  "file": "lamp-v1.png",
  "composition": "accepted",
  "observed_problem": "Lamp shade is too wide",
  "next_change": "Narrow the shade; retain the composition",
  "actual_charge_cents": null
}

The null charge means this example has no receipt. In your real record, copy the charge from the returned call record. Separate requested settings from properties you measured in the downloaded file.

5. Revise one thing and retain both versions

For an edit, supply the accepted first image as the reference and name one change. For example: “Make the lamp shade narrower. Keep the table, wall, lighting and empty left area.” Use the supported edit model and obtain its current quote.

Compare the whole revised image with the first version. Editing can alter areas outside the requested change; keep the earlier file until the revision passes review. If exact lettering remains unreliable, leave room for typesetting in your publishing tool.

For an error, check whether the source URL was reachable and the selected fields matched the model. For a weak image, revise the brief before purchasing another attempt. Stop when the allocated revision budget is used, and hand back the best file with its remaining defects recorded.

Questions

Can I edit an image I already have?

Yes, supported image-editing models accept reference images. Check the selected model schema, make the file reachable, and use an editing model rather than assuming a text-to-image model accepts an image.

Will an edit preserve every unchanged pixel?

Do not assume that. Inspect the entire output for shifts in composition, lighting, text and identity, including areas you did not ask to change.

How do I keep revision costs predictable?

Set a total budget that includes revisions, check the current quote before each generation or edit, and apply a per-call ceiling. Keep the best existing file when the remaining budget cannot fund another attempt.

Try Vaaya with your agent.

Connect your agent, choose a service, and try your first call with Vaaya.

npx @vaaya/mcp install