What You Will Build
Text to Image
Generate images from descriptive text prompts
Model Selection
Choose from multiple AI image models
Style Control
Apply visual styles such as photorealistic, artistic, or cartoon
Job Polling
Monitor image generation and retrieve the result
Before You Begin
Make sure you have:- A Pictory API key (get one here)
- Node.js or Python installed on your machine
- The required packages installed
Step-by-Step Guide
Step 1: Set Up Your Request
Prepare your API credentials and define the image prompt along with the desired model and style.Step 2: Submit the Image Generation Request
Send the request to the AI Studio image generation endpoint. On success, the API returns ajobId that you will use to poll for the result.
Step 3: Poll for the Result
Check the job status at regular intervals until the image is ready. The recommended polling interval is 10 to 30 seconds.Understanding the Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | A descriptive text of the image to generate. Must be between 5 and 5,000 characters. |
model | string | No | seedream3.0 | The AI model to use for generation. Supported values: seedream3.0, flux-schnell, nanobanana, nanobanana-pro. See Generate Image API for model capabilities and pricing. |
aspectRatio | string | No | First supported ratio of the selected model | The output aspect ratio. Valid values depend on the selected model (e.g., 1:1, 16:9, 9:16). |
style | string | No | — | Visual style to apply to the generated image. Supported values: photorealistic, artistic, cartoon, minimalist, vintage, futuristic. |
referenceImageUrl | string | No | — | A publicly accessible URL of a reference image to guide the generation. Must be a valid URI. |
webhook | string | No | — | A URL to receive a POST notification when the job completes. Must be a valid URI. |
Tips for Effective Prompts
- Be specific and descriptive. Include details about the subject, setting, lighting, and composition.
- Specify the camera angle. Use terms such as “wide shot”, “close-up”, or “aerial view” to control framing.
- Pair with a style. Combine your prompt with the
styleparameter for more consistent results. For example, use"photorealistic"for lifelike images or"artistic"for a painterly look. - Keep prompts focused. A single clear subject with a well-defined setting produces better results than a prompt that tries to describe too many elements at once.
Next Steps
- Generate Image from Reference Image to use an existing image as a visual guide
- Generate Image API Reference for the complete parameter documentation
