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