homer-meng commited on
Commit
67db81c
·
1 Parent(s): 4444c53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,10 +1,8 @@
1
- import streamlit as st
2
- from transformers import pipeline
3
 
4
- pipe = pipeline('sentiment-analysis')
 
5
 
6
- text =st.text_area('enter some text!')
7
-
8
- if text:
9
- out = pipe(text)
10
- st.json(out)
 
1
+ import torch
2
+ from diffusers import StableDiffusionPipeline
3
 
4
+ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
5
+ pipe = pipe.to("cuda")
6
 
7
+ prompt = "a photo of an astronaut riding a horse on mars"
8
+ image = pipe(prompt).images[0]