import gradio as gr title = "Image gen" description = "stabilityai/stable-diffusion-2-depth is broken at the moment, PR if you know how to fix, otherwise I'll figure out how to soon." examples = [ ["The Moon's orbit around the Earth has"], ['The tower is 342 meters (1,063 ft) tall,'], ['The smooth Borealis basin in the Northern Hemisphere covers 40%'] ] m1 = gr.load("huggingface/runwayml/stable-diffusion-v1-5") m2 = gr.load("huggingface/prompthero/openjourney") m3 = gr.load("huggingface/stabilityai/stable-diffusion-2-depth") def fn(model_choice, input): if model_choice=="runwayml/stable-diffusion-v1-5": return m1(input) elif model_choice=="prompthero/openjourney": return m2(input) elif model_choice=="stabilityai/stable-diffusion-2-depthy": return m3(input) gr.Interface(fn, [gr.inputs.Dropdown(["runwayml/stable-diffusion-v1-5", "prompthero/openjourney", "stabilityai/stable-diffusion-2-depth"]), "text"], "image", title=title, description=description).launch()