Enes Bol commited on
Commit ·
89a66a4
1
Parent(s): fd4bbc8
sec
Browse files
app.py
CHANGED
|
@@ -15,11 +15,8 @@ import numpy as np
|
|
| 15 |
import os
|
| 16 |
import shutil
|
| 17 |
warnings.filterwarnings("ignore")
|
| 18 |
-
|
| 19 |
st.title('Background Generation')
|
| 20 |
-
|
| 21 |
st.write('This app generates new backgrounds for images.')
|
| 22 |
-
|
| 23 |
# set environment variable for dll
|
| 24 |
os.environ['KMP_DUPLICATE_LIB_OK']='True'
|
| 25 |
|
|
@@ -148,9 +145,9 @@ run_model_button = st.button("Run Model")
|
|
| 148 |
def initialize_pipe():
|
| 149 |
pipe = StableDiffusionInpaintPipeline.from_pretrained("runwayml/stable-diffusion-inpainting",
|
| 150 |
revision="fp16",
|
| 151 |
-
torch_dtype=torch.
|
| 152 |
safety_checker = None,
|
| 153 |
-
requires_safety_checker = False).to("cuda")
|
| 154 |
|
| 155 |
pipe.safety_checker = None
|
| 156 |
pipe.requires_safety_checker = False
|
|
|
|
| 15 |
import os
|
| 16 |
import shutil
|
| 17 |
warnings.filterwarnings("ignore")
|
|
|
|
| 18 |
st.title('Background Generation')
|
|
|
|
| 19 |
st.write('This app generates new backgrounds for images.')
|
|
|
|
| 20 |
# set environment variable for dll
|
| 21 |
os.environ['KMP_DUPLICATE_LIB_OK']='True'
|
| 22 |
|
|
|
|
| 145 |
def initialize_pipe():
|
| 146 |
pipe = StableDiffusionInpaintPipeline.from_pretrained("runwayml/stable-diffusion-inpainting",
|
| 147 |
revision="fp16",
|
| 148 |
+
torch_dtype=torch.float32, #16 for gpu
|
| 149 |
safety_checker = None,
|
| 150 |
+
requires_safety_checker = False) #.to("cuda")
|
| 151 |
|
| 152 |
pipe.safety_checker = None
|
| 153 |
pipe.requires_safety_checker = False
|