From f20cc1967e8c51eb359c5b67a17a1384299f21fc Mon Sep 17 00:00:00 2001 From: lvmin Date: Thu, 10 Aug 2023 13:59:40 -0700 Subject: [PATCH] i --- draft.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 draft.py diff --git a/draft.py b/draft.py new file mode 100644 index 0000000..c22fffc --- /dev/null +++ b/draft.py @@ -0,0 +1,27 @@ +import gradio as gr + +from modules.sdxl_styles import apply_style +from modules.default_pipeline import process + + +def generate_clicked(positive_prompt): + + p, n = apply_style('sai-cinematic', positive_prompt, '') + + print(p) + print(n) + + return process(positive_prompt=p, + negative_prompt=n) + + +block = gr.Blocks().queue() +with block: + with gr.Column(): + prompt = gr.Textbox(label="Prompt", value='a handsome man in forest') + run_button = gr.Button(label="Run") + result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", height=1280) + run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[result_gallery]) + + +block.launch()