lllyasviel commited on
Commit
a084727
·
1 Parent(s): 2494346
Files changed (1) hide show
  1. draft.py +27 -0
draft.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from modules.sdxl_styles import apply_style
4
+ from modules.default_pipeline import process
5
+
6
+
7
+ def generate_clicked(positive_prompt):
8
+
9
+ p, n = apply_style('sai-cinematic', positive_prompt, '')
10
+
11
+ print(p)
12
+ print(n)
13
+
14
+ return process(positive_prompt=p,
15
+ negative_prompt=n)
16
+
17
+
18
+ block = gr.Blocks().queue()
19
+ with block:
20
+ with gr.Column():
21
+ prompt = gr.Textbox(label="Prompt", value='a handsome man in forest')
22
+ run_button = gr.Button(label="Run")
23
+ result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", height=1280)
24
+ run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[result_gallery])
25
+
26
+
27
+ block.launch()