Spaces:
Sleeping
Sleeping
add examples
Browse files
app.py
CHANGED
@@ -45,21 +45,46 @@ def generate_image(prompt, model, num_iterations, learning_rate, progress = gr.P
|
|
45 |
return None, f"An error occurred: {str(e)}"
|
46 |
|
47 |
# Create Gradio interface
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
gr.
|
54 |
-
gr.
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
# Launch the app
|
65 |
-
|
|
|
45 |
return None, f"An error occurred: {str(e)}"
|
46 |
|
47 |
# Create Gradio interface
|
48 |
+
title="# ReNO Image Generation",
|
49 |
+
description="Enter a prompt to generate an image using ReNO. Adjust the model and parameters as needed."
|
50 |
+
|
51 |
+
with gr.Blocks() as demo:
|
52 |
+
with gr.Column():
|
53 |
+
gr.Markdown(title)
|
54 |
+
gr.Markdown(description)
|
55 |
+
|
56 |
+
with gr.Row():
|
57 |
+
with gr.Column():
|
58 |
+
prompt = gr.Textbox(label="Prompt")
|
59 |
+
chosen_model = gr.Dropdown(["sd-turbo", "sdxl-turbo", "pixart", "hyper-sd"], label="Model")
|
60 |
+
|
61 |
+
with gr.Row():
|
62 |
+
n_iter = gr.Slider(minimum=10, maximum=100, step=10, value=50, label="Number of Iterations")
|
63 |
+
learning_rate = gr.Slider(minimum=0.1, maximum=10.0, step=0.1, value=5.0, label="Learning Rate")
|
64 |
+
|
65 |
+
submit_btn = gr.Button("Submit")
|
66 |
+
|
67 |
+
gr.Examples(
|
68 |
+
examples = [
|
69 |
+
"A minimalist logo design of a reindeer, fully rendered. The reindeer features distinct, complete shapes using bold and flat colors. The design emphasizes simplicity and clarity, suitable for logo use with a sharp outline and white background.",
|
70 |
+
"A blue scooter is parked near a curb in front of a green vintage car",
|
71 |
+
"A impressionistic oil painting: a lone figure walking on a misty beach, a weathered lighthouse on a cliff, seagulls above crashing waves",
|
72 |
+
"A bird with 8 legs",
|
73 |
+
"An orange chair to the right of a black airplane",
|
74 |
+
"A pink elephant and a grey cow",
|
75 |
+
],
|
76 |
+
inputs = [prompt]
|
77 |
+
)
|
78 |
+
|
79 |
+
with gr.Column():
|
80 |
+
output_image = gr.Image(type="filepath", label="Generated Image")
|
81 |
+
status = gr.Textbox(label="Status")
|
82 |
+
|
83 |
+
submit_btn.click(
|
84 |
+
fn = generate_image,
|
85 |
+
inputs = [prompt, chosen_model, n_iter, learning_rate],
|
86 |
+
outputs = [output_image, status]
|
87 |
+
)
|
88 |
|
89 |
# Launch the app
|
90 |
+
demo.queue().launch(show_error=True)
|