Images

Generate game-art images from a text prompt alone, selecting an image_type (e.g. sprite) and optionally art_style, perspective, and aspect_ratio. The job result is an array of image results, each with a url; request n (1-8) to control how many variations come back. Because it generates purely from text it takes no source image, so there is no upload size limit to trip. Credits are held when the job is accepted and refunded if it fails or is cancelled; the charge scales with the number of images produced. Use createImage to make new images from scratch; use generateWithStyle to match a reference image's art style, editImage to modify an existing image, and removeBackground to cut out a subject. Pass an optional request_id to tag the results so you can retrieve them later via listGenerations (type image). Requires an API key (user scope). The call returns 202 with a job id - poll getApiJob (pass wait 30 to long-poll) honouring poll_after_ms, until status is succeeded; its result field is exactly the response documented for this operation. Synchronous responses are deprecated but still supported: pass `async: false` to block until the result is ready and receive it as the response body. Synchronous calls run on the same queue: the response carries an X-Ludo-Job-Id header, and a job still running after 15 minutes comes back as 202 with the job instead of an error. Each account may have up to 50 generations queued or running at once via the API; a request beyond that returns 429 (code PENDING_JOBS_LIMIT).

Changed on
post/assets/image

Request

  • Base URL
    https://api.ludo.ai/api
  • Auth
    API key in header Authorization

Request body

image_typestring required

What kind of image to generate.

promptstring required

Text description of the image to generate. The more detailed the prompt, the more accurate the image will be.

art_stylestring

Visual art style for the sprite (e.g., "Pixel Art", "Cartoonish", "Realistic").

perspectivestring

Camera angle/view for the sprite (e.g., "Side view", "Front view", "Isometric").

aspect_ratiostring

Aspect ratio of the output image.

ninteger

Number of image variations to generate

augment_promptboolean

Rewrites your prompt behind the scenes into the form the model works best with. Leave it on (the default). Turning it off does not give you more control - it usually gives worse results. Do not disable it unless you really know what you are doing and have tested your prompts extensively.

request_idstring

Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again. Also usable as the request_id filter of listGenerations.

asyncboolean

Defaults to true: the call returns 202 immediately with a job id to poll with getApiJob. Set false for a synchronous response (deprecated but supported): the call then blocks until the result is ready.

Response

Success

urlstring
request_idstring
created_atinteger
modelstring

The id of the model that generated or edited the image, so you can tell when the model behind an operation changes. Generated and edited images only.

promptstring

The prompt as the model received it. With augment_prompt on, this is the rewritten prompt, not the one you sent. Generated and edited images only.

Changes