Text To Image | Image To Image |
---|---|
Save Locally | Dark / Light Mode |
---|---|
Expand to see supported styles
Style | Sample | Style | Sample |
---|---|---|---|
Anime | Origami | ||
3D Model | Line Art | ||
Photographic | Analog Film | ||
Comic Book | Cinematic | ||
Pixel Art | Isometric | ||
Neon Punk | Low Poly | ||
Fantasy Art | Tile Texture | ||
Digital Art |
This project using the Stability AI API for constructing RESTful API. Stability AI provides a RESTful API interface to highly detailed objects built from thousands of lines of data related to text to images.
-
Step 1: Create an account and generate an API key at Stability AI
-
Step 2: Paste the API key to your project
gradle.properties
file:
STABLE_DIFFUSION_API_KEY=YOUR_API_KEY_HERE
- Step 3: Sync project and run your app
Select composeApp
configuration and run the project.
Select iOSApp
configuration and run the project.
- Kotlin based, Coroutines + Flow for asynchronous.
- Composable Multiplatform for building common UI. It simplifies and accelerates UI development on Android, iOS and Desktop.
- Koin for dependency injection.
- Moko Resources for multiplatform string and images resources.
- Ktor & Kotlin Serialization for constructing the REST APIs and paging network data.
- SqlDelight for local database.
- Voyager for navigation and screen models.
├── composeApp
│ ├── androidMain
│ ├── commonMain
│ │ ├── kotlin/com/vproject/stablediffusion
│ │ │ ├── database
│ │ │ │ ├── dao <––– Data Access Object (DAOs)
│ │ │ │ └── ...
│ │ │ ├── di <––– Koin Depedenency Injection package
│ │ │ ├── model
│ │ │ ├── network
│ │ │ │ ├── StableDiffusionApi.kt <––– RESTFul APIs
│ │ │ │ └── ...
│ │ │ ├── presentation
│ │ │ │ ├── component
│ │ │ │ ├── screen
│ │ │ │ │ ├── generate <––– Generate Screen package
│ │ │ │ │ │ ├── GenerateScreen.kt <––– Composable Generate Screen UIs
│ │ │ │ │ │ ├── GenerateModel.kt <––– Generate Screen View Model
│ │ │ │ │ │ └── GenerateUiState.kt <––– Generate Sealed class UI State
│ │ │ │ │ └── ...
│ │ │ ├── repository
│ │ │ │ ├── ImageRepository.kt <––– Image repository to send requests
│ │ │ │ └── ...
│ │ │ └── util
│ │ ├── resources <––– Moko Resources to store local images and strings
│ │ └── sqldelight/com/vproject/stablediffusion <––– Local database entities
│ ├── desktopMain
│ └── iosMain
└── ...
Go to the Releases to download the latest APK version.
KMP-Stable-Diffusion is distributed under the terms of the Apache License (Version 2.0). See the license for more information.