Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,20 @@ import streamlit as st
|
|
3 |
x = st.slider('Select a value')
|
4 |
st.write(x, 'squared is', x * x)
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
"""
|
9 |
import json
|
|
|
3 |
x = st.slider('Select a value')
|
4 |
st.write(x, 'squared is', x * x)
|
5 |
|
6 |
+
from diffusers import DiffusionPipeline
|
7 |
+
import torch
|
8 |
+
|
9 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
10 |
+
|
11 |
+
|
12 |
+
# if using torch < 2.0
|
13 |
+
# pipe.enable_xformers_memory_efficient_attention()
|
14 |
+
|
15 |
+
prompt = "An astronaut riding a green horse"
|
16 |
+
|
17 |
+
images = pipe(prompt=prompt).images[0]
|
18 |
+
|
19 |
+
#print("hello")
|
20 |
|
21 |
"""
|
22 |
import json
|