Spaces:
Runtime error
Runtime error
Commit ·
3bebd7a
1
Parent(s): ff4fa03
`app.py`: upgrade layout
Browse files80 unmodified lines818283848586878889909192939418 unmodified lines11311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115280 unmodified linesprodia_client = Prodia(api_key=os.getenv("PRODIA_API_KEY"))def flip_text(prompt, negative_prompt, model, steps, sampler, cfg_scale):result = prodia_client.generate({"prompt": prompt,"negative_prompt": negative_prompt,"model": model,"steps": steps,"sampler": sampler,"cfg_scale": cfg_scale})job = prodia_client.wait(result)18 unmodified lineswith gr.Row():with gr.Column(scale=3):with gr.Tab("Generation"):with gr.Row():with gr.Column(scale=1):model = gr.Dropdown(interactive=True,value="v1-5-pruned-emaonly.safetensors [d7049739]", show_label=False, choices=prodia_client.list_models())sampler = gr.Dropdown(value="Euler a", show_label=False, 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", miniumum=1, maximum=50, value=25)cfg_scale = gr.Slider(label="CFG Scale", miniumum=1, maximum=20, value=7)with gr.Column(scale=2):image_output = gr.Image()text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale], outputs=image_output)demo.launch()80 unmodified lines8182838485868788899091929394959618 unmodified lines11511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516680 unmodified linesprodia_client = Prodia(api_key=os.getenv("PRODIA_API_KEY"))def flip_text(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height):result = prodia_client.generate({"prompt": prompt,"negative_prompt": negative_prompt,"model": model,"steps": steps,"sampler": sampler,"cfg_scale": cfg_scale,"width": width,"height": height})job = prodia_client.wait(result)18 unmodified lineswith gr.Row():with gr.Column(scale=3):with gr.Tab("Generation"):model = gr.Dropdown(interactive=True,value="v1-5-pruned-emaonly.safetensors [d7049739]", show_label=True, label="Model", choices=prodia_client.list_models())with gr.Row():with gr.Column(scale=1):sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", 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="Sampling Steps", miniumum=1, maximum=50, value=25, step=1)with gr.Row():with gr.Column(scale=1):width = gr.Slider(label="Width", miniumum=1, maximum=1024, value=512, step=1)height = gr.Slider(label="Height", miniumum=1, maximum=1024, value=512, step=1)with gr.Column(scale=1):batch_size = gr.Slider(label="Batch Size", miniumum=1, maximum=1, value=1)batch_count = gr.Slider(label="Batch Count", miniumum=1, maximum=1, value=1)cfg_scale = gr.Slider(label="CFG Scale", miniumum=1, maximum=20, value=7, step=1)seed = gr.Number(label="Seed", value=-1)with gr.Column(scale=2):image_output = gr.Image()text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height], outputs=image_output)demo.launch()
app.py+42-28