# Recraft V4 Styles Pro Text to Image

> Generates raster images that hold a consistent style, from either a saved style ID or reference images attached directly.


## Overview

- **Endpoint**: `https://fal.run/recraft/v4/style/pro/text-to-image`
- **Model ID**: `recraft/v4/style/pro/text-to-image`
- **Category**: text-to-image
- **Kind**: inference
**Tags**: stylized, transform, editing



## Pricing

Your request will cost **0.1** per generated image when a **style_id** is provided. If no **style_id** is provided, a new one will be generated from the provided images and you will be charged **0.005** extra. You will be given a style_id for such a generation.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_)
  - Examples: "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond"

- **`image_size`** (`ImageSize | Enum`, _optional_):
   Default value: `square_hd`
  - Default: `"square_hd"`
  - One of: ImageSize | Enum
  - Examples: "landscape_16_9"

- **`colors`** (`list<RGBColor>`, _optional_):
  An array of preferable colors
  - Default: `[]`
  - Array of RGBColor

- **`background_color`** (`RGBColor`, _optional_):
  The preferable background color of the generated images.

- **`enable_safety_checker`** (`boolean`, _optional_):
  If set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked. Default value: `true`
  - Default: `true`

- **`style_id`** (`string`, _optional_):
  The ID of an existing V4 custom style.

- **`image_urls`** (`list<string>`, _optional_):
  The URLs of the style reference images. Supports PNG, JPG, and WEBP; provide between 1 and 10 images.
  - Array of string

- **`style_match`** (`Enum`, _optional_):
  Override how closely the generation follows the custom style.
  - Options: `"precise"`, `"flexible"`



**Required Parameters Example**:

```json
{
  "prompt": "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond"
}
```

**Full Example**:

```json
{
  "prompt": "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond",
  "image_size": "landscape_16_9",
  "colors": [],
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<File>`, _required_)
  - Array of File
  - Examples: [{"file_name":"image.webp","file_size":1949504,"content_type":"image/webp","url":"https://storage.googleapis.com/falserverless/example_outputs/recraft-v4/pro-output.webp"}]

- **`style_id`** (`string`, _optional_):
  The custom style used or created for this generation.



**Example Response**:

```json
{
  "images": [
    {
      "file_name": "image.webp",
      "file_size": 1949504,
      "content_type": "image/webp",
      "url": "https://storage.googleapis.com/falserverless/example_outputs/recraft-v4/pro-output.webp"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/recraft/v4/style/pro/text-to-image \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "recraft/v4/style/pro/text-to-image",
    arguments={
        "prompt": "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("recraft/v4/style/pro/text-to-image", {
  input: {
    prompt: "Crash zoom frozen at the moment of impact as a kingfisher breaks the surface of a pond"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/recraft/v4/style/pro/text-to-image)
- [API Documentation](https://fal.ai/models/recraft/v4/style/pro/text-to-image/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=recraft/v4/style/pro/text-to-image)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
