Image Generation
ShortGenius includes a powerful AI image generation feature. By providing a text prompt and specifying an aspect ratio (and optionally an image style), you can quickly create unique visuals for your projects. This section covers creating, listing, retrieving, and customizing images.
Creating Images
Endpoint: POST /images
Basic Example
Key Fields:
prompt
string
Yes
Text prompt for image creation.
aspect_ratio
string
Yes
One of "556"
, "969"
, or "61"
. (Equivalent to 5:5.6, 9:16, 6:1, etc.)
image_style_id
string
No
An optional style preset. Retrieve available styles via GET /images/styles
.
scene_id
string
No
If you want to attach this generated image to a particular video scene.
wait_for_generation
boolean
No
If false, the API returns immediately, and you must poll to see the final image. If true, it waits until the image is generated.
Sample Response (Synchronous)
If wait_for_generation
is true, and generation succeeds quickly, you might get a response like:
If wait_for_generation
is false, you might see state: "pending"
or state: "generating"
, and you’ll need to poll the GET endpoint until the state becomes "completed"
.
Retrieving Images
You can list all images you’ve generated or retrieve a single one by its ID.
List Images
Endpoint: GET /images
page
0
Results page number (zero-based)
limit
50
Items per page, up to 200
Sample Response:
Retrieve a Single Image
Endpoint: GET /images/{id}
Sample Response:
Image Styles
ShortGenius provides built-in image styles for enhanced customization. Each style has a unique id
and prompt logic behind it.
List Image Styles
Endpoint: GET /images/styles
Sample Response:
You can use these IDs in the image_style_id
field when creating images:
Attaching Images to Videos
While drafting or creating videos, you can include AI-generated images in the video scenes, by either:
Generating the image first, then embedding the
id
orurl
into a scene.Specifying a
scene_id
when callingPOST /images
, so the platform automatically associates it.
Here’s a simplified example of attaching an existing image to a video scene:
(Note: This is a conceptual representation; the actual schema for passing images may vary based on your integration.)
Next Steps
Now that you know how to generate and retrieve images, let’s move on to Audio Generation (Text-to-Speech). You can create voiceovers or add TTS audio to your automated videos for a more immersive experience.
Last updated