Spaces:
Sleeping
Sleeping
maxaxaxaxxaxaxaax commited on
Commit ·
a113b53
1
Parent(s): 252021e
try 1
Browse files- app.py +13 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from diffusers import StableDiffusionPipeline
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
| 6 |
+
pipe = StableDiffusionPipeline.from_pretrained(
|
| 7 |
+
model_id, torch_dtype=torch.float16)
|
| 8 |
+
pipe = pipe.to("cuda")
|
| 9 |
+
|
| 10 |
+
prompt = "a photo of an astronaut riding a horse on mars"
|
| 11 |
+
image = pipe(prompt).images[0]
|
| 12 |
+
|
| 13 |
+
image.save("astronaut_rides_horse.png")
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
torch
|
| 3 |
+
diffusers
|