Pricing per million tokens, context window, capabilities — pulled from each provider's public docs. All 2 are available via the same AIgateway OpenAI-compatible endpoint; flip the model string to switch.
Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images. Img2img generate a new image from an input image with Stable Diffusion.
Diffusion-based text-to-image generative model by Stability AI. Generates and modify images based on text prompts.
from openai import OpenAI
client = OpenAI(
base_url="https://api.aigateway.sh/v1",
api_key="sk-aig-...",
)
# Stable-Diffusion-V1-5-Img2img
client.chat.completions.create(
model="runwayml/stable-diffusion-v1-5-img2img",
messages=[{"role":"user","content":"hello"}],
)
# Stable-Diffusion-XL-Base-1.0
client.chat.completions.create(
model="stabilityai/stable-diffusion-xl-base-1.0",
messages=[{"role":"user","content":"hello"}],
)