# Recraft

> Generate and edit raster or vector images and manage reusable styles.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/recraft

## Actions

### Create style

Create style in Recraft.

**Inputs**

- Image weights (`image_weights`, list): Image weights.
- Match (`match`, text): Match. One of: `regular`, `precise`, `flexible`.
- Mix policy (`mix_policy`, text): Mix policy. One of: `PaletteMatch`, `MaxWeight`.
- Model (`model`, text): Model. One of: `recraftv2`, `recraftv2_raster` (Recraftv2 raster), `recraftv2_vector` (Recraftv2 vector), `recraftv3`, `recraftv3_raster` (Recraftv3 raster), `recraftv3_vector` (Recraftv3 vector), `recraftv4`, `recraftv4_raster` (Recraftv4 raster), `recraftv4_vector` (Recraftv4 vector), `recraftv4_pro` (Recraftv4 pro), and 22 more.
- Palette (`palette`, object): Palette.
- Private (`private`, true/false): Private.
- Prompt (`prompt`, text): Prompt.
- Source style weights (`source_style_weights`, list): Source style weights.
- Source styles (`source_styles`, list): Source styles.
- Style (`style`, text): Style. One of: `any`, `digital_illustration` (Digital illustration), `icon`, `realistic_image` (Realistic image), `vector_illustration` (Vector illustration), `logo_raster` (Logo raster).
- Image urls (`image_urls`, list): URLs or data URLs of the reference images. JSON counterpart of the uploaded files.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "creation_time": "example",
    "credits": 1,
    "id": "example",
    "is_private": false,
    "style": "any"
  }
}
```

### Creative upscale

Creative upscale in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "image": {
      "b64_json": "example",
      "image_id": "example",
      "revised_prompt": "example",
      "url": "example"
    }
  }
}
```

### Crisp upscale

Crisp upscale in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "image": {
      "b64_json": "example",
      "image_id": "example",
      "revised_prompt": "example",
      "url": "example"
    }
  }
}
```

### Delete style

Delete style in Recraft.

**Inputs**

- Style (`style_id`, text, required): Style id.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {}
}
```

### Enhance image

Enhance image in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Refinement (`refinement`, text): Refinement. One of: `subtle`, `moderate`.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "image": {
      "b64_json": "example",
      "image_id": "example",
      "revised_prompt": "example",
      "url": "example"
    }
  }
}
```

### Enhance prompt

Enhance prompt in Recraft.

**Inputs**

- Prompt (`prompt`, text, required): Prompt.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "enhanced_prompt": "example"
  }
}
```

### Generate background

Generate background in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv3`, `recraftv3_vector` (Recraftv3 vector).
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.
- Mask URL (`mask_url`, text, required): URL or data URL of the mask image. JSON counterpart of the `mask` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Generate raster image

Generate raster image in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv2`, `recraftv2_raster` (Recraftv2 raster), `recraftv2_vector` (Recraftv2 vector), `recraftv3`, `recraftv3_raster` (Recraftv3 raster), `recraftv3_vector` (Recraftv3 vector), `recraftv4`, `recraftv4_raster` (Recraftv4 raster), `recraftv4_vector` (Recraftv4 vector), `recraftv4_pro` (Recraftv4 pro), and 22 more.
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Size (`size`, text): Size. One of: `1024x1024`, `1365x1024`, `1024x1365`, `1536x1024`, `1024x1536`, `1820x1024`, `1024x1820`, `1024x2048`, `2048x1024`, `1434x1024`, and 46 more.
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Style reference urls (`style_reference_urls`, list): URLs or data URLs of 1 to 10 style reference images. JSON counterpart of `style_references`.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Generate vector image

Generate vector image in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv2`, `recraftv2_raster` (Recraftv2 raster), `recraftv2_vector` (Recraftv2 vector), `recraftv3`, `recraftv3_raster` (Recraftv3 raster), `recraftv3_vector` (Recraftv3 vector), `recraftv4`, `recraftv4_raster` (Recraftv4 raster), `recraftv4_vector` (Recraftv4 vector), `recraftv4_pro` (Recraftv4 pro), and 22 more.
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Size (`size`, text): Size. One of: `1024x1024`, `1365x1024`, `1024x1365`, `1536x1024`, `1024x1536`, `1820x1024`, `1024x1820`, `1024x2048`, `2048x1024`, `1434x1024`, and 46 more.
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Style reference urls (`style_reference_urls`, list): URLs or data URLs of 1 to 10 style reference images. JSON counterpart of `style_references`.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Get account

Retrieve account from Recraft.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "credits": 1,
    "email": "example",
    "id": "example",
    "name": "example"
  }
}
```

### Get style

Retrieve style from Recraft.

**Inputs**

- Style (`style_id`, text, required): Style id.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "creation_time": "example",
    "id": "example",
    "is_private": false,
    "style": "any"
  }
}
```

### Inpaint image

Inpaint image in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv3`, `recraftv3_vector` (Recraftv3 vector).
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.
- Mask URL (`mask_url`, text, required): URL or data URL of the mask image. JSON counterpart of the `mask` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### List basic styles

Retrieve a page of basic styles from Recraft.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "styles": []
  }
}
```

### List styles

Retrieve a page of styles from Recraft.

**Inputs**: None.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "styles": []
  }
}
```

### Outpaint image

Outpaint image in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv3`, `recraftv3_vector` (Recraftv3 vector).
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Expand bottom (`expand_bottom`, number): Expand bottom.
- Expand left (`expand_left`, number): Expand left.
- Expand right (`expand_right`, number): Expand right.
- Expand top (`expand_top`, number): Expand top.
- Size (`size`, text): Size. One of: `1024x1024`, `1365x1024`, `1024x1365`, `1536x1024`, `1024x1536`, `1820x1024`, `1024x1820`, `1024x2048`, `2048x1024`, `1434x1024`, and 46 more.
- Zoom out percentage (`zoom_out_percentage`, number): Zoom out percentage.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Remove background

Remove background in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "image": {
      "b64_json": "example",
      "image_id": "example",
      "revised_prompt": "example",
      "url": "example"
    }
  }
}
```

### Replace background

Replace background in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv3`, `recraftv3_vector` (Recraftv3 vector).
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Restyle image

Restyle image in Recraft.

**Inputs**

- Controls (`controls`, object): Controls.
- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv2`, `recraftv2_raster` (Recraftv2 raster), `recraftv2_vector` (Recraftv2 vector), `recraftv3`, `recraftv3_raster` (Recraftv3 raster), `recraftv3_vector` (Recraftv3 vector), `recraftv4`, `recraftv4_raster` (Recraftv4 raster), `recraftv4_vector` (Recraftv4 vector), `recraftv4_pro` (Recraftv4 pro), and 22 more.
- N (`n`, number): N.
- Negative prompt (`negative_prompt`, text): Negative prompt.
- Prompt (`prompt`, text, required): Prompt.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Style (`style`, text): Style.
- Style (`style_id`, text): Style id.
- Style match (`style_match`, text): Style match. One of: `regular`, `precise`, `flexible`.
- Text layout (`text_layout`, list): Text layout.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.
- Strength (`strength`, number): Strength.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Vary image

Vary image in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Model (`model`, text): Model. One of: `recraftv2`, `recraftv2_raster` (Recraftv2 raster), `recraftv2_vector` (Recraftv2 vector), `recraftv3`, `recraftv3_raster` (Recraftv3 raster), `recraftv3_vector` (Recraftv3 vector), `recraftv4`, `recraftv4_raster` (Recraftv4 raster), `recraftv4_vector` (Recraftv4 vector), `recraftv4_pro` (Recraftv4 pro), and 22 more.
- N (`n`, number): N.
- Random seed (`random_seed`, number): Random seed.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Size (`size`, text, required): Size. One of: `1024x1024`, `1365x1024`, `1024x1365`, `1536x1024`, `1024x1536`, `1820x1024`, `1024x1820`, `1024x2048`, `2048x1024`, `1434x1024`, and 46 more.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "data": [],
    "style_id": "example"
  }
}
```

### Vectorize image

Vectorize image in Recraft.

**Inputs**

- Image format (`image_format`, text): Image format. One of: `webp`, `png`.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json).
- Upscale (`upscale`, text): Upscale. One of: `upscale4mp`, `upscale16mp`.
- Color reduction (`color_reduction`, text): Color reduction. One of: `on`, `off`.
- Limit num shapes (`limit_num_shapes`, text): Limit num shapes. One of: `on`, `off`.
- Max num colors (`max_num_colors`, number): Max num colors.
- Max num shapes (`max_num_shapes`, number): Max num shapes.
- Return gradients (`return_gradients`, text): Return gradients. One of: `on`, `off`.
- Shape stacking (`shape_stacking`, text): Shape stacking. One of: `cut_out` (Cut out), `hierarchical`.
- Small shape filter (`small_shape_filter`, text): Small shape filter. One of: `on`, `off`.
- Strict color palette (`strict_color_palette`, list): Strict color palette.
- Svg compression (`svg_compression`, text): Svg compression. One of: `on`, `off`.
- Image URL (`image_url`, text, required): URL or data URL of the input image. JSON counterpart of the `image` file.

**Outputs**

- `data` (object): The result returned by Recraft.

**Example output**

```json
{
  "data": {
    "created": 1,
    "credits": 1,
    "image": {
      "b64_json": "example",
      "image_id": "example",
      "revised_prompt": "example",
      "url": "example"
    }
  }
}
```
