Cookierunaiart / app.py
Linahosnaparty's picture
Update app.py
2c920b1 verified
raw
history blame
866 Bytes
# Cookie Run AI Art Generator with Gradio
import gradio as gr
import requests
# Define the input text field
text_input = gr.inputs.Textbox(lines=2, label="Enter a description")
# Define the image output field
image_output = gr.outputs.Image(label="Generated Artwork")
# Function to generate AI artwork from input text
def generate_artwork(description):
# Call the Cookie Run AI art generator API
api_url = "https://pixai.art/model/1598647530435902029"
response = requests.post(api_url, json={"prompt": description})
image_url = response.json().get("image_url")
return image_url
# Create the Gradio interface
gr.Interface(
fn=generate_artwork,
inputs=text_input,
outputs=image_output,
title="Cookie Run AI Art Generator",
description="Enter a text description, and the AI will create Cookie Run-style artwork.",
).launch()