# Generate Image

[**Try out this capability in Bria's sandbox**](https://platform.bria.ai/image-generation/fibo-generate/sandbox)
**Description**
Generates a new image based on your inputs.
This all-in-one endpoint first translates your input (`prompt` and/or `images`) into a structured JSON prompt using the state-of-the-art **Gemini 2.5 Flash** VLM bridge. It then *internally* uses that JSON to generate the final, deterministic image.
Use this endpoint for professional workflows that demand the highest-fidelity interpretation of your creative vision. The response includes both the final `image_url` and the `structured_prompt` (JSON).
For advanced, programmatic control, you can also pass in your own `structured_prompt` (e.g., from a previous response or the `/v2/structured_prompt/generate` endpoint) to bypass the internal VLM bridge. This allows for precise, auditable refinement or recreation of an image, or to generate multiple variations from the same structured prompt.


---

**Input Combination Rules**
The request body must include **one** of the following mutually exclusive combinations:
* `prompt` (Generates a new image from text)
* `images` (Generates a new image inspired by a reference image)
* `images` + `prompt` (Generates a new image inspired by an image and guided by text)
* `structured_prompt` (Recreates a previous image exactly, combined with a seed)
* `structured_prompt` + `prompt` (Refines a previous image using new text instructions, combined with a seed)



---

***Examples***
**Use Case 1: Using a textual prompt**
* **Input Prompt:** `photorealistic, high resolution rendering, balloon of lettering, "HAPPY NEW YEAR 2026", used color is Pantone Bran, Crocus, Deja vu blue, perfect composition and alignment, natural light set, white backdrop, ultra realistic, rich detail`
* **Output Image:** ![Example of text-to-image output](https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/fibo/new_year_2026.png)
* **Output `structured_prompt`:**
*The full structured JSON returned for this example is omitted here; the response carries it in full.*



---

**Use Case 2: Drawing inspiration from a reference image**
* **Input Image:** ![Example of reference image input](https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/fibo/ref_1.jpg)
* **Input Prompt:** `a ring inspired by the image`
* **Output Image:** ![Example of image-to-image output](https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/fibo/a_ring_inspired_by_the_image.png)
* **Output `structured_prompt`:**
*The full structured JSON returned for this example is omitted here; the response carries it in full.*



---

**Use Case 3: Refining a previously generated image**
* **Input Image (from previous response - shouldn't be part of the refine request):** ![Example of input image](https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/fibo/A_hyper_detailed__ultra_fluffy_owl_sitting_in_the_trees_at_night__looking_direct.png)
* **Input `structured_prompt` (from previous response - should be part of the refine request, toegther with the seed of the visual result):**
*The full structured JSON returned for this example is omitted here; the response carries it in full.*
* **Input Refinement Prompt:** `add sunlight`
* **Output Image:** ![Example of refinement output](https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/fibo/add_sunlight.png)
* **Output `structured_prompt` (refined):**
*The full structured JSON returned for this example is omitted here; the response carries it in full.*

Endpoint: POST /image/generate
Security: api_token

## Request fields (application/json):

  - `prompt` (string)
    Text-based instruction. Can be used alone to create a new prompt, or as a refinement command with an `images` or `structured_prompt`.

  - `images` (array)
    Publicly available URL or Base64-encoded image. Currently supports a single image.
Supported formats: **JPEG**, **JPG**, **PNG**, **WEBP**.

  - `structured_prompt` (string)
    A string containing the structured prompt in JSON format. Use a `structured_prompt` from a previous generation's response or the `/v2/structured_prompt/generate` endpoint for precise refinement.

  - `resolution` (string)
    Output image resolution. "4MP" improves image details, especially for photorealism, but will increase latency by 30 seconds. 4MP is supported only on the asynchronous path, so it must be requested with sync set to false (the default). A synchronous 4MP request returns 422.
    Enum: "1MP", "4MP"

  - `aspect_ratio` (string)
    Image aspect ratio. This parameter is optional.
    Enum: "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"

  - `seed` (integer)
    Seed for deterministic generation. Uses a random seed if omitted. This parameter is optional.

  - `sync` (boolean)
    Response mode. This parameter is optional.
* `false` (default): Asynchronous. Returns 202 with a `status_url` to poll.
* `true`: Synchronous. Holds the connection and returns 200 with the final result.
* `sync: true` is not supported with a `resolution` of `4MP`. 4MP is available on the asynchronous path only, and a synchronous 4MP request returns 422.

  - `webhook_url` (string)
    Optional URL for receiving the result via webhook when the async job completes. See [webhooks](/getting-started/async-requests#webhooks).

  - `output_type` (string)
    The desired output format
    Enum: "png", "jpeg"

  - `ip_signal` (boolean)
    If true, returns a warning for potential IP content in the `prompt` parameter. This parameter is optional.

  - `prompt_content_moderation` (boolean)
    If true, returns 422 on input prompt moderation failure in the `prompt` parameter. This parameter is optional.

  - `visual_input_content_moderation` (boolean)
    If true, returns 422 on visual input moderation failure. This parameter is optional.

  - `visual_output_content_moderation` (boolean)
    If true, returns 422 on visual output moderation failure. This parameter is optional.

## Response 200 fields (application/json):

  - `result` (object, required)

  - `result.image_url` (string, required)

  - `result.seed` (integer, required)

  - `result.structured_prompt` (string, required)

  - `request_id` (string, required)

  - `warning` (string)
    Returned only when ip_signal = true and the prompt field included IP content.

## Response 202 fields (application/json):

  - `request_id` (string, required)

  - `status_url` (string, required)

  - `warning` (string)
    Returned only when ip_signal = true and the prompt field included IP content.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

## Response 403 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

## Response 422 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

## Response 429 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

## Response 5XX fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string)

  - `request_id` (string, required)

