OctoAI Logo
Sign up
Log in
Sign up
Log in
Home
Models
Text to Image

Stable Diffusion API Endpoint

The world’s most popular image generation model, with an estimated 15+ Billion images generated, served via a fast and affordable developer API. Generate detailed images from text prompts. Also used for inpainting and outpainting.

You can run the world's fastest and cheapest Stable Diffusion API endpoint today in OctoAI.

Advice from ML Experts

Different samplers can give slightly different perceptual qualities to your images and can vary in the number of steps to create a good image. The "DPM" family of schedulers can get good images in 20 - 25 steps so can be used for quick iteration and prompt tuning. By saving the seed used to generate your initial images, you can always rerun the same job with a higher number of steps to get a more refined image.

Supported Model Variants:

Stable Diffusion 1.5

Stable Diffusion XL (SDXL)

SSD-1B

You can see the quality of the output below that was generated in under 3 seconds.

Use the endpoint URL and Python code to run OctoAI's fastest SDXL in your app.

import os
from octoai.clients.image_gen import Engine, ImageGenerator

if __name__ == "__main__":
    image_gen = ImageGenerator(token=os.environ.get("OCTOAI_TOKEN"))
    image_gen_response = image_gen.generate(
        engine=Engine.SDXL,
        prompt="A pug dog romping in a meadow of flowers on a sunny day",
        negative_prompt="Blurry photo, distortion, low-res, poor quality",
        width=1024,
        height=1024,
        num_images=1,
        sampler="DDIM",
        steps=30,
        cfg_scale=12,
        use_refiner=True,
        high_noise_frac=0.8,
        style_preset="base",
    )
    images = image_gen_response.images

    for i, image in enumerate(images):
        image.to_file(f"result{i}.jpg")

Fine-tuning included

Upload images to generate fine tuned stable diffusion weights using OctoAI’s LoRA fine-tuning service to align models to your brand or style.

Take your base models's creativity to infinity

Augment SD 1.5, and SDXL base models with customized LoRAs, VAEs, textual inversions, hypernetworks, refiners and Dreambooth checkpoints to unlock limitless creative styles and new aesthetic concepts.

Go beyond image generation

Mix and match variants of stable diffusion and image manipulation models such as ControNet, Segment Anything and CLIP to build sophisticated workflows to quickly achieve your creative goals.

Stable Diffusion on OctoAI features

FeaturesOctoAI

Load custom model weights via LoRAs, textual inversions, VAEs, etc

Yes via API

Mix and match image generation & enhancement models into workflows

Yes link to API

Time per SDXL image generated

0.6 sec for base model or 1.4 sec for custom checkpointed model

Time per SD1.5 image generated

3.8 sec for base model or 5.8 sec for custom checkpointed model

Stable Diffusion model history

Ver. 1.4

Original Stable diffusion general purpose model publicly released by Stability AI in August 2022. 

Ver. 1.5

Further trained Stable Diffusion model released in October 2022 from Runway ML. 

Ver. 2.0/2.1

Released in Nov 2022 with a new OpenCLIP text encoder and upgraded 768x768 pixel size with a built-in upscaler.

SDXL

Released in July 2023, a major upgrade capable of 1024x1024 pixel images with a significantly improved image quality, also capable of generating legible text within images.

Run time information

OctoAI brings you the fastest Stable Diffusion 1.5 and SDXL available today. Internal benchmarking for SDXL, shows consistently generated 1024x1024 pixel resolution 30-step images on SDXL 1.0 with a p95 time of 2.8 seconds.