mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
i
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
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('cinematic-default', 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='Fooocus', show_label=True, elem_id="gallery",
|
||||
object_fit='contain', height=768)
|
||||
run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[result_gallery])
|
||||
|
||||
|
||||
block.launch()
|
||||
@@ -15,17 +15,21 @@ def generate_clicked(positive_prompt):
|
||||
negative_prompt=n)
|
||||
|
||||
|
||||
block = gr.Blocks().queue()
|
||||
block = gr.Blocks()
|
||||
with block:
|
||||
with gr.Column():
|
||||
gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', height=768)
|
||||
with gr.Row():
|
||||
with gr.Column(scale=0.85):
|
||||
prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False)
|
||||
with gr.Column(scale=0.15, min_width=0):
|
||||
run_button = gr.Button(label="Generate", value="Generate")
|
||||
with gr.Row():
|
||||
advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False)
|
||||
run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[gallery])
|
||||
with gr.Row():
|
||||
with gr.Column(scale=0.7):
|
||||
gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', height=768)
|
||||
with gr.Row():
|
||||
with gr.Column(scale=0.85):
|
||||
prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False)
|
||||
with gr.Column(scale=0.15, min_width=0):
|
||||
run_button = gr.Button(label="Generate", value="Generate")
|
||||
with gr.Row():
|
||||
advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False)
|
||||
with gr.Column(scale=0.3):
|
||||
with gr.Group():
|
||||
gr.Textbox()
|
||||
run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[gallery])
|
||||
|
||||
block.launch()
|
||||
|
||||
Reference in New Issue
Block a user