Spaces:
Runtime error
Runtime error
Added basic sample and requirements
Browse files- app.py +16 -0
- requirements.txt +3 -0
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from diffusers import StableDiffusionPipeline
|
3 |
+
import torch
|
4 |
+
|
5 |
+
model_id = "dream-textures/texture-diffusion"
|
6 |
+
|
7 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
8 |
+
pipe = pipe.to("cuda")
|
9 |
+
|
10 |
+
prompt = "pbr brick wall"
|
11 |
+
image = pipe(prompt).images[0]
|
12 |
+
|
13 |
+
image.save("bricks.png")
|
14 |
+
|
15 |
+
x = st.slider('Select a value')
|
16 |
+
st.write(x, 'squared is', x * x)
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
diffusers
|
3 |
+
streamlit
|