Overview
A modern, type-safe Python SDK for NovelAI's image generation API.

A modern, type-safe Python SDK for NovelAI's image generation API. Designed for Developer Experience (DX) with full Pydantic v2 validation and complete type hints.
Key Features
- Type Safety: Python 3.10+ support, robust validation with Pydantic v2.
- High-Level API: Intuitive and easy-to-use interface.
- Modern Features: Support for V4 models, Precise Reference (Character Reference), ControlNet, etc.
- Utilities: Built-in PIL/Pillow integration, SSE streaming.
Comparison with Alternatives
| Feature | novelai-sdk | novelai-api | novelai-python |
|---|---|---|---|
| Type Safety (Pydantic v2) | ✅ | ❌ | ✅ |
| Async Support | ✅ | ✅ | ✅ |
| Image Generation | ✅ | ✅ | ✅ |
| Text Generation | 🚧 | ✅ | ✅ |
| Precise Reference | ✅ | ❌ | ❌ |
| Multi-Character Positioning | ✅ | ❌ | ✅ |
| ControlNet / Vibe Transfer | ✅ | ❌ | ✅ |
| SSE Streaming | ✅ | ❌ | ✅ |
| Python 3.10+ | ✅ | ❌ | ❌ |
| Active Maintenance | ✅ | ✅ | ⚠️ |
✅ Supported · ❌ Not supported · 🚧 Planned · ⚠️ Limited maintenance
Data Model Architecture
The library is designed with two distinct layers of data models:

- User Model (Recommended): User-friendly models with sensible defaults and automatic validation.
- API Model: Direct 1:1 mapping to NovelAI's API endpoints, primarily used internally.
Where to Start?
Getting Started
From installation to your first generation.
Authentication
How to set up your API key.
Examples
Character references, poses, streaming.
Links
Disclaimer
This is an unofficial client library. Not affiliated with NovelAI. Requires an active NovelAI subscription.