Recraft Image

Recraft Image Generation and Editing API

Learn the basics of the Recraft API, including raster and vector image generation, style creation, image generation in your brand style and colors, image vectorization, and background removal.

Features

Styles

A style is a descriptor that defines the visual appearance and feel of generated images. This includes a wide array of elements such as textures and visual effects, shapes and colors, composition and lines, etc. There are four classes of base styles: realistic image, digital illustration, vector illustration, and icon.

Realistic

Show More
Images of style “realistic” are expected to look like just ordinary photographs made with a digital camera or a smartphone or a film camera.

Digital illustration

Show More
Images of style “digital illustration” are pictures drawn by hand or using computers - virtually everything except photos and vector illustrations. The most crucial difference from “realistic images” is that illustrations possess simplified textures (like in 3D-rendered or manually drawn images) - or they are stylized in a certain creative way. The difference from “vector illustration” is that “digital illustrations” allow for more complex color transitions, shades, and fine textures.

Vector illustration

Show More
Images of style “vector illustration” are expected to look like those drawn using vector graphics (see Wikipedia). Usually, they use only a few different colors at once, shapes are filled with flat colors or simple color gradients. Shapes of objects can be arbitrarily complex.

Icon

Show More
Images of style “icon” are small digital images or symbols used in the graphical user interface. They are designed to be simple and recognizable at small sizes, often visually summarizing the action or object they stand for, or they can act as the visual identity for an app or a website and are crucial in branding.

A style can be refined by adding a substyle for more precise definition. Below, you will find a list of supported styles and corresponding substyles. Please note that the available styles and substyles may vary depending on the model. Additionally, you have an option to create your own style by combining a base style (e.g., realistic image, digital illustration, vector illustration, or icon) with a collection of reference images.

Auxiliary

Controls

The generation process can be adjusted with a number of tweaks.

ParameterTypeDescription
artistic_levelinteger or nullDefines the artistic tone of your image. At a simple level, the person looks straight at the camera in a static and clean style. Dynamic and eccentric levels introduce movement and creativity. The value should be in the range [0..5].
colorsarray of color definitionsAn array of preferable colors.
background_colorcolor definitionUse the given color as a desired background color.
no_textboolDo not embed text layouts.

Colors

The Color type is defined as an object with the following fields:

FieldDescription
rgb (required)An array of 3 integer values in the range of 0...255 defining the RGB Color Model.

Example:

(Code extracted to sandbox)

Text Layout

Text layout is used to define spatial and textual attributes for individual text elements. Each text element consists of an individual word and its bounding box (bbox).

AttributeDescription
text (required)A single word containing only supported characters.
bbox (required)A bounding box representing a 4-angled polygon. Each point in the polygon is defined by relative coordinates.
  • Bounding Box: The bounding box (bbox) is a list of 4 points representing a 4-angled figure (not necessarily a rectangle). Each point specifies its coordinates relative to the layout dimensions, where (0, 0) is the top-left corner, and (1, 1) is the bottom-right corner.
  • Coordinates: Coordinates are relative to the layout dimensions. Coordinates can extend beyond the [0, 1] range; such values indicate that the shape will be cropped.
  • Points: The bounding box must always have exactly 4 points. Each point is an array of two floats [x, y] representing the relative position.
  • Supported Characters: The text field must contain an individual word composed of the following supported characters:

(Code extracted to sandbox)

Example:

(Code extracted to sandbox)

Appendix

List of styles

StyleRecraft V3 SubstylesRecraft V2 Substyles
any(not applicable)(not available)
realistic_image- b_and_w
- enterprise
- evening_light
- faded_nostalgia
- forest_life
- hard_flash
- hdr
- motion_blur
- mystic_naturalism
- natural_light
- natural_tones
- organic_calm
- real_life_glow
- retro_realism
- retro_snapshot
- studio_portrait
- urban_drama
- village_realism
- warm_folk
- b_and_w
- enterprise
- hard_flash
- hdr
- motion_blur
- natural_light
- studio_portrait
digital_illustration- 2d_art_poster
- 2d_art_poster_2
- antiquarian
- bold_fantasy
- child_book
- cover
- crosshatch
- digital_engraving
- engraving_color
- expressionism
- freehand_details
- grain
- grain_20
- graphic_intensity
- hand_drawn
- hand_drawn_outline
- handmade_3d
- hard_comics
- infantile_sketch
- long_shadow
- modern_folk
- multicolor
- neon_calm
- noir
- nostalgic_pastel
- outline_details
- pastel_gradient
- pastel_sketch
- pixel_art
- plastic
- pop_art
- pop_renaissance
- seamless
- street_art
- tablet_sketch
- urban_glow
- urban_sketching
- young_adult_book
- young_adult_book_2
- 2d_art_poster
- 2d_art_poster_2
- 3d
- 80s
- engraving_color
- glow
- grain
- hand_drawn
- hand_drawn_outline
- handmade_3d
- infantile_sketch
- kawaii
- pixel_art
- plastic
- psychedelic
- seamless
- voxel
- watercolor
vector_illustration- bold_stroke
- chemistry
- colored_stencil
- cosmics
- cutout
- depressive
- editorial
- emotional_flat
- engraving
- line_art
- line_circuit
- linocut
- marker_outline
- mosaic
- naivector
- roundish_flat
- seamless
- segmented_colors
- sharp_contrast
- thin
- vector_photo
- vivid_shapes
- cartoon
- doodle_line_art
- engraving
- flat_2
- kawaii
- line_art
- line_circuit
- linocut
- seamless
icon(not available)- broken_line
- colored_outline
- colored_shapes
- colored_shapes_gradient
- doodle_fill
- doodle_offset_fill
- offset_fill
- outline
- outline_gradient
- pictogram
logo_raster- emblem_graffiti
- emblem_pop_art
- emblem_punk
- emblem_stamp
- emblem_vintage
(not available)

List of image sizes

  • 1024x1024
  • 1365x1024
  • 1024x1365
  • 1536x1024
  • 1024x1536
  • 1820x1024
  • 1024x1820
  • 1024x2048
  • 2048x1024
  • 1434x1024
  • 1024x1434
  • 1024x1280
  • 1280x1024
  • 1024x1707
  • 1707x1024

Policies

All generated images are currently stored for approx. 24 hours. This policy may change in the future, and you should not rely on it remaining constant.

Infrastructure: AiApiGiaRe-v10.0
Gateway Status: Operational