Spaces:
Runtime error
Runtime error
Added basic control flow
Browse files
app.py
CHANGED
@@ -1,16 +1,21 @@
|
|
1 |
-
import streamlit
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
|
5 |
model_id = "dream-textures/texture-diffusion"
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
13 |
image.save("bricks.png")
|
14 |
|
15 |
-
x =
|
16 |
-
|
|
|
1 |
+
import streamlit
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
|
5 |
model_id = "dream-textures/texture-diffusion"
|
6 |
|
7 |
+
if torch.cuda.is_available():
|
8 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
9 |
+
pipe = pipe.to("cuda")
|
10 |
+
else:
|
11 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
12 |
|
13 |
+
examplePrompt = "pbr brick wall"
|
14 |
+
streamlit.title("Texel Space Interpolation")
|
15 |
+
prompt = streamlit.text_input(label="Prompt", value=examplePrompt)
|
16 |
+
|
17 |
+
image = pipe(prompt).images[0]
|
18 |
image.save("bricks.png")
|
19 |
|
20 |
+
#x = streamlit.slider('Select a value')
|
21 |
+
#streamlit.write(x, 'squared is', x * x)
|