Hev832 commited on
Commit
0852a2d
·
verified ·
1 Parent(s): 0a85933

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def band():
4
+ # Load the model
5
+ model = gr.load("models/alvdansen/BandW-Manga")
6
+
7
+ # Define the function to generate images
8
+ def generate_image(prompt):
9
+ # Use the model to generate an image from the prompt
10
+ return model(prompt)
11
+
12
+ # Create the Gradio interface
13
+ with gr.Blocks() as demo:
14
+ # Title and description
15
+ gr.Markdown("# BandW-Manga")
16
+ gr.Markdown(f"spaces version of BandW-Manga by [alvdansen](https://huggingface.co/alvdansen/BandW-Manga).")
17
+
18
+ # Input and output components
19
+ with gr.Row():
20
+ with gr.Column():
21
+ prompt = gr.Textbox(label="Prompt", placeholder="Enter your text prompt here...")
22
+ generate_button = gr.Button("Generate")
23
+ with gr.Column():
24
+ output_image = gr.Image(label="Generated Image")
25
+
26
+ # Define the interactions
27
+ generate_button.click(fn=generate_image, inputs=prompt, outputs=output_image)
28
+
29
+ return demo
30
+
31
+ # Launch the interface
32
+ band().launch()