Spaces:
Runtime error
Runtime error
Commit ·
6d0841b
1
Parent(s): 013d4ed
Update app.py
Browse files103 unmodified lines104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171103 unmodified lines}"""theme = "Base"with gr.Blocks(css=css) as demo:with gr.Row():gr.Markdown("""<h1><center>Stable Diffusion</center></h1>""")with gr.Row():with gr.Column(scale=6, min_width=600):prompt = gr.Textbox(label="Prompt", placeholder="beautiful cat, 8k", show_label=True, lines=2)negative_prompt = gr.Textbox(label="Negative Prompt", value="text, blurry, fuzziness", placeholder="What you don't want to see in the image", show_label=True, lines=3)with gr.Column():text_button = gr.Button("Generate", variant='primary', elem_id="generate")with gr.Row():with gr.Column(scale=2):image_output = gr.Image()with gr.Accordion("Advanced options", open=False):with gr.Column(scale=6):model = gr.Dropdown(interactive=True,value="v1-5-pruned-emaonly.safetensors [d7049739]", show_label=True, label="Model", choices=prodia_client.list_models())with gr.Column(scale=1):sampler = gr.Dropdown(value="DPM++ SDE", show_label=True, label="Sampler", choices=["Euler","Euler a","LMS","Heun","DPM2","DPM2 a","DPM++ 2S a","DPM++ 2M","DPM++ SDE","DPM fast","DPM adaptive","LMS Karras","DPM2 Karras","DPM2 a Karras","DPM++ 2S a Karras","DPM++ 2M Karras","DPM++ SDE Karras","DDIM","PLMS",])with gr.Column(scale=1):steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=30, step=1, interactive=True)with gr.Row():with gr.Column(scale=1):width = gr.Slider(label="Width", maximum=1024, value=512, step=8)height = gr.Slider(label="Height", maximum=1024, value=512, step=8)cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)seed = gr.Number(label="Seed", value=-1, info = """'-1' is a random seed""")text_button.click(flip_text, inputs=[prompt, negative_prompt, model, sampler, cfg_scale, width, height, seed], outputs=image_output)demo.queue(concurrency_count=10)demo.launch()103 unmodified lines104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177103 unmodified lines}"""with gr.Blocks(css=css, theme="Base") as demo:with gr.Row():gr.Markdown("<h1><center>Stable Diffusion Demo</center></h1>")with gr.Tab("Playground"):with gr.Row():with gr.Column(scale=6, min_width=600):prompt = gr.Textbox(label="Prompt", placeholder="beautiful cat, 8k", show_label=True, lines=2)negative_prompt = gr.Textbox(label="Negative Prompt", value="text, blurry, fuzziness", placeholder="text, blurry, fuzziness", show_label=True, lines=3)with gr.Column():text_button = gr.Button("Generate", variant='primary', elem_id="generate")with gr.Row():with gr.Column(scale=3):with gr.Column(scale=2):image_output = gr.Image()with gr.Accordion("Advanced options", open=False):with gr.Row():with gr.Column(scale=6):model = gr.Dropdown(interactive=True,value="v1-5-pruned-emaonly.safetensors [d7049739]", show_label=True, label="Stable Diffusion Checkpoint", choices=prodia_client.list_models())with gr.Row():with gr.Column(scale=1):sampler = gr.Dropdown(value="DPM++ SDE", show_label=True, label="Sampler", choices=["Euler","Euler a","LMS","Heun","DPM2","DPM2 a","DPM++ 2S a","DPM++ 2M","DPM++ SDE","DPM fast","DPM adaptive","LMS Karras","DPM2 Karras","DPM2 a Karras","DPM++ 2S a Karras","DPM++ 2M Karras","DPM++ SDE Karras","DDIM","PLMS",])with gr.Column(scale=1):steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=30, step=1)with gr.Row():with gr.Column(scale=1):width = gr.Slider(label="Width", maximum=1024, value=512, step=8)height = gr.Slider(label="Height", maximum=1024, value=512, step=8)with gr.Column(scale=1):batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)seed = gr.Number(label="Seed", value=-1, info="""'-1' is random seed""")text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)demo.queue(concurrency_count=10)demo.launch()
app.py+55-49