Generate Images Using PhotoReal

Follow this recipe to generate images using PhotoReal v2


πŸ‘

Update

Negative Prompts can be used with PhotoReal v2 via API.

PhotoReal v2

The guide will recreate the following functionality in the Web UI via API.

Specify PhotoReal v2 using "photoRealVersion":"v2", if not specified, the default PhotoReal version will be v1.

πŸ“˜

Tip

  • Alchemy needs to be set to true (e.g"alchemy": true)
  • modelId for PhotoReal v2 needs to be specified as Leonardo Kino XL, Leonardo Diffusion XL or Leonardo Vision XL
  • photoRealStrength is not required for PhotoReal v2

Preset Styles available

StyleValue
BokehBOKEH
CinematicCINEMATIC
Cinematic (Closeup)CINEMATIC_CLOSEUP
CreativeCREATIVE
FashionFASHION
FilmFILM
FoodFOOD
HDRHDR
Long ExposureLONG_EXPOSURE
MacroMACRO
MinimalisticMINIMALISTIC
MonochromeMONOCHROME
MoodyMOODY
NeutralNEUTRAL
PortraitPORTRAIT
RetroRETRO
Stock PhotoSTOCK_PHOTO
VibrantVIBRANT
UnprocessedUNPROCESSED

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "height": 512,
  "prompt": "A majestic cat in the snow",
  "negative_prompt": "trees",
  "modelId": "aa77f04e-3eec-4034-9c07-d0f619684628",//Leonardo Kino XL model
  "width": 512,
  "alchemy": true,
  "presetStyle": "DYNAMIC",
  "photoReal": true,
  "photoRealVersion":"v2"
}
'

PhotoReal v1

Follow this recipe to generate images using PhotoReal v1


The guide will recreate the following functionality in the Web UI via API.

πŸ“˜

Tip

  • Alchemy needs to be set to true (e.g"alchemy": true)
  • modelId does not need to be specified in the API body when using PhotoReal v1.

Preset Styles available

StyleValue
CinematicCINEMATIC
CreativeCREATIVE
VibrantVIBRANT

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "height": 512,
  "prompt": "A cat staring at a window",
  "width": 512,
  "alchemy": true,
  "photoReal": true,
  "photoRealStrength": 0.5,
  "presetStyle": "CINEMATIC"
}
'