Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try AI for illustration generation #279

Open
Nodrex opened this issue Dec 7, 2022 · 2 comments
Open

Try AI for illustration generation #279

Nodrex opened this issue Dec 7, 2022 · 2 comments
Assignees
Labels
AI Artificial Intelligence enhancement New feature or request

Comments

@Nodrex
Copy link
Owner

Nodrex commented Dec 7, 2022

Try ChatGPT to generate illustrations for quiz categories
https://beta.openai.com/docs/guides/images/introduction

@Nodrex Nodrex added the enhancement New feature or request label Dec 7, 2022
@kdiakonidze
Copy link
Collaborator

  1. openai is not what we wont at this moment, it generates images using ai and quality is poor.
  2. unsplash.com has limitation 50 request in one hour. also search result is not setistaiting
  3. now researching https://www.flickr.com/ api

@Nodrex Nodrex added the AI Artificial Intelligence label Dec 23, 2022
@Nodrex
Copy link
Owner Author

Nodrex commented Dec 23, 2022

@kdiakonidze
https://openai.com/dall-e-2/
try also this, it is free and good as I know

OpenAI's DALL-E 2 is a machine learning model that generates images from textual descriptions. It is designed to be able to generate a wide range of images, from photorealistic to highly stylized, based on a given text prompt. DALL-E 2 is an updated version of the original DALL-E model, which was released in 2021.

Image

import com.openai.api.Client
import com.openai.api.DALLEE2Model
import com.openai.api.model.v1.ImageCompletionRequest
import com.openai.api.model.v1.ImageCompletionResponse

fun generateImage(prompt: String) {
    // Set the API key
    val apiKey = "<api-key>"

    // Set the model name and prompt
    val model = "image-alpha-001"
    val prompt = prompt

    // Create the OpenAI client
    val client = Client.builder(apiKey).build()

    // Create the request object
    val request = ImageCompletionRequest.builder()
        .model(model)
        .prompt(prompt)
        .build()

    // Send the request and get the response
    val response: ImageCompletionResponse = client.imageCompletions().create(request)

    // Print the response URL
    println(response.getData()[0].getUrl())

    // Close the client
    client.close()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Artificial Intelligence enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants