AI Text-to-Image API
This API endpoint allows you to generate images using the Stable JustPump AI Text-to-Image model. The service accepts text prompts and returns generated images.
API Endpoint
Request Format
Headers
Content-Type
application/json
Yes
Request Body
prompt
string
Yes
Text description of the image you want to generate
Response Format
Success Response
On success, the API returns a PNG image with the following headers:
The response body contains the binary image data.
Error Responses
Invalid Method (405)
Missing Prompt (400)
Server Error (500)
CORS Support
The API supports Cross-Origin Resource Sharing (CORS) with the following configurations:
Allowed Origins:
*
(all origins)Allowed Methods:
POST, OPTIONS
Allowed Headers:
Content-Type
Max Age: 86400 seconds (24 hours)
Error Handling
The API implements robust error handling for various scenarios:
Invalid HTTP methods
Missing or invalid request body
Missing prompt parameter
Model generation failures
Server-side errors
Best Practices
Prompts
Be specific and detailed in your prompts
Include style descriptions if needed
Keep prompts clear and concise
Error Handling
Always implement proper error handling
Check response status codes
Handle binary image data appropriately
Performance
Consider implementing caching for repeated prompts
Be mindful of request frequency
Handle timeouts gracefully
Limitations
Maximum request body size may be limited
Generation time may vary based on prompt complexity
Support
For API support or to report issues, please contact the development team or create an issue in the repository.
Last updated