POST
/
image
/
generate
curl --request POST \
  --url https://api.venice.ai/api/v1/image/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "fluently-xl",
  "prompt": "A beautiful sunset over a mountain range",
  "negative_prompt": "Clouds, Rain, Snow",
  "style_preset": "3D Model",
  "height": 1024,
  "width": 1024,
  "steps": 30,
  "cfg_scale": 7.5,
  "seed": 123456789,
  "lora_strength": 50,
  "safe_mode": false,
  "return_binary": false,
  "hide_watermark": false,
  "inpaint": {
    "strength": 50,
    "source_image_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "mask": {
      "image_prompt": "Generate a high-resolution image of a cute lop-eared rabbit with a fluffy coat. The rabbit should have a light brown and white fur pattern, with the white fur prominently covering its chest and underside. Its ears should be long and droop down on either side of its head, with the inner part of the ears showing a delicate pink hue. The rabbit should have expressive dark eyes and a small, pink nose. It should be sitting upright on a soft, light blue cushion, with a cozy, indoor setting in the background that includes a neutral-toned wall and wooden elements. The overall mood should be warm and endearing, capturing the gentle and charming nature of the rabbit.",
      "object_target": "rabbit'\''s face",
      "inferred_object": "rabbit'\''s face wearing round silver spectacles"
    }
  }
}'
{
  "id": "generate-image-1234567890",
  "request": "<any>",
  "images": [
    "<string>"
  ],
  "timing": {
    "inferenceDuration": 123,
    "inferencePreprocessingTime": 123,
    "inferenceQueueTime": 123,
    "total": 123
  }
}

Postman Collection

For additional examples, please see this Postman Collection.


Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept-Encoding
string

Supported compression encodings (gzip, br). Only applied when return_binary is false.

Body

application/json
model
string
required

The model to use for image generation.

prompt
string
required

The description for the image. Character limit is model specific.

Required string length: 1 - 1500
negative_prompt
string

A description of what should not be in the image. Character limit is model specific.

Maximum length: 1500
style_preset
string

An image style to apply to the image. Visit https://docs.venice.ai/apiv1imagegenerate for more details.

height
integer

Height of the generated image. Each model has a specific height and width divisor.

Required range: 0 < x < 1280
width
integer

Width of the generated image. Each model has a specific height and width divisor.

Required range: 0 < x < 1280
steps
integer

Number of inference steps. Each model has a specific max.

Required range: 0 < x < 50
cfg_scale
number

CFG scale parameter. Higher values lead to more adherence to the prompt.

Required range: 0 < x < 20
seed
integer

Random seed for generation. If not provided, a random seed will be used.

Required range: -999999999 < x < 999999999
lora_strength
integer

Lora strength for the model. Only applies if the model uses additional Loras.

Required range: 0 < x < 100
safe_mode
boolean

Whether to use safe mode. If enabled, this will blur out adult content.

return_binary
boolean

Whether to return binary image data instead of base64.

hide_watermark
boolean
default:
false

Whether to hide the Venice watermark. Venice may ignore this parameter for certain generated content.

inpaint
object

Response

200
application/json
Successfully generated image
id
string
required

The ID of the request.

images
string[]
required

Base64 encoded image data.

timing
object
required
request
any | null

The original request data sent to the API.