Get Started
Generating Images from Text
How to Generate Images using the sunra API
To create images with the sunra API, send a request to the specified endpoint including your input parameters. The API leverages pre-trained models to generate images based on text prompts, enabling you to produce visuals by describing them in natural language.
Here’s an example of generating an image from text using the sunra API:
How to Select the Model
sunra provides various image generation models. Choose one that suits your needs based on desired style and quality.
Available models include:
- black-forest-labs/flux-kontext-pro: A unified model delivering local editing, generative modifications, and text-to-image generation in FLUX.1 quality. Processes text and image inputs for precise regional edits or full scene transformations at breakthrough speeds, pioneering iterative workflows that maintain character consistency across multiple editing turns.
- black-forest-labs/flux-1.1-pro: The best of FLUX, offering state-of-the-art performance image generation at blazing speeds with top of the line prompt following, visual quality, image detail, and output diversity.
- google-deepmind/imagen4: Imagen 4 generates photorealistic 2K images with fine detail, accurate text, and multilingual prompt support.
To select a model, specify its ID in the subscribe method as shown. Explore more models on the Text to Image Models page.