File size: 610 Bytes
2fa305b
 
 
 
 
 
 
 
 
 
 
 
 
 
46da75b
2fa305b
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("prompthero/openjourney")

# prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
# image = pipe(prompt).images[0]

def generate(input_prompt):
    generations = pipe(input_prompt)
    generated_img = generations.images[0]
    return generated_img

gradio_app = gr.Interface(
    generate,
    inputs=gr.Text(label="What kind of image would you like to generate?"),
    outputs=[gr.Image(label="Generated Image")],
    title="IMAGE GENERATION!!",
)

if __name__ == "__main__":
    gradio_app.launch()