File size: 717 Bytes
8969379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from PIL import Image  
from diffusers import StableDiffusionPipeline


katz_model_path = 'maximalmargin/katz'
katz = StableDiffusionPipeline.from_pretrained(katz_model_path)


def predict(text):
    image = katz(prompt = text).images[0]
    return [image]

gallery = gr.Gallery(
    label="Generated images", show_label=False, elem_id="gallery"
).style(height="auto")

gr.Interface(
    predict,
    inputs=gr.Textbox(
                        label="Enter your prompt",
                        show_label=False,
                        max_lines=1,
                        placeholder="Enter your prompt",
                    ),
    outputs=[gallery],
    title="Alex Katz Portraiter",
).launch()