liuyizhang
commited on
Commit
•
3e61a48
1
Parent(s):
70c927a
update app.py
Browse files- app.py +5 -0
- requirements.txt +5 -4
app.py
CHANGED
@@ -5,6 +5,9 @@ warnings.filterwarnings('ignore')
|
|
5 |
import subprocess, io, os, sys, time
|
6 |
from loguru import logger
|
7 |
|
|
|
|
|
|
|
8 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
9 |
|
10 |
if os.environ.get('IS_MY_DEBUG') is None:
|
@@ -241,12 +244,14 @@ sam_model = build_sam(checkpoint=sam_checkpoint) # .to(device)
|
|
241 |
sam_predictor = SamPredictor(sam_model)
|
242 |
sam_mask_generator = SamAutomaticMaskGenerator(sam_model)
|
243 |
|
|
|
244 |
# initialize stable-diffusion-inpainting
|
245 |
logger.info(f"initialize stable-diffusion-inpainting...")
|
246 |
sd_pipe = None
|
247 |
if os.environ.get('IS_MY_DEBUG') is None:
|
248 |
sd_pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
249 |
# "runwayml/stable-diffusion-inpainting",
|
|
|
250 |
"stabilityai/stable-diffusion-2-inpainting",
|
251 |
torch_dtype=torch.float16
|
252 |
)
|
|
|
5 |
import subprocess, io, os, sys, time
|
6 |
from loguru import logger
|
7 |
|
8 |
+
os.system("pip install diffuser==0.16.0")
|
9 |
+
os.system("pip install transformers==4.29.1")
|
10 |
+
|
11 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
12 |
|
13 |
if os.environ.get('IS_MY_DEBUG') is None:
|
|
|
244 |
sam_predictor = SamPredictor(sam_model)
|
245 |
sam_mask_generator = SamAutomaticMaskGenerator(sam_model)
|
246 |
|
247 |
+
os.system("pip list")
|
248 |
# initialize stable-diffusion-inpainting
|
249 |
logger.info(f"initialize stable-diffusion-inpainting...")
|
250 |
sd_pipe = None
|
251 |
if os.environ.get('IS_MY_DEBUG') is None:
|
252 |
sd_pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
253 |
# "runwayml/stable-diffusion-inpainting",
|
254 |
+
# revision="fp16"
|
255 |
"stabilityai/stable-diffusion-2-inpainting",
|
256 |
torch_dtype=torch.float16
|
257 |
)
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
accelerate
|
2 |
addict
|
3 |
-
diffusers
|
4 |
gradio
|
5 |
huggingface_hub
|
6 |
matplotlib
|
@@ -17,11 +17,12 @@ termcolor
|
|
17 |
timm
|
18 |
torch
|
19 |
torchvision
|
20 |
-
transformers
|
21 |
yapf
|
22 |
numba
|
23 |
-
|
|
|
24 |
|
25 |
lama-cleaner==0.25.0
|
26 |
openmim==0.1.5
|
27 |
-
mmcv==2.0.0
|
|
|
1 |
accelerate
|
2 |
addict
|
3 |
+
diffusers==0.16.0
|
4 |
gradio
|
5 |
huggingface_hub
|
6 |
matplotlib
|
|
|
17 |
timm
|
18 |
torch
|
19 |
torchvision
|
20 |
+
transformers==4.29.1
|
21 |
yapf
|
22 |
numba
|
23 |
+
scipy
|
24 |
+
safetensors
|
25 |
|
26 |
lama-cleaner==0.25.0
|
27 |
openmim==0.1.5
|
28 |
+
mmcv==2.0.0
|