Image Generation
Use these models to generate whatever images you can (or can't!) imagine.
Models available
Here's a table for the models available, and the parameters they support.
prompt
✓
✓
✓
negative_prompt
✓
width
✓
✓
✓
height
✓
✓
✓
num_steps
✓
✓
✓
guidance_scale
✓
✓
✓
seed
✓
input_image
✓
mask_image
✓
Parameters
Prompt: The prompt to guide the model's generation.
Negative Prompt: A prompt to guide the model away from generating certain content.
Width, Height: The resolution of the output image.
Steps: Number of inference steps that the model will take. A higher number of steps typically leads to better quality but costs more.
Guidance Scale: A high value encourages the model adhere closely to the prompt, but may result in a lower image quality.
Seed: A number to seed the generation. Using the same value ensures reproducibility.
Input Image: The image to use as a base for the generation. When using our API, this should be a base64 encoded image.
Mask Image: The mask to use for the generation. In other words, a mask to specify which areas of the image should be modified. White pixels in the mask are repainted (preserved from the input image) while black pixels are preserved. When using our API, this should be a base64 encoded image.
NOTE: For best results, ensure that the mask dimensions are the same as the image.NOTE: The Flux.1 Fill Dev model requires that the height and width are divisible by 16. If not, it will automatically resize the dimensions accordingly.
Text-to-Image models
Text-to-Image models generate an image based on the prompt input. We currently support:
StableDiffusion XL 1.0: Generates images by iteratively updating with noise, guided by a prompt.
Flux.1 schnell: Quickly generates images efficiently, based on the Flux model.
Image-to-Image models
Image-to-Image models generate images based on the input image and mask image in addition to the prompt. We currently support:
Flux.1 Fill Dev: Fills in missing parts of an image using a provided mask.
Using the Models
Through Our Website UI
Our website UI is the easiest and fastest way to use our endpoints.
Log in, and ensure you have enough credits.
Click on the "Serverless Endpoints" tab and select your model.
Choose your parameters, enter your prompt (and image + mask if applicable) and just press Enter!
NOTE: We support JPG, JPEG, PNG, and WebP image formats.
Through API Endpoint
This option is to use our API endpoint directly in your projects. Below are some code snippets to get you started!
Using cURL
Text-to-Image Model
Image-to-Image Model
where "input_image"
and "mask_image"
are base64 encoded images.
Using Python
Text-to-Image Model
Image-to-Image Model
Using JavaScript
Text-to-Image Model
Image-to-Image Model
Selecting a Model
To specify the desired model, use this mapping for the model_name
:
StableDiffusion XL 1.0:
stabilityai/stable-diffusion-xl-base-1.0
Flux.1 schnell:
black-forest-labs/FLUX.1-schnell
Flux.1 Fill Dev:
black-forest-labs/FLUX.1-Fill-dev
Response Example
A successful response body will return the image in this format:
NOTE: You'll need to use an image b64 decoder to view the result. Just pass in the b64_json value to the decoder of your choice.
Last updated