File size: 999 Bytes
a7f9812
 
9daaa25
40530ef
a24d8f5
2b00d26
877c452
 
 
2b00d26
a24d8f5
ea01239
 
78d09d5
2b00d26
 
9daaa25
 
 
78d09d5
 
 
e7ca8e6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()