Spaces:
Running
Running
Commit
·
8d5132b
1
Parent(s):
2845f78
Update app.py
Browse files
app.py
CHANGED
@@ -87,34 +87,24 @@ css = """
|
|
87 |
}
|
88 |
|
89 |
/* Button Styles */
|
90 |
-
.gradio-button {
|
91 |
color: #fff;
|
92 |
background-color: #2563eb;
|
93 |
border-color: #1d4ed8;
|
94 |
-
cursor: pointer;
|
95 |
-
padding: 0.375rem 0.75rem;
|
96 |
-
font-size: 0.875rem;
|
97 |
-
line-height: 1.5;
|
98 |
-
border-radius: 0.25rem;
|
99 |
-
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
100 |
-
box-shadow 0.15s ease-in-out;
|
101 |
}
|
102 |
|
103 |
-
.gradio-button:hover {
|
104 |
background-color: #1d4ed8;
|
105 |
border-color: #1d4ed8;
|
106 |
}
|
107 |
|
108 |
-
|
|
|
109 |
border-color: #a0aec0;
|
110 |
-
padding:
|
111 |
-
font-size: 0.875rem;
|
112 |
-
line-height: 1.5;
|
113 |
-
border-radius: 0.25rem;
|
114 |
-
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
115 |
}
|
116 |
|
117 |
-
.gradio-
|
118 |
border-color: #2563eb;
|
119 |
box-shadow: 0 0 0 2px rgba(37,99,235,.25);
|
120 |
}
|
@@ -132,22 +122,21 @@ def generate_txt2img(current_model, text_prompt, negative_prompt, image_style):
|
|
132 |
# Your generation code here
|
133 |
pass
|
134 |
|
135 |
-
favicon = '<img src="" width="48px" style="display: inline">'
|
136 |
current_model = gr.inputs.Dropdown(label="Current Model", choices=list_models, default=list_models[1])
|
137 |
text_prompt = gr.inputs.Textbox(label="Prompt", placeholder="Enter a prompt", lines=1)
|
138 |
negative_prompt = gr.inputs.Textbox(label="Negative Prompt", value="text, blurry, fuzziness", lines=1)
|
139 |
image_style = gr.inputs.Dropdown(label="Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], default="None style")
|
140 |
-
|
141 |
|
142 |
image_output = gr.outputs.Image(label="Generated Image")
|
143 |
|
144 |
interface = gr.Interface(
|
145 |
fn=generate_txt2img,
|
146 |
-
inputs=[current_model, text_prompt, negative_prompt, image_style],
|
147 |
outputs=image_output,
|
148 |
layout="vertical",
|
149 |
css=css,
|
150 |
-
title=
|
151 |
)
|
152 |
|
153 |
interface.launch()
|
|
|
87 |
}
|
88 |
|
89 |
/* Button Styles */
|
90 |
+
.gradio-button-primary {
|
91 |
color: #fff;
|
92 |
background-color: #2563eb;
|
93 |
border-color: #1d4ed8;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
+
.gradio-button-primary:hover {
|
97 |
background-color: #1d4ed8;
|
98 |
border-color: #1d4ed8;
|
99 |
}
|
100 |
|
101 |
+
/* Input Styles */
|
102 |
+
.gradio-textbox {
|
103 |
border-color: #a0aec0;
|
104 |
+
padding: 9px 12px;
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
|
107 |
+
.gradio-textbox:focus {
|
108 |
border-color: #2563eb;
|
109 |
box-shadow: 0 0 0 2px rgba(37,99,235,.25);
|
110 |
}
|
|
|
122 |
# Your generation code here
|
123 |
pass
|
124 |
|
|
|
125 |
current_model = gr.inputs.Dropdown(label="Current Model", choices=list_models, default=list_models[1])
|
126 |
text_prompt = gr.inputs.Textbox(label="Prompt", placeholder="Enter a prompt", lines=1)
|
127 |
negative_prompt = gr.inputs.Textbox(label="Negative Prompt", value="text, blurry, fuzziness", lines=1)
|
128 |
image_style = gr.inputs.Dropdown(label="Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], default="None style")
|
129 |
+
generate_button = gr.outputs.Button(label="Generate", type="button")
|
130 |
|
131 |
image_output = gr.outputs.Image(label="Generated Image")
|
132 |
|
133 |
interface = gr.Interface(
|
134 |
fn=generate_txt2img,
|
135 |
+
inputs=[current_model, text_prompt, negative_prompt, image_style, generate_button],
|
136 |
outputs=image_output,
|
137 |
layout="vertical",
|
138 |
css=css,
|
139 |
+
title="AI Diffusion"
|
140 |
)
|
141 |
|
142 |
interface.launch()
|