Git Product home page Git Product logo

umairoye / ai-art-generator Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 1.0 1.35 MB

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.

Kotlin 100.00%
ai andriod artificial-intelligence glide kotlin mvvm mvvm-architecture retrofit2 stable-diffusion

ai-art-generator's Introduction

AI Art Generator App

Image

Table of Contents

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:

    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

    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<ApiResponse>
  }
  
   fun makeApiRequest(requestBody: DreamBoothRequest, onResponse: (ApiResponse?) -> Unit) {
          val call = artApi.makeApiRequest(requestBody)
          call.enqueue(object : Callback<ApiResponse> {
              override fun onResponse(call: Call<ApiResponse>, response: Response<ApiResponse>) {
                  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<ApiResponse>, 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:

Glide.with(this)
    .load("https://example.com/image.jpg")
    .into(imageView)

Screenshots

Image Image Image

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! ๐Ÿ˜Š๐ŸŒŸ

ai-art-generator's People

Contributors

umairoye avatar

Stargazers

Ryan avatar  avatar  avatar DHAKE VAIBHAV NITIN avatar Itsfitts avatar  avatar  avatar โญ ๐Ÿพ avatar Bocchi avatar Afzal Khan avatar Cypherpunk Samurai avatar ZeHuaJun avatar

Watchers

 avatar  avatar

Forkers

vaginessa

ai-art-generator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.