POST
/
generate-image
curl --request POST \
  --url https://nano-gpt.com/api/generate-image \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "prompt": "RAW photo, a portrait photo of a latina woman in casual clothes, natural skin, 8k uhd, high quality, film grain, Fujifilm XT3",
  "model": "recraft-v3",
  "width": 1024,
  "height": 1024,
  "negative_prompt": "<string>",
  "nImages": 1,
  "num_steps": 10,
  "resolution": "1024x1024",
  "sampler_name": "<string>",
  "scale": 7.5
}'
{
  "image": "<string>",
  "cost": 123,
  "inputTokens": 123,
  "outputTokens": 123
}

Authorizations

x-api-key
string
header
required

Body

application/json
Parameters for image generation
prompt
string
required

The text description of the image to generate

Example:

"RAW photo, a portrait photo of a latina woman in casual clothes, natural skin, 8k uhd, high quality, film grain, Fujifilm XT3"

model
string
default:recraft-v3
required

The model to use for generation

width
integer
default:1024

Width of the generated image

height
integer
default:1024

Height of the generated image

negative_prompt
string

Things to avoid in the generated image

nImages
integer
default:1

Number of images to generate

num_steps
integer
default:10

Number of denoising steps

resolution
string
default:1024x1024

Output resolution

sampler_name
string

Sampling method

scale
number
default:7.5

Guidance scale

Response

200
application/json
Image generation response
image
string

Base64 encoded image data

cost
number

Cost of the generation

inputTokens
integer

Number of input tokens used

outputTokens
integer

Number of output tokens used