Kev09 commited on
Commit
ef12b6d
1 Parent(s): 53d44bb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+ from diffusers import AutoPipelineForText2Image
7
+ import torch
8
+ def pipee():
9
+ pipeline = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16).to("cpu")
10
+
11
+
12
+ pipeline.load_lora_weights("ostris/super-cereal-sdxl-lora", weight_name="cereal_box_sdxl_v1.safetensors")
13
+ prompt = "bears, pizza bites"
14
+ image = pipeline(prompt).images[0]
15
+ return image
16
+
17
+
18
+
19
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
20
+ iface.launch()