Basic Image Generation

Image Generation with Cinna

Provide a prompt and the selected model will generate a new image.

Example

javascriptCopy codeimport Cinna from 'cinna'

const cinna = new Cinna({
  apiKey: process.env['CINNA_API_KEY'],
})

async function main() {
  const response = await cinna.images.generate({
    model: 'BrainDance',
    prompt: 'A futuristic cityscape at sunset'
  })
}

main()

Response

jsonCopy code{
  "url": "https://cinna-images.s3.us-east-1.amazonaws.com/**********.png"
}

Parameters

Type: ImageGenerateParams

Property
Type
Required
Description

model

string

true

The name of the model used to generate the image.

prompt

string

true

The main input used to guide image generation.

neg_prompt

string

false

Optional input to exclude specific elements from the result.

num_iterations

number

false

Number of iterations to run (range: 1 to 50).

guidance_scale

number

false

Influences how strongly the prompt affects the image (range: 1 to 20).

width

number

false

Desired width of the output image.

height

number

false

Desired height of the output image.

seed

number

false

Optional value to reproduce the same result.

Returns

Type: ImageGenerateParams with an added url field

Property
Type
Required
Description

url

string

true

A direct link to the generated image

Last updated