Spaces:
Runtime error
Runtime error
Add demo app
Browse files
app.py
CHANGED
@@ -1,7 +1,36 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
title = "Character aware stable difusion"
|
3 |
+
description = "This is a demo o a character aware diffusion model"
|
4 |
+
def infer_sd(prompt, negative_prompt, image):
|
5 |
+
# your inference function for stable diffusion control
|
6 |
+
return im
|
7 |
|
8 |
+
def infer_charr_sd(prompt, negative_prompt, image):
|
9 |
+
# your inference function for charr stable difusion control
|
10 |
+
return im
|
11 |
|
12 |
+
with gr.Blocks(theme='gradio/soft') as demo:
|
13 |
+
gr.Markdown("## Character aware stable difusion")
|
14 |
+
|
15 |
+
with gr.Tab("Character Aware Stable Difusion "):
|
16 |
+
prompt_input_charr = gr.Textbox(label="Prompt")
|
17 |
+
negative_prompt_charr = gr.Textbox(label="Negative Prompt")
|
18 |
+
charr_input = gr.Image(label="Input Image")
|
19 |
+
charr_output = gr.Image(label="Output Image")
|
20 |
+
submit_btn = gr.Button(value = "Submit")
|
21 |
+
charr_inputs = [prompt_input_charr, negative_prompt_charr, charr_input]
|
22 |
+
submit_btn.click(fn=infer_charr_sd, inputs=charr_inputs, outputs=[charr_output])
|
23 |
+
|
24 |
+
with gr.Tab("Stable Diffusion"):
|
25 |
+
prompt_input_seg = gr.Textbox(label="Prompt")
|
26 |
+
negative_prompt_seg = gr.Textbox(label="Negative Prompt")
|
27 |
+
sd_input = gr.Image(label="Input Image")
|
28 |
+
sd_output = gr.Image(label="Output Image")
|
29 |
+
submit_btn = gr.Button(value = "Submit")
|
30 |
+
sd_inputs = [prompt_input_seg, negative_prompt_seg, sd_input]
|
31 |
+
submit_btn.click(fn=infer_sd, inputs=sd_inputs, outputs=[sd_output])
|
32 |
+
#examples = [["postage stamp from california", "low quality", "charr_output.png", "charr_output.png" ]]
|
33 |
+
#gr.Examples(fn = infer_sd, inputs = ["text", "text", "image", "image"], examples=examples, cache_examples=True)
|
34 |
+
|
35 |
+
|
36 |
+
demo.launch()
|