Spaces:
Sleeping
Sleeping
update visible
Browse files
app.py
CHANGED
@@ -188,27 +188,29 @@ def gradio_interface():
|
|
188 |
|
189 |
with gr.Tab("Prompt_Guided(ControlNet-SDXL)"):
|
190 |
with gr.Blocks():
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
208 |
submit_sd.click(
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
)
|
213 |
|
214 |
return app
|
|
|
188 |
|
189 |
with gr.Tab("Prompt_Guided(ControlNet-SDXL)"):
|
190 |
with gr.Blocks():
|
191 |
+
with gr.Row():
|
192 |
+
with gr.Column(scale=1):
|
193 |
+
sd_image = gr.Image(label="Upload a Color Image")
|
194 |
+
positive_prompt = gr.Textbox(label="Positive Prompt", placeholder="Text for positive prompt")
|
195 |
+
negative_prompt = gr.Textbox(
|
196 |
+
value="low quality, bad quality, low contrast, black and white, bw, monochrome, grainy, blurry, historical, restored, desaturate",
|
197 |
+
label="Negative Prompt", placeholder="Text for negative prompt"
|
198 |
+
)
|
199 |
+
generate_caption = gr.Checkbox(label="Generate Caption?", value=True)
|
200 |
+
seed = gr.Number(label="Seed", value=123, precision=0)
|
201 |
+
inference_steps = gr.Number(label="Inference Steps", value=5, precision=0)
|
202 |
+
submit_sd = gr.Button("Generate")
|
203 |
+
|
204 |
+
|
205 |
+
with gr.Column(scale=1):
|
206 |
+
sd_output_image = gr.Image(label="Colorized Image")
|
207 |
+
sd_caption = gr.Textbox(label="Captioning Result", show_copy_button=True, visible=True)
|
208 |
+
|
209 |
+
|
210 |
submit_sd.click(
|
211 |
+
fn=colorize_image_sdxl,
|
212 |
+
inputs=[sd_image, positive_prompt, negative_prompt, generate_caption, seed, inference_steps],
|
213 |
+
outputs=[sd_output_image, sd_caption]
|
214 |
)
|
215 |
|
216 |
return app
|