Skip to content

A wrapper Android library/aar that converts the given promt as string into an image

License

Notifications You must be signed in to change notification settings

zekierciyas/android-text-to-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Text to Image Library

A wrapper Android library/AAR that allows creating an image from a meaningful prompt text received from the user.

In its basic usage flow, the library takes a meaningful string as input and returns the ByteArray equivalent of the created image as output.

Test Records

Show tests
Screen.Recording.2024-01-31.at.01.43.41.mov
Screen.Recording.2024-01-31.at.01.28.38.mov
Screen.Recording.2024-01-31.at.01.41.33.mov
Screen.Recording.2024-01-31.at.01.36.54.mov

Gradle

Kotlin DSL
implementation ("com.github.zekierciyas:android-text-to-image:1.0.4")
Groovy DSL
implementation 'com.github.zekierciyas:android-text-to-image:1.0.4'

Library Usage

    TextToImage.instance().process(
        input = "Photo of a cat making cake",
        dispatcher = Dispatchers.IO,
        callback = object : TextToImage.TextToImageCallback {
            override fun onSuccess(byteArray: ByteArray) {
              //Process done
              //Convert ByteArray to Bitmap/ImageBitmap
            }

            override fun onError(error: Throwable) {
              //Error happened during process
            }
        }
    )