Developer Dashboard

Stability AI Image Models (Deprecated) ​

Stability AI image-generation model IDs are no longer listed in data/models.json, so do not use the older stability.* examples for new AvalAI integrations. This page remains only to help developers migrate old bookmarks and code snippets.

What to Use Instead ​

  • GPT Image: Use gpt-image-2 for high-quality generation, editing, text rendering, compositing, and mask-based edits through v1/images/generations and v1/images/edits.
  • FLUX: Use flux.2-pro, flux-1.1-pro, or flux.1-kontext-pro for Black Forest Labs image workflows.
  • Qwen Image: Use qwen-image-2.0-pro, qwen-image-2.0, qwen-image, qwen-image-edit-plus, or qwen-image-edit for typography-heavy and multilingual image workflows.
  • Google Images: Use the Nano Banana family — gemini-3.1-flash-image, gemini-3-pro-image, or gemini-3.1-flash-lite-image — where those routes fit your workload. All imagen-* models are deprecated and removed.
  • Seedream: Use seedream-5-0-260128 or seedream-4-5-251128 for ByteDance/BytePlus image generation and editing.

Migration Example ​

python
import base64
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
)

response = client.images.generate(
    model="gpt-image-2",
    prompt="A photorealistic mountain landscape with a lake reflecting the sunset",
    size="1024x1024",
    quality="medium",
)

with open("mountain.png", "wb") as image_file:
    image_file.write(base64.b64decode(response.data[0].b64_json))
javascript
import fs from "fs";
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AVALAI_API_KEY,
  baseURL: "https://api.avalai.ir/v1",
});

const response = await client.images.generate({
  model: "gpt-image-2",
  prompt: "A photorealistic mountain landscape with a lake reflecting the sunset",
  size: "1024x1024",
  quality: "medium",
});

fs.writeFileSync(
  "mountain.png",
  Buffer.from(response.data[0].b64_json, "base64")
);

For model availability, always check data/models.json through the Models API or the model browser.