Skip to main content

Overview

The ModelsLab Python SDK provides a simple, type-safe interface to interact with all ModelsLab APIs. It handles authentication, request formatting, and response parsing automatically.

PyPI Package

View on PyPI

GitHub

Source code and issues

Installation

Requires Python 3.7 or higher.

Quick Start

Here’s a complete example to generate your first image:

Client Configuration

Basic Setup

Enterprise Setup

Available APIs

  • Realtime - Fast image generation with FLUX and other models
  • Community - Access community fine-tuned models
  • Image_editing - Edit, enhance, and transform images
  • Video - Generate videos from text or images
  • Audio - Text-to-speech, voice cloning, music generation
  • Interior - Interior design and room transformation
  • Three_D - Generate 3D models from text or images

Image Generation

Text to Image (Realtime)

Generate images from text prompts using the fastest models:

Image to Image (Realtime)

Transform existing images with a text prompt:

Community Models

Use fine-tuned community models for specific styles:

Image Editing

Background Removal

Super Resolution (Upscale)

Object Removal

Outpainting (Extend Images)

AI Headshots

Face Generation

Fashion / Virtual Try-On


Video Generation

Text to Video

Image to Video

Animate a static image:

Audio Generation

Text to Speech

Voice Cloning (Voice to Voice)

Music Generation

Song Generation

Lyrics Generation

Sound Effects (SFX)

Speech to Text


Interior Design

Interior Redesign

Room Decorator

Exterior Restoration

Floor Planning


3D Model Generation

Text to 3D

Image to 3D


Working with Base64 Images

For local images, convert them to base64:

Error Handling

Always handle potential errors in production code:

Async Processing Pattern

For long-running operations (videos, training), poll for results:

Next Steps

API Reference

Explore all API endpoints

Models

Browse available models

Webhooks

Set up async notifications

Error Codes

Handle errors properly