Spaces:
Runtime error
Runtime error
llinahosna
commited on
Commit
•
2f38d39
1
Parent(s):
de5bb4b
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def generate_cookie_image(prompt):
|
4 |
+
# Your AI model or logic to generate Cookie Run character images goes here
|
5 |
+
# For demonstration purposes, let's assume we have a function that generates an image.
|
6 |
+
# Replace this with your actual image generation code.
|
7 |
+
|
8 |
+
# Example: Generate a placeholder image (you can replace this with your own logic)
|
9 |
+
# Placeholder image dimensions: 128x128 pixels
|
10 |
+
image = np.zeros((128, 128, 3), dtype=np.uint8)
|
11 |
+
image.fill(255) # White background
|
12 |
+
|
13 |
+
return image
|
14 |
+
|
15 |
+
# Define the Gradio interface
|
16 |
+
inputs = gr.Textbox(label="Enter a prompt", lines=2)
|
17 |
+
outputs = gr.Image(type="numpy", width=128, height=128) # Display generated image
|
18 |
+
|
19 |
+
title = "Cookie Run Character Image Generator"
|
20 |
+
description = "Enter a prompt, and the AI will create a Cookie Run character image."
|
21 |
+
|
22 |
+
gr.Interface(fn=generate_cookie_image, inputs=inputs, outputs=outputs, title=title, description=description).launch(debug=True)
|