https://github.com/umairoye/ai-art-generator
The AI Art Generator App is an Android application that leverages the Stable Diffusion API to create unique artworks based on user-provided prompts. It follows the MVVM architecture pattern and uses Retrofit for API communication and Glide for efficient image loading.
https://github.com/umairoye/ai-art-generator
ai andriod artificial-intelligence glide kotlin mvvm mvvm-architecture retrofit2 stable-diffusion
Last synced: 3 months ago
JSON representation
The AI Art Generator App is an Android application that leverages the Stable Diffusion API to create unique artworks based on user-provided prompts. It follows the MVVM architecture pattern and uses Retrofit for API communication and Glide for efficient image loading.
- Host: GitHub
- URL: https://github.com/umairoye/ai-art-generator
- Owner: UmairOye
- Created: 2023-10-16T11:21:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T05:00:17.000Z (over 1 year ago)
- Last Synced: 2025-01-26T09:19:08.382Z (5 months ago)
- Topics: ai, andriod, artificial-intelligence, glide, kotlin, mvvm, mvvm-architecture, retrofit2, stable-diffusion
- Language: Kotlin
- Homepage:
- Size: 1.31 MB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI Art Generator App
## Table of Contents
- [About the Project](#about-the-project)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Making API Requests](#making-api-requests)
- [Loading Images](#loading-images)
- [Screenshots](#screenshots)## About the Project
The AI Art Generator App is an Android application that leverages the Stable Diffusion API to create unique artworks based on user-provided prompts. It follows the MVVM architecture pattern and uses Retrofit for API communication and Glide for efficient image loading.
## Getting Started
### Prerequisites
- Android Studio with Kotlin support
- Knowledge of MVVM architecture
- Retrofit and Glide dependencies added to your project### Installation
1. Clone the repository:
```bash
git clone https://github.com/UmairOye/AI-Art-Generator.git
cd AI-Art-Generator
2. Open the project in Android Studio.
3. Build and run the app on an emulator or physical device.## Usage
### Making API Requests```bash
val artApi: ArtApi by lazy {
Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(ArtApi::class.java)
}
interface ArtApi {
@POST("/api/v4/dreambooth")
fun makeApiRequest(@Body requestBody: DreamBoothRequest): Call
}
fun makeApiRequest(requestBody: DreamBoothRequest, onResponse: (ApiResponse?) -> Unit) {
val call = artApi.makeApiRequest(requestBody)
call.enqueue(object : Callback {
override fun onResponse(call: Call, response: Response) {
if(response.isSuccessful)
{
Log.d(TAG, "onResponse: ${response.body()!!.status}")
onResponse(response.body())
}else{
Log.d(TAG, "onResponse: not successful")
}
}
override fun onFailure(call: Call, t: Throwable) {
onResponse(ApiResponse(t.message.toString(), 0.0, 0, emptyList()))
}
})
}```
## Loading Images
Glide is used for efficient image loading. Here's an example of how to load an image into an ImageView:
```bash
Glide.with(this)
.load("https://example.com/image.jpg")
.into(imageView)
```
## Screenshots![]()
![]()
## Don't Forget to Star ⭐
If you found this project useful or had fun exploring it, please consider giving it a star. It's a great way to show your appreciation and it puts a smile on my face! 😊🌟