Generate Photos
Skytells provides powerful AI models for generating high-quality photos from text descriptions or existing images. This guide explains how to use our photo generation APIs to create visually stunning images for your applications.
The Photo Generation Process
Photo generation with Skytells follows a straightforward process: provide a prompt or input image, select a model, customize generation parameters, and receive your generated photos. Let's explore each step in detail.
Supported Models
For a complete list of models, versions, and capabilities, see our Models Reference.
Generate Photo
The simplest way to generate a photo is by providing a text prompt to our TrueFusion model.
Text to Photo
To generate a photo from text, you need to provide a detailed prompt describing what you want to see in the image. The more specific your prompt, the better the results will be.
Required Parameters
- Name
model
- Type
- string
- Description
The name of the model to use for generation (e.g., "truefusion").
- Name
input.prompt
- Type
- string
- Description
A detailed text description of the image you want to generate.
Optional Parameters
- Name
safety_check
- Type
- boolean
- Description
Whether to perform safety checks on the generated image. Default is
true
.
- Name
width
- Type
- integer
- Description
The width of the generated image in pixels. Default varies by model.
- Name
height
- Type
- integer
- Description
The height of the generated image in pixels. Default varies by model.
- Name
num_outputs
- Type
- integer
- Description
The number of images to generate. Default is
1
.
- Name
await
- Type
- boolean
- Description
When set to
true
, the API will wait for the prediction to complete before returning a response, making it a synchronous operation. Default isfalse
.
- Name
webhook
- Type
- object
- Description
Configuration for webhook notifications. See Webhook Integration below.
Request
curl -X POST "https://api.skytells.ai/v1/predict" \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"model": "truefusion",
"safety_check": true,
"input": {
"prompt": "A beautiful sunset over a calm ocean with silhouette of palm trees"
}
}'
Response
{
"id": "pred_abc123def456",
"status": "processing",
"created_at": "2023-06-21T14:22:35.625Z",
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean with silhouette of palm trees"
},
"logs": "Starting image generation process...",
"error": null,
"output": null
}
Advanced Photo Prediction
Image-to-Image Generation
You can also generate photos based on existing images. This is useful for style transfer, variations, or guided image generation.
Required Parameters
- Name
model
- Type
- string
- Description
The name of the model to use for generation (e.g., "truefusion").
- Name
input.image
- Type
- string
- Description
Base64-encoded image or a URL to an existing image.
Optional Parameters
- Name
input.prompt
- Type
- string
- Description
Additional text guidance to influence the generated image.
- Name
strength
- Type
- float
- Description
How much to transform the reference image, from 0.0 to 1.0. Default is
0.7
.
- Name
await
- Type
- boolean
- Description
When set to
true
, the API will wait for the prediction to complete before returning a response. Default isfalse
.
Request
curl -X POST "https://api.skytells.ai/v1/predict" \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"model": "truefusion",
"input": {
"image": "https://example.com/path/to/image.jpg",
"prompt": "Convert to oil painting style"
},
"strength": 0.7
}'
Synchronous vs. Asynchronous Generation
By default, photo generation operations are asynchronous, meaning they immediately return a prediction object with status "processing" and you need to poll for results. You can use the await
parameter to make requests synchronous.
Using the await
Parameter
When you set await: true
in your request, the API will not return until the image generation is complete. This simplifies your code but may lead to longer request times.
Synchronous requests are subject to timeout limits. For generations that may take longer than 60 seconds, we recommend using asynchronous requests with polling or webhooks.
Request
curl -X POST "https://api.skytells.ai/v1/predict" \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean"
},
"await": true
}'
Response (Complete)
{
"id": "pred_abc123def456",
"status": "succeeded",
"created_at": "2023-06-21T14:22:35.625Z",
"completed_at": "2023-06-21T14:23:12.419Z",
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean"
},
"logs": "Generation completed successfully.",
"error": null,
"output": [
"https://storage.skytells.ai/generations/images/abcd1234.png"
]
}
Fetch Prediction
Photo generation is an asynchronous process. After initiating a generation request, you'll need to check its status to retrieve the final results.
Required Parameters
- Name
id
- Type
- string
- Description
The prediction ID returned from the initial request.
Request
curl -X GET "https://api.skytells.ai/v1/predictions/pred_abc123def456" \
-H "x-api-key: your-api-key-here"
Response for completed generation
{
"id": "pred_abc123def456",
"status": "succeeded",
"created_at": "2023-06-21T14:22:35.625Z",
"completed_at": "2023-06-21T14:23:12.419Z",
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean with silhouette of palm trees"
},
"logs": "Generation completed successfully.",
"error": null,
"output": [
"https://storage.skytells.ai/generations/images/abcd1234.png"
]
}
Webhook Integration
Instead of polling for results, you can specify a webhook to receive notifications when your prediction changes status. This is especially useful for longer-running generations.
Setting Up Webhooks
To use webhooks, provide a webhook
object in your prediction request with the following properties:
- Name
webhook.url
- Type
- string
- Description
The URL to receive webhook POST requests.
- Name
webhook.events
- Type
- array
- Description
Array of event types to trigger webhooks. Available events include: "prediction.completed", "prediction.failed", "prediction.processing".
- Name
webhook.auth_header
- Type
- string
- Description
Optional custom authentication header to include in webhook requests.
- Name
webhook.auth_token
- Type
- string
- Description
Optional token value for the custom authentication header.
Verification
Each webhook includes a Skytells-Signature
header that you can use to verify the request came from Skytells. See our Webhook Security Guide for details.
Request with Webhook
curl -X POST "https://api.skytells.ai/v1/predict" \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean"
},
"webhook": {
"url": "https://your-app.com/webhooks/skytells",
"events": ["prediction.completed", "prediction.failed"],
"auth_header": "X-Custom-Auth",
"auth_token": "your-secret-token"
}
}'
Webhook Payload
{
"id": "pred_abc123def456",
"status": "succeeded",
"created_at": "2023-06-21T14:22:35.625Z",
"completed_at": "2023-06-21T14:23:12.419Z",
"model": "truefusion",
"input": {
"prompt": "A beautiful sunset over a calm ocean"
},
"logs": "Generation completed successfully.",
"error": null,
"output": [
"https://storage.skytells.ai/generations/images/abcd1234.png"
],
"webhook_event_type": "prediction.completed"
}
Prediction Schema
All prediction operations return objects that conform to our prediction schema.
Understanding this schema helps you process results consistently.
For a detailed reference of the prediction schema, see our Prediction Schema.
Best Practices for Photo Generation
Crafting effective prompts is key to getting the best results from our photo generation models. Here are some tips to help you get the most out of your generations.
Writing Effective Prompts
- Be specific: Include details about composition, style, lighting, and subject matter
- Use descriptive language: Adjectives help define the aesthetic quality
- Specify art styles: Reference specific art styles or artists for stylistic guidance
- Include composition details: Mention perspective, framing, and focal points
- Avoid negatives: Instead of saying what you don't want, focus on what you do want
Example Prompts
A detailed portrait of a female astronaut with helmet reflections of space, digital art style, dramatic lighting, detailed features, 8k resolution, professional photography, high-end
Rate Limits and Quotas
Photo generation operations consume API credits based on the model used, resolution, and other parameters. Please refer to our billing documentation for detailed information about pricing and quotas.
Standard Rate Limits
- Name
Requests per minute
- Type
- integer
- Description
60 requests per minute per API key
- Name
Concurrent generations
- Type
- integer
- Description
10 concurrent generations per API key
- Name
Maximum resolution
- Type
- string
- Description
2048×2048 pixels (higher available on enterprise plans)
Response
{
"error": {
"message": "Rate limit exceeded. Please retry after 18 seconds.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
Next Steps
Now that you understand how to generate photos using Skytells API, you can explore more advanced features: