Flux Dev

futuristictechAIinnovation

Create futuristic and experimental designs with the Flux Dev style, perfect for tech and innovation themes.

Flux Dev

Table of content

API Documentation

Flux Dev

Generate dynamic, futuristic designs with a high-energy style. Ideal for conceptualizing sci-fi or cutting-edge environments.

Endpoint

The endpoint for Text to Image API is

POST https://api.vyro.ai/v2/image/generations

Headers

You need to pass the following headers along with the request.

NameTypeRequired/OptionalDescriptionExample
AuthorizationstringRequiredPass your API token as a Bearer token in the Authorization header.Bearer {{API_TOKEN}}

Request Body Parameters

Below are the parameters for multipart/form-data that allow for a high degree of customization when generating videos.

NameTypeRequiredDescriptionExample
promptstringRequiredThe main text description of the image. Use descriptive and detailed language for best results."A futuristic cityscape at night with neon lights"
styleenumRequiredSpecifies the style of the generated image. In this case, it'd be flux-dev"flux-dev"
aspect_ratioenumOptionalDefines the width-to-height ratio of the image. Supported values include "1:1", "16:9", "9:16"."1:1"
seednumberOptionalA random seed for generating the image. This can help in reproducing similar images."123456789"

Example API Call

Here’s a sample curl request that uses the parameters above:

curl --location --request POST 'https://api.vyro.ai/v2/image/generations' \ --header 'Authorization: Bearer {{API_TOKEN}}' \ --form 'prompt="A futuristic cityscape at night with neon lights"' \ --form 'style="flux-dev"' \ --form 'aspect_ratio="1:1"'

Response

Upon a successful request, the API returns a binary image file which can be directly rendered or saved.

<image-file>

Error Handling

This section provides an in-depth explanation of errors encountered while interacting with Imagine’s system. Errors are categorized to help you pinpoint issues and apply effective solutions.

Error Schema

In case of any error, the API will return a response in the following JSON format:

{ "status": "error", "code": "<error-code>", "error": "<error-name>", "message": "<detailed-error-description>" }

This structure ensures consistency in error handling and provides clear information for debugging and resolution.

Errors in the Imagine system are grouped into four main categories:

  • Authorization Errors
  • Validation Errors
  • Service Errors
  • General Errors

Each category is explored in detail below.

Authorization Errors

Authorization errors relate to user authentication and access privileges. Common errors include:

CodeStatusMessageDescription
1000BadRequest (400)The bearer token is missing from the header.Ensure you provide a valid bearer token.
1001Unauthorized (401)The bearer token passed is invalid.Verify your token and try again.
1002NotAcceptable (406)The bearer token has expired.Refresh your token or obtain a new one.
1003BadRequest (400)Error validating the captcha.Check the captcha input.
1004BadRequest (400)The captcha is required.Provide a captcha value.
1005Unauthorized (401)Application could not be validated.Verify application credentials.
1006Unauthorized (401)Device validation failed.Check device settings and permissions.
1007Unauthorized (401)Account could not be validated.Ensure account credentials are correct.

Validation Errors

Validation errors occur when submitted data does not meet criteria. Example:

CodeStatusMessageDescription
1100BadRequest (400)The request is invalid.May involve missing, incorrect, or non-existent style IDs.
1101PaymentRequired (402)Not enough tokens.Purchase a subscription or top-up tokens.

Service Errors

Service errors can arise due to server or connectivity issues:

CodeStatusMessageDescription
1200ServiceUnavailable (503)Service not available.Linked to SVI or reverse proxy failures.
1201ServiceUnavailable (503)Unable to connect to Redis.Check Redis service status.
1202TooManyRequests (429)Excessive requests.Consider rate-limiting strategies.
1203ServiceUnavailable (503)Database connection failed.Occurs during database querying issues.
1204GatewayTimeout (504)Request timed out.Retry the request.
1205InternalServiceError (500)Unexpected service response.May arise during response unmarshaling.
1206NotImplemented (503)Unsupported service.Service is unavailable.

General Errors

General errors are broad error categories covering multiple issues:

CodeStatusMessageDescription
1300InternalServerError (500)Internal server error.Causes vary. Inspect response details for clues.

If you face Service Error or General Errors, please reach out to Imagine Support as soon as possible.

Frequently asked questions

Have Questions? Let's Talk! 👋

We're here to help you make the most out of our APIs. Whether you need a custom plan, an enterprise solution, or just want to chat, we're all ears!

Contact Sales Team
Was this page helpful?