Stable Diffusion Free

A simple Flutter package for generating AI images using Stable Diffusion. Just provide a text prompt and get an image! Free to use with a limit of 5 requests per minute.

Developed by Mirshad

Example Generated Image Example image generated using the reproduction model

Features

  • 🎨 Generate images from text descriptions
  • 🤖 8 different AI models to choose from
  • 📱 Simple Flutter-friendly API
  • 🖼️ Example app included

Quick Start

  1. Add to pubspec.yaml:
dependencies:
  stable_diffusion_free: ^0.0.1
  1. Generate an image with just a few lines:
import 'package:stable_diffusion_free/stable_diffusion_free.dart';

// Create the client
final client = StableDiffusionClient();

// Generate an image!
try {
  final imageUrl = await client.generateImage(
    prompt: 'A beautiful sunset over mountains',
  );
  print('Your image is ready at: $imageUrl');
} finally {
  client.dispose();
}

Available Models

Use the StableDiffusionModel enum to choose a model:

// Choose any of these models:
StableDiffusionModel.realvisXL       // Realistic Vision XL v4
StableDiffusionModel.juggernautXL    // Juggernaut XL v10
StableDiffusionModel.reproduction    // Reproduction v3.31 (Default)
StableDiffusionModel.realCartoonXL   // Real Cartoon XL v6
StableDiffusionModel.nijiStyleXL     // SDVN7 Niji Style XL v1
StableDiffusionModel.counterfeitXL   // Counterfeit XL v2.5
StableDiffusionModel.animagineXL     // Animagine XL v3.1
StableDiffusionModel.stableDiffusionXL // Stable Diffusion XL v1.0

// Example:
final imageUrl = await client.generateImage(
  prompt: 'A futuristic city at night',
  model: StableDiffusionModel.realvisXL,
);

Progress Updates

The generateImage function prints progress updates:

🎨 Starting image generation...
📝 Prompt: A beautiful sunset over mountains
🤖 Model: reproduction
✨ Generation started (Job ID: 1755580224038)
⏳ Checking generation status...
✅ Image generated successfully!
🔗 Image URL: https://images.immagic.ai/example.jpeg

Example App

A complete example app is included showing how to:

  • Create a simple image generation interface
  • Select different AI models
  • Display the generated image
  • Handle loading states and errors

To run the example:

  1. Clone the repository
  2. Navigate to the example directory
  3. Run flutter pub get
  4. Run flutter run

Note

  • Free usage is limited to 5 requests per minute
  • Each generation typically takes 20-30 seconds
  • Generated images are available for 24 hours

Developer

Created by Mirshad

License

MIT License - see the LICENSE file for details.